c++ - Eigen library got "comma initilizer", why make column-major the default? -
according documentation eigen (c++) library, default matrix column-major. effectively, little 3x3 matrix like
1 4 7 2 5 8 3 6 9 then got comma initializer, front end end appears row-major like, backend still column-major
example: (from eigen doc) matrix3f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9; std::cout << m; output: 1 2 3 4 5 6 7 8 9 yes, realise rowmajor need create row-major matrix. wondering, since have comma initializer, why create column-major default?
one reason, maybe not major, when interfacing raw info buffers. matrix buffers sent via opengl shader programs column major, , similarity allows send eigen matrix shader phone call .data()
c++ eigen
No comments:
Post a Comment