|
Ublas : |
From: Michael Stevens (mail_at_[hidden])
Date: 2006-11-30 12:57:35
On Friday, 20. October 2006 02:55, Neal Becker wrote:
> I noticed 2 issues when reading storage.hpp (current release).
>
> 1. IIUC, then resize_internal will not use the value of the 'init'
> parameter unless 'preseve' is true. That is, new elements will not be
> initialized with init unless preserve is true. Is this the desired
> behavior? I think preserve and init should be orthogonal.
Agreed the are orthogonal. Potentially it could be split into two functions.
> 2. If new size is < old size, we still reallocate and copy storage. Is
> this really the desired behavior?
I think so! Otherwise you never get the memory back. Both behaviours can be
useful. I guess it would be fairly simple to write a derived class that
supress the resize when it size shrinks and returns it's own smaller size.
Michael
-- ___________________________________ Michael Stevens Systems Engineering 34128 Kassel, Germany Phone/Fax: +49 561 5218038 Navigation Systems, Estimation and Bayesian Filtering http://bayesclasses.sf.net ___________________________________