Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect output for RowMajor #11

Open
alecjacobson opened this issue Sep 27, 2024 · 0 comments · May be fixed by #12
Open

Incorrect output for RowMajor #11

alecjacobson opened this issue Sep 27, 2024 · 0 comments · May be fixed by #12

Comments

@alecjacobson
Copy link

Here's a small example:

#include <Eigen/Core>

int main()
{
  Eigen::Matrix<double, 3, 4> A;
  A << 1, 2, 3, 4,
      5, 6, 7, 8,
      9, 10, 11, 12;
    Eigen::Matrix<double, 3, 4, Eigen::RowMajor> B;
  B << 1, 2, 3, 4,
      5, 6, 7, 8,
      9, 10, 11, 12;
  assert(false);
}

and then if you print B in the debugger:

Assertion failed: (false), function main, file test.cpp, line 13.
Process 75559 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
    frame #4: 0x0000000100002908 a.out`main at test.cpp:13:1
   10  	B << 1, 2, 3, 4,
   11  	    5, 6, 7, 8,
   12  	    9, 10, 11, 12;
-> 13  	assert(false);
   14  	}
Target 0: (a.out) stopped.
Process 75559 launched: '/Users/alecjacobson/a.out' (arm64)
(lldb) p B
(Eigen::Matrix<double, 3, 4, 1, 3, 4>) $0 = rows: 3, cols: 4
[  1  4  7 10;
   2  5  8 11;
   3  6  9 12;
 ]

(PR coming forthwith)

@alecjacobson alecjacobson linked a pull request Sep 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant