[eigen] How does toDenseMatrix() work?

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

Hi eigen developers,

  In some specialized classes like DiagonalMatrix, I see the following member:

DenseMatrixType toDenseMatrix() const { return derived(); }

  where DenseMatrixType is a typedef for the full MxN container whereas 
derived() returns the "sparse" derived instance. Somewhere, the Eigen3 
machinery is ensuring an element-by-element "translation" from the derived 
matrix expression to the full MxN matrix. What is this mechanism?

   Is this happening because the lvalue's EigenBase<> copy CTOR and copy 
assignment operator call the rvalue's evalTo() method? So if I write a custom 
matrix class for compact representation, I only need to inherit EigenBase<> 
and override the evalTo() method for this translation to work?


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