From: jhrwalter (walter_at_[hidden])
Date: 2001-12-08 07:20:29
--- In boost_at_y..., Peter Schmitteckert (boost) <boost_at_s...> wrote:
> On Friday 07 December 2001 09:29, Toon Knapen wrote:
> > jhrwalter wrote:
> > > Do we really need reserve()? IMO the allocation behaviour of
> > > is a quality of implementation issue, especially since resize()
> > > method of the proxy concept. If we intend to make it's behaviour
> > > transparent, we'd have to introduce capacity() first.
> > I find this really necessary (there's also a good reason why they
> > capacity and size in std::vector). Everytime you shrink the
> > matrix (i.e. resize(x) with x < size() ), you are going to delete
> > old data and new another array. This is very time consuming.
> > I would suggest to allign totally with what std::vector does :
> > resize without reallocation (if the capacity is large enough) and
> > can easily shrink the capacity by copying to a smaller vector.
> I agree.
> Allthough a submatrix adapter would be sufficient for me.
This is indeed an alternative. matrix_range should be an suited
submatrix adaptor (with a poor name?).
> > > BTW, do we need to consider std::allocator?
> > In the long term : yes. But no allocater can be as smart as what
> > can do with capacity() and resize(). So the allocator is not a
> > to the above problem.
> > An allocator would be nice e.g. to optimise allocation of many
> > matrices.
> I agree.
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk