|Re: [eigen] about .lazy()|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] about .lazy()
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Tue, 25 Aug 2009 19:04:13 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=2QTtKRxxd1FybQk3uaAncP+hp2l+46K35NSpmltpF7I=; b=H++XP7z0YRdVkDzd6qvxK0mx3fWxsLaR3GdbezPayvjM0CHAyoe32LC4FpyL5zQqa3 z47Frd+CImGwzcFWcTpDnpW5fAJP35hGCtNTsbxHG9Yduz2qUSnFXURppEi79p/kyVkf bLTvKY5i2LUdgGupSVBb6X/I0y66cIUXV1Dlo=
- 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=DQ2kO1G7vl0hLca3p4dXP0K4l7OkR4ZA8f4wYfotk6x8TLO2RlkD8ZnzZeS1EDEv6q LFBqVGWGGJEKysKbd4AsWW/Wdm0Dq+vvcx/SzG9AVYaFmMuZXRXnwG0x/GIAi9M6vord IaUJkJY/0NXgKJwZETU1SeUGaGxdCYZOakDEw=
2009/8/25 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> On Sat, Aug 15, 2009 at 10:48 PM, Benoit Jacob<jacob.benoit.1@xxxxxxxxx> wrote:
>> (...) For example the
>> Transpose expression. And even Block if you take blocks on both sides
>> of an assignment (think row(i) = col(j)). So actually, a lot of
>> expressions "may alias" (...)
> I am wondering whether following the reasoning used for operator* for
> matrices, all operators that might alias should be implemented in a
> conservative way. I.e. with introducing temporaries as long as
> noalias() is not used explicity? I don't see why we should not
> implement the same level of safety we have for operator* for all
> potentially aliasing operations. I would be probably desired to have
> something like this
> MatrixXd a(3,4);
> a << 1,2,3,4,5,6,7,8,9,10,11,12;
> a = a.block(0,0,3,2);
> woking properly...
To begin with, this is not even possible with lvalue expressions.
matrix.block(0,1,2,3) = xpr;
absolutely requires block() to not evaluate into a temporary.
There really, really is no way to have expression templates without
some measure of danger.