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
Post a Comment