Registered Member
|
I've just run across what appears to be a fairly serious bug in the evaluation of
a particular matrix expression involving a matrix transpose and some scalars. I'm guessing it may not be known since I can reproduce it in 3.0.2. Here is a simple test case: void prodTest() { Eigen::Matrix2Xd dNdxy(2, 3); dNdxy << -0.5, 0.5, 0, -0.333333, 0, 0.333333; double det=6.0, wt=.5; Eigen::MatrixXd p1 = dNdxy.transpose()*dNdxy*det*wt; Eigen::MatrixXd p2 = det*wt*dNdxy.transpose()*dNdxy; std::cout << p1 << std::endl; std::cout << p2 << std::endl; } p2 is correct but p1 is not. Bill |
Registered Member
|
I can reproduce it, both with and without optimizations. That is quite a bad bug. It looks like the factor det in the expression for p1 is ignored (perhaps overwritten by the factor wt ?)
Thanks very much for letting us know. |
Moderator
|
Thanks a lot jitse for fixing this.... scary. This fix justify a 3.0.3 asap.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]