Re: [eigen] Eigen and rigid body simulation |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Eigen and rigid body simulation
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 21 Jan 2010 12:03:10 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=robjAt7nSnNFQNCl+6ZjTgM2ENffmayLorPebYdF4b4=; b=dRsD+GPrijYsdi89Lgu5jJ4EX44FXuNdNmNWNPcZ8m2H1HjStsNfZqcXPB/PNxYTKp CR3Mptdqhni8go18VhyhgtpueS4ddQ8Kor1Ry7abCG5aLMlr1Ai6wEq7e5eOQ7cuH1FB JAnJDcAszZM5NSQo6VXTox7AN4NT5CP7M2ovs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=kbzXrnVlXBeJfz3jlCcuES372L6yuylJQ+T7wNedCUDKWIAiSuAX336xkum3x6PGXc 85VznK4ajucSDc7vS2YHTYvQv3qP0AsUBA/nrAKu7AWG0hb5FRHLSdJIVzHkChYU5kHc W8QeNybCe//b9X4JtgbTr8hwPulIuX2kt8x1I=
2010/1/21 Mathieu Gautier <mathieu.gautier@xxxxxx>:
>>>
>>> I can then write something like :
>>>
>>> double data[4] = {1,3,4,5};
>>>
>>> Rotd d, dr;
>>> RotMapd dm(data);
>>> dr = d *dm;
>>
>>
>> Yes it's definitely easier to write when using it, but in the end there's
>> still a lot of machinery to simply avoid using free functions. In your
>> case,
>> the wrapper also involves performance issues since values are copied all
>> around.
>
> In fact they are not copied, at least for the objects I tried. Since I was
> focused on tiny elements like Quaternion or Matrix<Scalar, 1, 7>, the copy
> are elided by the compiler and I didn't see this issue. I haven't checked
> with more complex objects. But it may indeed involve unecessary copy.
If an unnecessary copy in "dr = d*m;" is a concern, then do:
dr.noalias() = d*m;
That tells Eigen to not introduce a temporary variable to store the product..
Benoit
PS. If you wonder about our silence, it's just that I'm busy, Gael is
busy too, and I'm very glad to have you two, Mathieu and Maxime,
experts of this topic, doing all the design work for us. Also, if you
want to come discuss this stuff at the meeting, you are very welcome
and we could reserve 1 hour for that.