Re: [eigen] about .lazy()

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


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.

For example,

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.

Benoit



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