|Re: [eigen] Special topic page on Aliasing|
[ Thread 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:45:54 -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=5dhvYU7ta2QNssb1z27BhOSuJegc7EdUNatnPQddOhM=; b=H1EsSzWFK9xpYr5b/+VIBoeXoXtbjrc2wNoXs07N/vTwQSOlDTHGkgFneLgnKSamAp 1Rfqe9tuV5IA5nmkWjEmhmW21WAdwDubnu6lfDg1BFJWU7J9CSTzJ1YGqZbgvxSEZbxn eRnGaF1jrBdZKsYcEiZgW5dqTAoSi5qsuP0WE=
- 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=eT8FGXBypZpx2Zru1/dccCsXY/UA+0QXsDqMG53UvVh256Q+I2XrEDNOcmPvbo3RGv L+AdqKe99hHiKEjwwWFYXSbLUOHYinzf7IJzSZ2TeFsjHiMXGkx6309Gdczm2386mOKD EXKG5ClMjB8licHLjrtw8RY02C+MnLUgTqDL4=
2010/8/1 Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx>:
> I started a special topic page on Aliasing; you can see the start at
> 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
> 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
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)
- 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.