Boost logo

Boost :

From: jhrwalter (walter_at_[hidden])
Date: 2001-12-10 04:26:02


--- In boost_at_y..., Toon Knapen <toon.knapen_at_s...> wrote:
> > This is indeed an alternative. matrix_range should be an suited
> > submatrix adaptor (with a poor name?).
>
>
> > [and in another thread]
> > matrix_range is well suited to address a sub matrix of an
existing
> > matrix. But one has to consider carefully, what code a compiler
emits
> > with this additional indirection, AFAIK
>
>
> but matrix_range does not feature a resize(size_type,size_type).
> The idea would be that you can constantly resize the adaptor
> (matrix_range) as long as it is smaller or equal in size to the
matrix
> it originates from.
 
I usually construct a new adaptor, for example:
 
matrix<double> m (size, size);
for (int i = 0; i < size; ++ i) {
    matrix_range<matrix<double> > mr (m, range (0, i), range (0, i));
    ...
}

> > [and yet in another thread]
> > Correct. matrix_range checks it's dimensions against the
dimensions
> > of the underlying matrix.
> I can't find that, the constructors e.g. looks like :
>
> NUMERICS_INLINE
> matrix_range (matrix_type &data, const range &r1, const range
&r2):
> data_ (data), r1_ (r1), r2_ (r2) {}
 
Oops. The checks are deferred until element access or iterator
dereference. Is that too late?
 
Regards
 
Joerg
 


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk