Registered Member
|
Hi
I may have stumbled across a peculiar bug - *Matrix Multiplication* I don't know if this is linked to the gcc compiler or is some initialisation issue in eigen or to do with the transpose function specifically, but: if, MatrixXd res = mat1.transpose() * mat2.transpose(); //half of the matrix is empty with zeros and the columns and rows become jumbled up? if I first declare: MatrixXd res; res = mat1.transpose() * mat2.transpose(); //then all is ok - can anyone confirm this? also: chain multiplication: MatrixXd res; res = mat1 * (mat1.transpose() * mat2.transpose()); //fails with similar issues as above, solved by: MatrixXd res; res = (mat1.transpose() * mat2.transpose()); res = mat1 * res; Thanks TOAD
Last edited by silicontoad on Mon Aug 24, 2009 1:07 pm, edited 1 time in total.
|
Registered Member
|
Is this Eigen 2.0 or the development branch?
Just to accomodate our laziness, could you post a compilable test case?
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
sorry - my fault - It's using Eigen 2.0.4 (Aug 1 release) - I can do a test case if that helps.
|
Registered Member
|
OK here's a testcase:
Testing against 2.0:
So the bug is triggered when the size is large enough that the cache-friendly path is taken.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
The bug exists only in the 2.0 branch, not in the devel branch.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Bisected. The bug had always existed in both branches until it was fixed in the default branch by changeset bf5ef41ebba3 by Gael: "more refactoring in the level3 products"
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Good news, I just committed a fix to the 2.0 branch.
Can you please try the 2.0 branch and report? At least the above testcase works now.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
I can confirm that this now works, v. 2.0.5. Thanks
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]