Re: [eigen] conservative resize ...

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


On Mon, Sep 7, 2009 at 1:34 PM, Márton Danóczy<marton78@xxxxxxxxx> wrote:
> You're right, initializing a matrix after resizing should suffice, if
> it is not slower than doing both in one step.

It is possible and would probably be even faster - if done correctly.
I am just saying this because you would need to take care of
initializing only those parts of the matrix which are yet
uninitialized. At the moment, when pre-initializing with zeros, the
parts of the old and resized matrices that overlap are accessed twice.
Once for initializing with zeros and a second time to copy the old
values.

@Benoit, ExtendByZero is fine. I am just wondering, was there a
particular reason for making NoChange_t a struct? Should we follow the
same strategy to ExtendByZero?

- Hauke



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