RE: [eigen]

[ Thread Index | Date Index | More Archives ]

Thanks Benoit,





From: Listengine [mailto:listengine@xxxxxxxxxxxxxxxxx] On Behalf Of Benoit Jacob
Sent: Sunday, May 30, 2010 18:04
To: eigen@xxxxxxxxxxxxxxxxxxx
Subject: Re: [eigen]


aaahh... this had me puzzled for a while, but what you really have here is an aliasing problem. With the devel branch, when you do S = S.inverse(), S starts being overwritten with its inverse and then read again to compute the rest of the inverse... i need to have a look at the code to see if we're getting any speed gain from that, a priori i'd say let's work like in 2.0, taking care of aliasing, and if later there is demand for a super optimized noalias variant, we can then add it with an explicit name like a.noalias()  = a.inverse(), like for products.


2010/5/28 SHIROKOBROD Oleg <Oleg.Shirokobrod@xxxxxxxxxx>



I’ve met a problem with development branch. Here you are the case.

                                   { -2.0                                     -1.0 }

I have a 2x2 matrix S = {                                                   }

                                   { 0.00026130287408377900     -2.0 }


and I want to inverse it. This is the code I compiled with MSVS 2008


#include <Eigen\Core>

#include <Eigen\LU>


Eigen::Matrix<double, 2, 2> S;

S << -2.0 , -1.0 , 0.00026130287408377900 , -2.0;

S = S.inverse();


Eigen2 gives the right answer




S.inverse  =  {






Eigen3 (development branch I got on 26.05) gives a wrong answer





S.inverse  =  {






What’s wrong?


Thank you,


Oleg Shirokobrod


This e-mail is confidential and is for the addressee only.   Please refer to for regulatory information.

+++ Virus-scanned by MailControl for Oxford Instruments +++

Mail converted by MHonArc 2.6.19+