Boost logo

Ublas :

Subject: Re: [ublas] indirect_array<> and resize()
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2008-09-20 16:00:52

Am Freitag, 19. September 2008 15:12 schrieb Ralf Denzer:
> Hi,
> is there a good reason why a member resize() is
> not defined for ublas::indirect_array<> in storage.hpp or elsewhere?
> I.e.
> unsigned n = 3;
> ublas::indirect_array<> ia(n);
> ...
> ia.resize(7);

resizing an indirect_array is not supported. You have to use the
compose() functions to create a new indirect_array with more indices.
The reason is that the behavior of an indirect_vector or
indirect_matrix would be undefined when the size of the underlying
indirect_array is changes because the indirect_array loses some indices
to gets new indices which might be out of range.