Re: [eigen] Re: RotationBase times DiagonalMatrix |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Re: RotationBase times DiagonalMatrix
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Tue, 2 Aug 2011 10:25:57 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=CGOzsQfEcMxJAZ3yhh9AWa1fd5YIOiI/Lxd/34rQs+A=; b=S7vW8ftgGtjuSBEart9sRTa/2LYMkR1ld+phnj9w2TyQbkGosA2TyZldC3m/FSTKn3 kDUB+PXkoCnksajXNup5gald4hKnVqbNvptsU1rFhvHh462n8BCGO+bN5jljqmUCaS1p BLCLl7wjcEISK/c2vwPEbuRpcr201EISwMQ4w=
I really want to make a comeback in Eigen but can't today:) will try
to have an opinion ASAP :)
Benoit
2011/8/2 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> Guys, does anybody have an opinion on this?
>
> - Hauke
>
> On Wed, Jul 27, 2011 at 2:49 PM, Hauke Heibel
> <hauke.heibel@xxxxxxxxxxxxxx> wrote:
>> Hi,
>>
>> the following code does not compile on my system:
>>
>> Rotation2D<double>(M_PI/2) * DiagonalMatrix<double,2>(-1.0,1.0)
>>
>> Adding a)
>>
>> inline RotationMatrixType operator*(const DiagonalMatrix<Scalar,Dim>& s) const
>> { return toRotationMatrix() * s; }
>>
>> to RotationBase resolves this issue and its basically the same as what
>> we do for UniformScaling. Alternatively, b) is possible too:
>>
>> inline Transform<Scalar,Dim,AffineCompact> operator*(const
>> DiagonalMatrix<Scalar,Dim>& s) const
>> { return Transform<Scalar,Dim,AffineCompact>(*this) * s; }
>>
>> I want to add, that I am still not 100% happy with the use patterns of
>> such transformations. E.g.
>>
>> AffineCompact2d a = Rotation2D<double>(M_PI) * Translation2f(x,y);
>>
>> compiles, whereas
>>
>> AffineCompact2d a = Rotation2D<double>(M_PI/2) * Scaling(-1.0,1.0);
>>
>> does not with implementation a) but it does with implementation b).
>>
>> I would prefer implementation b) and I would also like to change right
>> away UniformScaling such that it accepts a
>> Transform<Scalar,Dim,AffineCompact>.
>>
>> It is also a little bit strange, that this code works
>>
>> AffineCompact2d a = Rotation2D<double>(M_PI) * Translation2f(x,y);
>>
>> and this does not
>>
>> AffineCompact2d a = Rotation2D<double>(M_PI);
>>
>> I think I understand the reasoning behind the explicit constructors
>> but on the other hand-side I am not sure whether potential temporaries
>> hurt more than the kind of awkward usage pattern. I mean these are all
>> tiny stack objects, right?
>>
>> Any comments would be really great, so I can act quickly. :)
>>
>> - Hauke
>>
>
>
>