Subject: Re: [boost] ublas questions
From: Sylvain Bougerel (sylvain.bougerel.devel_at_[hidden])
Date: 2010-01-05 02:38:52
On Tue, Jan 5, 2010 at 3:06 PM, markus2004x <markus2004x_at_[hidden]> wrote:
> 1) On the boost user guide I read:
> "However unbounded_array is aimed at optimal performance. Therefore
> unbounded_array does not model a Sequence like std::vector does".
> I do not quite understand this statement. An std::vector is memory
> contiguous and access happens by offset. How can an unbounded beat this?
I suppose that optimal performance was written with regards to memory
consumption: unbounded_array consume just enough memory to store the
number of object that it was asked to (it is not the case for
std::vector, cause it requires amortized allocation time when growing
and does so by allocating more than it actually requires).
Under-laying container is still a contiguous array, so access time
through operator is identical to std::vector.
Btw, there is a typo in the doc page: "When resized unbounded_array
will reallocate it's... " should be "its" not "it's", I think.
Cannot help for 2). Sorry.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk