[eigen] How does toDenseMatrix() work? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] How does toDenseMatrix() work?
- From: Manoj Rajagopalan <rmanoj@xxxxxxxxx>
- Date: Fri, 23 Jul 2010 14:15:13 -0400
- Organization: EECS Dept., University of Michigan, Ann Arbor, MI, USA
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?
thanks,
Manoj