Re: [eigen] Special topic page on Aliasing |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Special topic page on Aliasing
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 4 Aug 2010 09:53:53 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=vOTdr6TZxaxrzBUQptFmccE7MVmJQ/qDwcmY5KGrFHo=; b=xhkGzUKs2ckGYJMRbWqaIae27lMZAOyJGVhO+yRDVc2dKTkwqmHSh1LVtY/Lmekimv tf2pm+uOxxLEA7rfa3wkBAOtisH88zSsL9ASpxzISQRt/M3Gex8XOZiDr8JP1/4cnq+K E7JwAIIEdTvZq4+sebJ4Rb4TIUnrkLc/9dsD0=
- 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=WQm5HnFaghOjlqPRTLyOXBkpDn+ozcQpVEqh4HZjQuKvA/LAHXQ0x4J8zuRYO7d36/ YLU/B4YdVr5d4uf0qKxuwU4Vpmu6bv/otHz8Wfv03ZqeHZo3J0hH/6G12X54T4WjrEhU eeyAW+C/XcuiUhzRn6fK9g5NjDw8UDwL3QBZI=
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
>>>
>>>
>>>
>>
>