Re: [eigen] eigen 3.3.1 upgrade |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
This is an aliasing issue. Looks like mP.triangularView<Upper>() assumes no aliasing by default and the generated code looks like: 1: mP.triangularView<Upper>().setZero(); 2: tmp = mPHI * mP.selfadjointView<Upper>();3: mP.triangularView<Upper>() += tmp * mPHI.adjoint();I'll see if the setZero can be deferred a bit more.gaelOn Tue, Jan 17, 2017 at 5:16 AM, William Lentz <william_lentz@xxxxxxxxxxx> wrote:Hi,I'm trying to upgrade to Eigen 3.3.1 and ran into a problem. The following code produces an all-0 matrix with the "#if 1" and produces the identity matrix if changed to "#if 0". I'm using gcc 4.8.5 and compiling as "g++ -O -I eigen-eigen-f562a193118d/Eigen test.cpp"#include <iostream>#include "Eigen"using namespace Eigen;using namespace std;int main(void){MatrixXd mP = MatrixXd::Identity(3,3) ;MatrixXd mPHI = MatrixXd::Identity(3,3) ;#if 1mP.triangularView<Upper>() = mPHI *mP.selfadjointView<Upper>() *mPHI.adjoint();#elsemP = mPHI *mP.selfadjointView<Upper>() *mPHI.adjoint();#endifcout << mP << endl ;return 0 ;}An older version of Eigen from 2014 produces the identity matrix either way. Any ideas?Thanks,Will
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |