Registered Member
|
Hello all,
I am working on a project that requires that zero-size matrix multiplications are allowed (i.e. an mx0 matrix times a 0xn matrix should result in an mxn matrix of zeros). I swear that I had attempted something similar using Eigen a few months back, but I seem unable to get it to work now. I am getting "you are using a non-initialized matrix" assertions when executing my application. A simple example is:
Does Eigen support (or can it be made to support, through the use of a certain flag?) operations on matrices with a zero-dimension? Searches on the topic don't turn anything up. It seems that while Dynamic is defined to be -1, after a dynamically sized matrix is created, the size of the dimension is 0, and there's nothing to distinguish an uninitialized matrix with dynamic size from one that has a dimension set to 0? Thanks, Kerry |
Moderator
|
It does work with the devel branch or when using Dynamic instead of "6" & "1".
|
Moderator
|
Fixed in 3.2 branch: https://bitbucket.org/eigen/eigen/commits/6f10024a6b13/
|
Registered Member
|
Excellent!
Thanks for the help. -Kerry |
Registered Member
|
Hello Gael,
I have one follow up question - consider the following example:
In both cases, I expected to see a 6x1 matrix of zeros. Under MSW (MSVC 2010) this works just fine. Under GTK (Ubuntu 13.10, g++ 4.8.1) only the first case works - for the second case, where the size of m2 is not explicitly specified, I still get the same assertion failure on the last line. Should I expect both cases to work, or is the behavior under Linux proper? Thanks, Kerry |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]