

Ask HN: A good C++ multi-dimensional array library? - hatred

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&#x2F;NT2&#x2F;Armadillo&#x2F;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 ?<p>Upto now, all I could find was:-<p>- 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 )<p>It will be great if I could find something like a free version of RogueWave arrays which can be declared without specifying dimensions.<p>Thanks for reading through the post.
======
slavio
Sparse matrices or not? You could look into OpenCV's Mat and SparseMat here:
[http://docs.opencv.org/modules/core/doc/basic_structures.htm...](http://docs.opencv.org/modules/core/doc/basic_structures.html#Mat)

~~~
hatred
Thanks 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.

------
torrent
I 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
I 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
Hateing the idea of array of arraya is like hating recursivity.

