Matrix repr assumes row major memory (eigen is column major)
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
PyEigen | Status tracked in Trunk | |||||
Trunk |
Fix Committed
|
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,
Eigen::Matrix4f n = Eigen::
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,
>>> 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
- Jussi Lepistö: Approve
-
Diff: 385 lines (+91/-15)18 files modifiedsource/matrix/matrix2f.cpp (+2/-1)
source/matrix/matrix3f.cpp (+3/-3)
source/matrix/matrix4f.cpp (+5/-5)
source/vector/rowvector2f.cpp (+1/-1)
source/vector/rowvector3f.cpp (+1/-1)
source/vector/rowvector4f.cpp (+1/-1)
source/vector/vector2f.cpp (+1/-1)
source/vector/vector3f.cpp (+1/-1)
source/vector/vector4f.cpp (+1/-1)
test/test_matrix2f.py (+8/-0)
test/test_matrix3f.py (+9/-0)
test/test_matrix4f.py (+10/-0)
test/test_rowvector2f.py (+8/-0)
test/test_rowvector3f.py (+8/-0)
test/test_rowvector4f.py (+8/-0)
test/test_vector2f.py (+8/-0)
test/test_vector3f.py (+8/-0)
test/test_vector4f.py (+8/-0)
Changed in pyeigen: | |
assignee: | nobody → Jeff Packer (jfpacker) |
Changed in pyeigen: | |
status: | New → In Progress |
Changed in pyeigen: | |
status: | In Progress → Fix Committed |
Changed in pyeigen: | |
milestone: | none → 0.2 |