How to get 1D column array and 1D row array from 2D array? (C# .NET) -


i have double[,] array;. possible double[] columnarray0 = array[0,].toarray() , double[] rowarray1 = array[,1].toarray() without making copy of every elemet(using for)?

thanks.

arrays memory area entries stored in consecutive way. depending on data layout in memory possible either rows or columns.

instead of 2d array double[,] type in case better use array of arrays double[][]

double[][] array2d = new double[10][]; array2d[0] = new double[10]; array2d[1] = new double[10]; ...  , then: double[] rowarray0 = array2d[0]; 

depending on how put data in array, can treat array2d column array. have both @ same time not possible.

also have here: multidimensional array [][] vs [,]


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -