Garmaine Staff asked 1 year ago

Although Eigen is C++ library and C/C++ use row-major storage structure, why Eigen prefers to use column-major storage order? From Why does MATLAB use column-major order? post, I understand that MATLAB use it because of historical (due to FORTRAN) reasons. But Eigen is built on C++ at the beginning as far as I know.

In Eigen Library website it says:

The default in Eigen is column-major. Naturally, most of the development and testing of the Eigen library is thus done with column-major matrices. This means that, even though we aim to support column-major and row-major storage orders transparently, the Eigen library may well work best with column-major matrices. (retrieved from

Maybe due to using C++ and OpenCV very frequently, my brain tends to think in row-major form. Are there any performance (cache locality, load/store speed etc.) reasons of making development and testing of Eigen library with column-major matrices?