Boost logo

Boost :

From: Joerg Walter (jhr.walter_at_[hidden])
Date: 2002-07-17 02:23:35


----- Original Message -----
From: "Toon Knapen" <toon.knapen_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, July 16, 2002 2:48 PM
Subject: [boost] ublas: matrix_range< matrix_range< T > > == matrix_range< T
>

> Currently a matrix_range of a matrix_range is different in type than just
a
> matrix_range. Would'nt it be better that both are the same. IIRC, taking
an
> element of matrix_range< matrix_range > > will require two dereferences
while
> we could translate the ranges themselves when constructing piled ranges.
>
> This would increase performance AFAICT and improve flexibility !

For sufficient compatible compilers the following project() overloads in
matrix_pr.h should cause the desired effect

    template<class M>
    NUMERICS_INLINE
    matrix_range<M> project (matrix_range<M> &data, const range &r1, const
range &r2) {
        return data.project (r1, r2);
    }
    template<class M>
    NUMERICS_INLINE
    const matrix_range<const M> project (const matrix_range<const M> &data,
const range &r1, const range &r2) {
        return data.project (r1, r2);
    }

Regards

Joerg


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