I need to use the underlying arrays of several eigen matrices that could be RowMajor or ColumnMajor.
Is there any way to check which of the formats is used? (besides comparing the first column, with the first n elements of the row/column)
I found the isRowMajor as part of an Enum in the base class for Eigen, but I don't know how to access it from inside my code.
The following works for me (EigenMatrixType is anything derived from Eigen::MatrixBase)
EigenMatrixType M(...);
std::cout << "IsRowMajor?: " << M.IsRowMajor << std::endl;
(edit: It seems to work also with SparseMatrix, even if i cannot find the enum in the the SparseMatrixBase documentation)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With