I am reading data from a file, where I am expecting a sequence of data (Array of data).
The data can be of different types...
Array<double>
Array<double[]>
Array<double[,]>
Array<double[,,]>
Array<double[,,,]>
Array<double[,,,,]>
Array<double[,,,,,]>
Array<double[,,,,,,]>
Array<double[,,,,....n]>
Right now, I have used cases for each case and wrote code for maximum 10 dimensions. But I want it to be for n-dimensions.
Is there any other way to write/read data to array without writing nested loops?
Details: (EDIT) I am reading a binary file, in which two things are specified before the data, 1) Dimensions list 2) Element-Limit
I read these list of integers and build my data type. For example:
Dimensions = {15,32,128,5}
Element-Limit = {15,32,128,5}
Then I build a 4D- array like this
double[,,,] dataStream = new double[15,32,128,5];
And this dimension and element-limit may be of n-numbers
And one thing more, I am reading a collection of data... this dataStream will go in Array then like this Array<double[,,,]>
Array<object>?