|Re: [eigen] Blocks and EvalBeforeAssign|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
Alright thanks guys!
I'll go ahead and use conservativeResize, but I'm interested in
warnings, as Christoph mentioned.
On Tue, May 21, 2013 at 10:10:39AM +0200, Gael Guennebaud wrote:
> Hi Michael,
> On Sun, May 19, 2013 at 12:12 AM, Michael Tao <mtao@xxxxxxxxxxxxxxx> wrote:
> > Hey all,
> > Currently assigning sub-blocks of variables to themselves like
> > x = x.head(1);
> > returns garbage because Block doesn't have EvalBeforeAssigningBit set in
> > its Flags. Is there a particular reason why EvalBeforeAssigningBit
> > isn't set in Block?
> Yes this is done on purpose to avoid temporaries that would be costly
> and useless in 99% of the cases. The only exception is for
> matrix-matrix products because 1) aliasing is more frequent, and more
> importantly because 2) matrix product of O(N^3) operations for which
> an extra temporary is most of the time negligible.
> This is documented there:
> > Here's a small full example where it breaks...
> > http://pastebin.com/3UYvYWwG
> > Though it usually outputs 0, sometimes it'll return something e-317,
> > which when casted as a double* is always approximately the value of
> > A.data(). Does anyone know why that might be happening?
> > Thanks,
> > Michael Tao