Re: [eigen] Convert 1x1 matrix to internal type?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi all,

note that as explained here:
http://eigen.tuxfamily.org/dox-devel/TutorialMatrixArithmetic.html#TutorialArithmeticDotAndCross,

the following already works in Eigen3 (beta1 or trunk):

double mdist = data.transpose()*covInverse*data;

And this is the unique exception  where this is allowed. Indeed,
unfortunately, allowing automatic conversion for any 1x1 matrix leads
to many ambiguities (I don't remember exactly but there is a old
thread where I listed them).


gael

On Wed, Sep 22, 2010 at 2:24 AM, Thomas Capricelli
<orzel@xxxxxxxxxxxxxxx> wrote:
> This, is really a dot product... a.dot(b)*c;
>
> Actually, i think most of the time, when someone wants to cast a 1x1 matrix
> to a scalar, he missed a dot product somewhere.
>
> And i'm against such an automatic casting as well.
>
> regards,
>
> Thomas
>
> --
>
> Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
>
> http://www.freehackers.org/thomas
>
> On Tuesday 21 September 2010 20:21:44 Christoph Hertzberg wrote:
>
>>   Eigen::Vector3d a, b, c;
>
>>   a.transpose() * b * c;
>
>>
>
>> or only explicitly:
>
>>
>
>>   double(a.transpose()*b) * c;



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/