3 ms·
Ask HN: A good C++ multi-dimensional array library?
I was working on a project which involved replacing our old numerical library back-end to some other newer alternative. I had a look at the possible options(Eigen/NT2/Armadillo/MTL4 among others) and decided to move on with Eigen. However, Eigen does not have a multi-dimensional array implementation. It can only support upto 2-D arrays. I was wondering if there are some C++ multi-dimensional libraries you folks might know of ?
Upto now, all I could find was:-
- Boost MultiArrays( specifying dimensions and size at compile time make it a no-go for me )
- Blitz++ ( same issues as above i.e. dimension needs to be specified at compile time )
It will be great if I could find something like a free version of RogueWave arrays which can be declared without specifying dimensions.
Thanks for reading through the post.
- torrent 13y agoI dont know which operations you are going to do with the arrays but what about just use a array of arrays or matrices of matrices of matrices of...?
- hatred 13y agoI am willing go give away everything for now and just have support for basic arithmetic operations, creation of sub matrix views ala numpy for the time being. I will be able to do the other operations via Eigen by creating a view over the native array. I hate the idea of creating an array of arrays though.
- torrent 13y agoHateing the idea of array of arraya is like hating recursivity.
- slavio 13y agoSparse matrices or not? You could look into OpenCV's Mat and SparseMat here: http://docs.opencv.org/modules/core/doc/basic_structures.html#Mat http://docs.opencv.org/modules/core/doc/basic_structures.htm...
- hatred 13y agoThanks for the reply slavio. - It seems that no expression template machinery is being used? Hence, it might be too slow for most basic operations for us due to creation of temporaries. - Does not have support for n-dimensional views. You can only get a view upon contiguous rows or columns. ( However, I might ignore this if the first point is settled ) - No vectorization support etc which you get with other libraries like Eigen/NT2 among others. I might be wrong on some points though.