Re: [eigen] Eigen and rigid body simulation

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


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.



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