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: Thu, 5 Aug 2010 08:25:13 -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; bh=h2UGbfd8tZSp+p/YmJHQ8LarkqnoK32XO/KWixOFRzY=; b=e+2bwrhxhD0JuuTETTOOOOXhjU9ASjbxqR5uUFCSBUtSd2dxYL8Wpy2uf29w24b6CW SBRD6Uf/syQoyWiAfLAdFRd6cqS4EISLRIEBdiMGgROVdm91z75vex7l0p52jn9WbiKM 6l9n5dmYbVGRTF7hjG9UTb4CuPJ/gtQ0HDwFw=
- 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; b=VLwuQzSe8f0qaM0sSrb433+9XdDu6DphkTrTM+NRalFLVbObeZ01rj6DDF0vKb80IB Vm8LmdcRoPZ8HgVdGXyGpXq/uzvWKWH7kXUm7b2JOubyTkEmzrYXX22FU2KLPYZWOR+u 1jr8PP8YnhSjktSL79q0AFEvEikmzlaJdGdek=
2010/8/5 Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx>:
> On Wed, 4 Aug 2010, Benoit Jacob wrote:
>
>>>> 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 ... ?!
>
> After a bit of a search, I found out that this example is compiled with
> EIGEN_NO_DEBUG (see the last line in doc/snippets/CMakeLists.txt) and thus
> the assertion is not checked. I'll add something to the aliasing docs page
> to clarify this.
Indeed you're right, this particular example is special-cased in
changeset 9f599d546c:
+ei_add_target_property(compile_tut_arithmetic_transpose_aliasing
COMPILE_FLAGS -DEIGEN_NO_DEBUG)
I'm not a fan of this! It can give the wrong impression that Eigen is
a dangerous place where such simple, common lines of code can silently
give wrong results. If we want to give examples of aliasing problems,
we should rather come up with examples that aren't caught by Eigen.
For example:
Matrix2f m;
m.row(1) = m.col(0);
Benoit
>
>
> Jitse
>
>
>