Re: [eigen] conservative resize ... |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] conservative resize ...
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Mon, 7 Sep 2009 13:52:46 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qRT+ur60lIFlWshU/dEryrDhoGObB1WBBzZx7R7E/r8=; b=s55YejSUc26LpPUAfbDEBrQfYG9hMAKrKWMAlcIHlW91yad+5OJzbQ2+dCsCnabZUh zNrpbEuVhWIda++CDOoKwKVFIjjRAbC+HJojYylsbw2hm7JIegTCv0nKNelt5xvAPYdU Gcz2dK6LJaeGhZ/L4UiWEIz+mPe41Tgi/5A8Y=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=a3DAmqYiCdjE/rhuojLNI36N3T8zCl+8lSFRt3A6kbw+/uFMU54B3dfijy7/EqFiHG 7vMqwugdlEDQJDS5qKsOkdlQrBq6fUF3jRTpFI0Xj+I8RADtOgwuQ6yGgrx0kiXTQieQ x8vUcaEzFv1vf16Y6eYZ9fnlGR91qnVMNJLPg=
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