Matrix repr assumes row major memory (eigen is column major)

Bug #549787 reported by Jeff Packer on 2010-03-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PyEigen
Status tracked in Trunk
Trunk
Undecided
Jeff Packer

Bug Description

The problem is just that repr goes through the elements in the incorrect order to print. This may have been intentional, but is inconsistent with the way Eiegen works.

C++ Example:

Eigen::Matrix4f m;
m << 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16;
Eigen::Matrix4f n = Eigen::Matrix4f::Ones();
cout << m * n << endl;

Output:

10 10 10 10
26 26 26 26
42 42 42 42
58 58 58 58

PyEigen Example:

>>> from pyeigen import *
>>> m = Matrix4f( 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
>>> m
Matrix4f(1.000000, 5.000000, 9.000000, 13.000000,
         2.000000, 6.000000, 10.000000, 14.000000,
         3.000000, 7.000000, 11.000000, 15.000000,
         4.000000, 8.000000, 12.000000, 16.000000)
>>> n = Matrix4f.ones()
>>> n
Matrix4f(1.000000, 1.000000, 1.000000, 1.000000,
         1.000000, 1.000000, 1.000000, 1.000000,
         1.000000, 1.000000, 1.000000, 1.000000,
         1.000000, 1.000000, 1.000000, 1.000000)
>>> m*n
Matrix4f(10.000000, 26.000000, 42.000000, 58.000000,
         10.000000, 26.000000, 42.000000, 58.000000,
         10.000000, 26.000000, 42.000000, 58.000000,
         10.000000, 26.000000, 42.000000, 58.000000)

Related branches

Jeff Packer (jfpacker) on 2010-03-27
Changed in pyeigen:
assignee: nobody → Jeff Packer (jfpacker)
Jeff Packer (jfpacker) on 2010-03-27
Changed in pyeigen:
status: New → In Progress
Jeff Packer (jfpacker) on 2010-03-27
Changed in pyeigen:
status: In Progress → Fix Committed
Changed in pyeigen:
milestone: none → 0.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers