FIX const correctness of projections restored
[SVN r29898]
This commit is contained in:
parent
e7f141b5a6
commit
6ad45f69ae
@ -53,11 +53,17 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
private:
|
||||
// projection types
|
||||
typedef vector_range<E> vector_range_type;
|
||||
typedef const vector_range<const E> const_vector_range_type;
|
||||
typedef vector_slice<E> vector_slice_type;
|
||||
typedef const vector_slice<const E> const vector_slice_type;
|
||||
typedef matrix_row<E> matrix_row_type;
|
||||
typedef const matrix_row<const E> const_matrix_row_type;
|
||||
typedef matrix_column<E> matrix_column_type;
|
||||
typedefconst matrix_column<const E> const_matrix_column_type;
|
||||
typedef matrix_range<E> matrix_range_type;
|
||||
typedef const matrix_range<const E> const_matrix_range_type;
|
||||
typedef matrix_slice<E> matrix_slice_type;
|
||||
typedef const matrix_slice<const E> const_matrix_slice_type;
|
||||
// matrix_indirect_type will depend on the A template parameter
|
||||
typedef basic_range<> default_range;
|
||||
typedef basic_slice<> default_slice;
|
||||
@ -65,7 +71,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
public:
|
||||
// projection functions - projects must be constructable from default size_t, range and slice types
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_row_type operator [] (std::size_t i) const {
|
||||
const_matrix_row_type operator [] (std::size_t i) const {
|
||||
return matrix_row_type (operator () (), i);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -73,7 +79,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
return matrix_row_type (operator () (), i);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_row_type row (std::size_t i) const {
|
||||
const_matrix_row_type row (std::size_t i) const {
|
||||
return matrix_row_type (operator () (), i);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -81,7 +87,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
return matrix_row_type (operator () (), i);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_column_type column (std::size_t j) const {
|
||||
const_matrix_column_type column (std::size_t j) const {
|
||||
return matrix_column_type (operator () (), j);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -89,7 +95,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
return matrix_column_type (operator () (), j);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_range_type range (std::size_t start1, std::size_t stop1, std::size_t start2, std::size_t stop2) const {
|
||||
const_matrix_range_type range (std::size_t start1, std::size_t stop1, std::size_t start2, std::size_t stop2) const {
|
||||
return matrix_range_type (operator () (), default_range (start1, stop1), default_range (start2, stop2));
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -97,7 +103,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
return matrix_range_type (operator () (), default_range (start1, stop1), default_range (start2, stop2));
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_slice_type slice (std::size_t start1, std::ptrdiff_t stride1, std::size_t size1, std::size_t start2, std::ptrdiff_t stride2, std::size_t size2) const {
|
||||
const_matrix_slice_type slice (std::size_t start1, std::ptrdiff_t stride1, std::size_t size1, std::size_t start2, std::ptrdiff_t stride2, std::size_t size2) const {
|
||||
return matrix_slice_type (operator () (), default_slice (start1, stride1, size1), default_slice (start2, stride2, size2));
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -106,7 +112,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
}
|
||||
#ifdef BOOST_UBLAS_ENABLE_PROXY_SHORTCUTS
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_range_type operator () (const default_range &r1, const default_range &r2) const {
|
||||
const_matrix_range_type operator () (const default_range &r1, const default_range &r2) const {
|
||||
return matrix_range_type (operator () (), r1, r2);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -114,7 +120,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
return matrix_range_type (operator () (), r1, r2);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_slice_type operator () (const default_slice &s1, const default_slice &s2) const {
|
||||
const_matrix_slice_type operator () (const default_slice &s1, const default_slice &s2) const {
|
||||
return matrix_slice_type (operator () (), s1, s2);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -123,7 +129,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
}
|
||||
template<class A>
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_indirect<const E, A> operator () (const indirect_array<A> &ia1, const indirect_array<A> &ia2) const {
|
||||
const_matrix_indirect<const E, A> operator () (const indirect_array<A> &ia1, const indirect_array<A> &ia2) const {
|
||||
return matrix_indirect<const E, A> (operator () (), ia1, ia2);
|
||||
}
|
||||
template<class A>
|
||||
@ -133,7 +139,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
}
|
||||
#endif
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_range_type project (const default_range &r1, const default_range &r2) const {
|
||||
const_matrix_range_type project (const default_range &r1, const default_range &r2) const {
|
||||
return matrix_range_type (operator () (), r1, r2);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -141,7 +147,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
return matrix_range_type (operator () (), r1, r2);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_slice_type project (const default_slice &s1, const default_slice &s2) const {
|
||||
const_matrix_slice_type project (const default_slice &s1, const default_slice &s2) const {
|
||||
return matrix_slice_type (operator () (), s1, s2);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -150,7 +156,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
}
|
||||
template<class A>
|
||||
BOOST_UBLAS_INLINE
|
||||
const matrix_indirect<const E, A> project (const indirect_array<A> &ia1, const indirect_array<A> &ia2) const {
|
||||
const_matrix_indirect<const E, A> project (const indirect_array<A> &ia1, const indirect_array<A> &ia2) const {
|
||||
return matrix_indirect<const E, A> (operator () (), ia1, ia2);
|
||||
}
|
||||
template<class A>
|
||||
|
@ -200,14 +200,16 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
private:
|
||||
// projection types
|
||||
typedef vector_range<E> vector_range_type;
|
||||
typedef const vector_range<const E> const_vector_range_type;
|
||||
typedef vector_slice<E> vector_slice_type;
|
||||
typedef const vector_slice<const E> const_vector_slice_type;
|
||||
// vector_indirect_type will depend on the A template parameter
|
||||
typedef basic_range<> default_range;
|
||||
typedef basic_slice<> default_slice;
|
||||
public:
|
||||
// projection functions - projects must be constructable from default size_t, range and slice types
|
||||
BOOST_UBLAS_INLINE
|
||||
const vector_range_type range (std::size_t start, std::size_t stop) const {
|
||||
const_vector_range_type range (std::size_t start, std::size_t stop) const {
|
||||
return vector_range_type (operator () (), default_range (start, stop));
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -216,7 +218,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
}
|
||||
#ifdef BOOST_UBLAS_ENABLE_PROXY_SHORTCUTS
|
||||
BOOST_UBLAS_INLINE
|
||||
const vector_range_type operator () (const default_range &r) const {
|
||||
const_vector_range_type operator () (const default_range &r) const {
|
||||
return vector_range_type (operator () (), r);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -224,7 +226,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
return vector_range_type (operator () (), r);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const vector_slice_type operator () (const default_slice &s) const {
|
||||
const_vector_slice_type operator () (const default_slice &s) const {
|
||||
return vector_slice_type (operator () (), s);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -243,7 +245,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
}
|
||||
#endif
|
||||
BOOST_UBLAS_INLINE
|
||||
const vector_range_type project (const default_range &r) const {
|
||||
const_vector_range_type project (const default_range &r) const {
|
||||
return vector_range_type (operator () (), r);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@ -251,7 +253,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
return vector_range_type (operator () (), r);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const vector_slice_type project (const default_slice &s) const {
|
||||
const_vector_slice_type project (const default_slice &s) const {
|
||||
return vector_slice_type (operator () (), s);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
|
Loading…
Reference in New Issue
Block a user