Re: [eigen] Special topic page on Aliasing

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


2010/8/4 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> 2010/8/4 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
>> 2010/8/1 Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx>:
>>> Hello,
>>>
>>> I started a special topic page on Aliasing; you can see the start at
>>>
>>>   http://eigen.tuxfamily.org/dox-devel/TopicAliasing.html
>>>
>>> My idea is to explain aliasing from a user's perspective, and mention as
>>> little about the internals of Eigen as possible.
>>>
>>> However, I'm now wondering whether we need this page. There is quite a bit
>>> of overlap with the page "Lazy Evaluation and Aliasing" at
>>>
>>>   http://eigen.tuxfamily.org/dox-devel/TopicLazyEvaluation.html
>>>
>>> In my mind the main topic of that page is lazy evaluation. Perhaps the need
>>> to learn about lazy evaluation is a bit less immediate for the user (that's
>>> why I very immodestly bumbed 'my' aliasing page to the above the lazy
>>> evaluation page in the Overview page).
>>>
>>> I think that the pages are sufficiently different that it's useful to have
>>> both, but I want to give others a chance to comment first before I do more
>>> work on the aliasing page.
>>
>> Sorry for the long delay replying. Thanks for starting this page. As I
>> already mentioned, I think it's good to have many special-topics pages
>> and it's OK to have some redundancy between them. So a page on
>> aliasing is very welcome alongside a page on lazy evaluation.
>>
>> I have a few comments about the content. The example a=a.transpose()
>> is a bit special as we do catch it with an assertion in Eigen. So it's
>> not really dangerous (not any more than any other illegal op) it's
>> just illegal.

Wait... indeed this example is already mentioned on page 2 of the
tutorial and the output does show the aliasing problem. What's
happening?? I thought we were catching this?? See
checkTransposeAliasing_impl in Transpose.h ... ?!

>>
>> It's still good to use that as your first example of assignment
>> exposing aliasing issues at the top. But below, instead of the
>> dichotomy safe/dangerous, I would rather distinguish 4 cases:
>>  - totally safe operations (e.g. coeff-wise ops)
>
> In the above line, replace 'totally' by 'inherently'.
>
>>  - operations that are safe because Eigen is taking care of
>> introducing a temporary (e.g. m = m*m).
>>  - operations that are illegal, and that Eigen catches (e.g. m = m.transpose())
>>  - operations that are dangerous (silently give wrong result) -
>> explain that this is the "generic case" and give an example e.g.
>> m.row(i) = m.col(j) for suitable i,j.
>>
>> Thanks again for getting this rolling.
>>
>> Benoit
>>
>>>
>>> Cheers,
>>> Jitse
>>>
>>>
>>>
>>
>



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