|
Ublas : |
From: Michael Stevens (mail_at_[hidden])
Date: 2005-09-28 20:28:19
On Wednesday 28 Sep 2005 22:49, Shawn D. Pautz wrote:
> Here's another concept conformance issue, although it's possible that
> it's a compiler issue. According to the documentation for the Vector
> concept a call to resize with a preserve value of false should yield a
> vector "in the same state as that after an equivalent sizing
> constructor". This does not appear to be the case, at least for
> ublas::vector and bounded_vector, if "same state" means "same values".
In this case "in the same state as that after an equivalent sizing
constructor" means that
ublas::vector<double> vec;
// any changes to vec
vec.resize(N);
is semantically equivilient to
ublas::vector<double> vec(N);
In the case ublas::vector and bounded_vector this means that the values become
undefined. I not sure of a better way to express this.
The definitition is intentionally tied to that of the sizing constructor. In
the case of sparse types they can give a zeroing guarantee for the sizing
constructor (and resize) at no runtime cost.
Michael
-- ___________________________________ Michael Stevens Systems Engineering 34128 Kassel, Germany Phone/Fax: +49 561 5218038 Navigation Systems, Estimation and Bayesian Filtering http://bayesclasses.sf.net ___________________________________