Registered Member
|
If I have a templated function that accepts a parameter of Eigen::DenseBase<Derived>& matrix, is there a way to iterate over the entries of the DenseBase matrix in a way that respects the storage order? I see an innerSize and an outerSize method to get the sizes of each, but no way to actually get the values, e.g., I would like to do something like:
Does some equivalent of getValueAtOuterInner exist, or should I perform this iteration in some other fashion? Thank you! ... edited to fixe typo |
Moderator
|
here it is: mat.coeffByOuterInner(o,i)
|
Registered Member
|
Thank you! Is there a non-const version? I suppose I can use
but that feels a bit verbose. |
Moderator
|
yes, coeffRefByOuterInner. They are the respective versions of the .coeff() and .coeffRef() methods.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]