Multidimensional arrays #20

Open
opened 2021-07-09 11:58:47 +00:00 by miloush · 2 comments
miloush commented 2021-07-09 11:58:47 +00:00 (Migrated from github.com)

Would it be possible to have a functions similar to IArray.ConvertToDoubleArray returning arrays of the right dimensions? Currently one needs to know how the file format orders multidimensional data into single dimensional array in order to be able to use it.

Would it be possible to have a functions similar to `IArray.ConvertToDoubleArray` returning arrays of the right dimensions? Currently one needs to know how the file format orders multidimensional data into single dimensional array in order to be able to use it.
mahalex commented 2021-07-10 10:27:31 +00:00 (Migrated from github.com)

Thanks for opening the issue!
I added the following methods to IArray:

  • double[,]? ConvertTo2dDoubleArray();
  • Array? ConvertToMultidimensionalDoubleArray();

The 2-dimensional case is probably the most common, so I feel that it deserves an explicit method.
The update is published on nuget.org as version 1.4.0-beta1. Please see if the API is suitable for you.
I guess I will do the same for ConvertToComplexArray() later.

Thanks for opening the issue! I added the following methods to IArray: * `double[,]? ConvertTo2dDoubleArray();` * `Array? ConvertToMultidimensionalDoubleArray();` The 2-dimensional case is probably the most common, so I feel that it deserves an explicit method. The update is published on nuget.org as version 1.4.0-beta1. Please see if the API is suitable for you. I guess I will do the same for `ConvertToComplexArray()` later.
miloush commented 2021-07-15 20:16:36 +00:00 (Migrated from github.com)

I used ConvertToMultidimensionalDoubleArray and its working as expected (my array is 3D). thank you!

I would argue that ConvertToMultidimensionalDoubleArray() as double[,]? is simple enough to not add extra API, but if you go for it I think it should be called 2D rather than 2d, all classes in the framework are 2D and/or 3D with capital D.

I used `ConvertToMultidimensionalDoubleArray` and its working as expected (my array is 3D). thank you! I would argue that `ConvertToMultidimensionalDoubleArray() as double[,]?` is simple enough to not add extra API, but if you go for it I think it should be called `2D` rather than `2d`, all classes in the framework are `2D` and/or `3D` with capital D.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mahalex/MatFileHandler#20
No description provided.