[eigen] Feature request

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

I have been using Eigen3 in my codes, mostly the matrix class to solve linear systems and to perform SVD calculations. It is great!

Recently I have also found the Tensor class extremely useful, as it provides multidimensional arrays in c++ with delayed evaluation. A feature that I have been missing is the possibility of starting indexing an array from any number (aka, the first element of a dimension is not index zero). This feature would simplify greatly dealing with applications where domain decomposition is required. We are writing a new radiative transfer code and I would like to use Eigen3 to deal with arrays internally.

Would it be possible to add such feature?  

The constructor could be such that it takes N arguments or 2*N arguments. In the latter case, we would have two numbers for each dimension the initial element and the final element. In the former case we would have the current behavior.

In practice implementing this feature is relatively easy and it only requires storing the offset for each dimension. The linearized array offset is calculated also very similarly, but removing the offset from the index before multiplying by the corresponding stride.

I have coded a simple array class with these features but it is missing all the bells and whistles of Eigen, so I would prefer to use the latter.

Also, I have made one of my codes publicly available and it uses Eigen, in case you want to add it to the list of codes using Eigen3:

Best regards!

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/