This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] Row major and column major formats?

Tags: None
(comma "," separated)
stair314
Registered Member
Posts
8
Karma
0
Is there someplace in the documentation that explains when Eigen uses row major or column major formats? Is there a way to tell at runtime where a matrix is in one format or the other? Thanks!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
The default is column major and you cannot select one storage format at runtime. This must be specified at compile time via the 4th template argument of Matrix, eg:
Code: Select all
Matrix


Note that if you write a template function taking an Eigen matrix or expression, then you can query the storage format like this:

Code: Select all
template void foo(const MatrixBase& m)
{
  const bool isRowMajor = inf(Derived::Flags)&RowMajorBit;
  ...
}

Last edited by bjacob on Sat May 16, 2009 12:36 pm, edited 1 time in total.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]