Re: [eigen] Defining a custom procedurally defined matrix type (circular rotation of an existing matrix)

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


On Mon, 26 May 2014, Wenzel Jakob wrote:

I'm wondering if it is possible to define a custom new matrix type in Eigen that is evaluated procedurally (i.e. not directly backed by an array)?

In particular I'm looking to define a new matrix type that's defined as the circular shift (in rows and columns) of another (dense) matrix. This means that an access to coeff() entails two modulo operations before evaluating the original matrix.

If there is some existing example of such an a procedurally defined matrix, it would be great if you could point me to it.

Yes, this is possible. I think the .reverse() method is a good example for this; see the file Reverse.h and the documentation at
http://eigen.tuxfamily.org/dox-devel/classEigen_1_1DenseBase.html#a6e354bb81f0c7b6888c6a0ce4b4649e2

I should warn you however that this does require an understanding of the internals of Eigen which are not documented as well as I would like. We are working on a rewrite which will hopefully help with this issue (the so-called evaluators, see http://eigen.tuxfamily.org/bz/show_bug.cgi?id=99 ).


Jitse



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