2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-20 03:02:13 +00:00

const correctness for zero_ etc completed

use if_ instead of if_c


[SVN r24789]
This commit is contained in:
Michael Stevens
2004-08-27 15:23:32 +00:00
parent a70ed9e30f
commit b1f2f1d73a
10 changed files with 108 additions and 110 deletions

View File

@@ -166,10 +166,8 @@ namespace boost { namespace numeric { namespace ublas {
#endif
#ifndef BOOST_UBLAS_REFERENCE_CONST_MEMBER
bad_index ().raise ();
return const_cast<reference>(zero_); // Never reached
#else
return zero_;
#endif
return const_cast<reference>(zero_);
}
// Assignment
@@ -1065,18 +1063,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -1091,11 +1089,11 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::iterator2 iterator2_type;
#else
typedef typename M::const_iterator1 const_iterator1_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator1,
typename M::iterator1>::type iterator1_type;
typedef typename M::const_iterator2 const_iterator2_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator2,
typename M::iterator2>::type iterator2_type;
#endif
@@ -1184,7 +1182,7 @@ namespace boost { namespace numeric { namespace ublas {
#ifndef BOOST_UBLAS_REFERENCE_CONST_MEMBER
bad_index ().raise ();
#endif
return zero_;
return const_cast<reference>(zero_);
}
#else
BOOST_UBLAS_INLINE
@@ -1207,7 +1205,7 @@ namespace boost { namespace numeric { namespace ublas {
#ifndef BOOST_UBLAS_REFERENCE_CONST_MEMBER
bad_index ().raise ();
#endif
return zero_;
return const_cast<reference>(zero_);
}
#endif

View File

@@ -703,9 +703,9 @@ namespace boost { namespace numeric { namespace ublas {
result_type operator () (const vector_expression<E1> &e1,
const vector_expression<E2> &e2) const {
#ifdef BOOST_UBLAS_USE_SIMD
typedef typename boost::mpl::if_c<
typedef typename boost::mpl::if_<
boost::mpl::and_<boost::is_same<typename E1::simd_category, concrete_tag>,
boost::is_same<typename E2::simd_category, concrete_tag> >::value,
boost::is_same<typename E2::simd_category, concrete_tag> >,
concrete_tag,
abstract_tag>::type simd_category;
#else
@@ -862,9 +862,9 @@ namespace boost { namespace numeric { namespace ublas {
const vector_expression<E2> &e2,
size_type i) const {
#ifdef BOOST_UBLAS_USE_SIMD
typedef typename boost::mpl::if_c<
typedef typename boost::mpl::if_<
boost::mpl::and_<boost::is_same<typename E1::simd_category, concrete_tag>,
boost::is_same<typename E2::simd_category, concrete_tag> >::value,
boost::is_same<typename E2::simd_category, concrete_tag> >,
concrete_tag,
abstract_tag>::type simd_category;
#else
@@ -1044,9 +1044,9 @@ namespace boost { namespace numeric { namespace ublas {
const matrix_expression<E2> &e2,
size_type i) const {
#ifdef BOOST_UBLAS_USE_SIMD
typedef typename boost::mpl::if_c<
typedef typename boost::mpl::if_<
boost::mpl::and_<boost::is_same<typename E1::simd_category, concrete_tag>,
boost::is_same<typename E2::simd_category, concrete_tag> >::value,
boost::is_same<typename E2::simd_category, concrete_tag> >,
concrete_tag,
abstract_tag>::type simd_category;
#else
@@ -1235,9 +1235,9 @@ namespace boost { namespace numeric { namespace ublas {
const matrix_expression<E2> &e2,
size_type i, size_type j) const {
#ifdef BOOST_UBLAS_USE_SIMD
typedef typename boost::mpl::if_c<
typedef typename boost::mpl::if_<
boost::mpl::and_<boost::is_same<typename E1::simd_category, concrete_tag>,
boost::is_same<typename E2::simd_category, concrete_tag> >::value,
boost::is_same<typename E2::simd_category, concrete_tag> >,
concrete_tag,
abstract_tag>::type simd_category;
#else

View File

@@ -1253,28 +1253,28 @@ namespace boost { namespace numeric { namespace ublas {
#else
// FIXME: no better way to not return the address of a temporary?
// typedef typename M::const_reference const_reference;
// typedef typename boost::mpl::if_c<boost::is_const<M>::value,
// typedef typename boost::mpl::if_<boost::is_const<M>,
// typename M::const_reference,
// typename M::reference>::type reference;
typedef typename M::value_type const_reference;
#ifndef BOOST_UBLAS_STRICT_HERMITIAN
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::value_type,
typename M::reference>::type reference;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::value_type,
hermitian_matrix_element<const hermitian_adaptor<M, F> > >::type reference;
#endif
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -1289,11 +1289,11 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::iterator2 iterator2_type;
#else
typedef typename M::const_iterator1 const_iterator1_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator1,
typename M::iterator1>::type iterator1_type;
typedef typename M::const_iterator2 const_iterator2_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator2,
typename M::iterator2>::type iterator2_type;
#endif

View File

@@ -1257,7 +1257,7 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_TYPENAME E::const_iterator1::iterator_category,
BOOST_UBLAS_TYPENAME E::const_iterator2::iterator_category>::storage_category storage_category;
// give preference to expressions orientation if known
typedef typename boost::mpl::if_c<boost::is_same<BOOST_UBLAS_TYPENAME E::orientation_category, unknown_orientation_tag>::value,
typedef typename boost::mpl::if_<boost::is_same<BOOST_UBLAS_TYPENAME E::orientation_category, unknown_orientation_tag>,
BOOST_UBLAS_TYPENAME M::orientation_category ,
BOOST_UBLAS_TYPENAME E::orientation_category >::type orientation_category;
matrix_assign (functor_type (), full (), m, e, storage_category (), orientation_category ());
@@ -1272,7 +1272,7 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_TYPENAME E::const_iterator1::iterator_category,
BOOST_UBLAS_TYPENAME E::const_iterator2::iterator_category>::storage_category storage_category;
// give preference to expressions orientation if known
typedef typename boost::mpl::if_c<boost::is_same<BOOST_UBLAS_TYPENAME E::orientation_category, unknown_orientation_tag>::value,
typedef typename boost::mpl::if_<boost::is_same<BOOST_UBLAS_TYPENAME E::orientation_category, unknown_orientation_tag>,
BOOST_UBLAS_TYPENAME M::orientation_category ,
BOOST_UBLAS_TYPENAME E::orientation_category >::type orientation_category;
matrix_assign (functor1_type (), functor2_type (), m, e, storage_category (), orientation_category ());

View File

@@ -355,11 +355,11 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename E::pointer pointer;
#else
typedef typename E::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<E>::value,
typedef typename boost::mpl::if_<boost::is_const<E>,
typename E::const_reference,
typename E::reference>::type reference;
typedef typename E::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<E>::value,
typedef typename boost::mpl::if_<boost::is_const<E>,
typename E::const_pointer,
typename E::pointer>::type pointer;
#endif
@@ -487,11 +487,11 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename E::iterator2 iterator2;
#else
typedef typename E::const_iterator1 const_iterator1;
typedef typename boost::mpl::if_c<boost::is_const<E>::value,
typedef typename boost::mpl::if_<boost::is_const<E>,
typename E::const_iterator1,
typename E::iterator1>::type iterator1;
typedef typename E::const_iterator2 const_iterator2;
typedef typename boost::mpl::if_c<boost::is_const<E>::value,
typedef typename boost::mpl::if_<boost::is_const<E>,
typename E::const_iterator2,
typename E::iterator2>::type iterator2;
#endif
@@ -1614,19 +1614,19 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename E::difference_type difference_type;
typedef typename F::result_type value_type;
typedef value_type const_reference;
typedef typename boost::mpl::if_c<boost::is_same<F,
scalar_identity<value_type> >::value,
typedef typename boost::mpl::if_<boost::is_same<F,
scalar_identity<value_type> >,
typename E::reference,
value_type>::type reference;
typedef const value_type *const_pointer;
typedef const_pointer pointer;
private:
typedef typename boost::mpl::if_c<boost::is_same<F,
scalar_identity<typename E::value_type> >::value,
typedef typename boost::mpl::if_<boost::is_same<F,
scalar_identity<typename E::value_type> >,
E,
const E>::type expression_type;
typedef F functor_type;
typedef typename boost::mpl::if_c<boost::is_const<expression_type>::value,
typedef typename boost::mpl::if_<boost::is_const<expression_type>,
typename E::const_closure_type,
typename E::closure_type>::type expression_closure_type;
typedef const matrix_unary2<E, F> const_self_type;
@@ -1635,11 +1635,11 @@ namespace boost { namespace numeric { namespace ublas {
typedef const_self_type const_closure_type;
typedef self_type closure_type;
// typedef typename E::orientation_category orientation_category;
typedef typename boost::mpl::if_c<boost::is_same<typename E::orientation_category,
row_major_tag>::value,
typedef typename boost::mpl::if_<boost::is_same<typename E::orientation_category,
row_major_tag>,
column_major_tag,
typename boost::mpl::if_c<boost::is_same<typename E::orientation_category,
column_major_tag>::value,
typename boost::mpl::if_<boost::is_same<typename E::orientation_category,
column_major_tag>,
row_major_tag,
typename E::orientation_category>::type>::type orientation_category;
// typedef unknown_storage_tag storage_category;

View File

@@ -45,18 +45,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -229,7 +229,7 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::iterator2 iterator_type;
#else
typedef typename M::const_iterator2 const_iterator_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator2,
typename M::iterator2>::type iterator_type;
#endif
@@ -554,18 +554,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -738,7 +738,7 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::iterator1 iterator_type;
#else
typedef typename M::const_iterator1 const_iterator_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator1,
typename M::iterator1>::type iterator_type;
#endif
@@ -1065,18 +1065,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -1562,18 +1562,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -2070,18 +2070,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -2575,18 +2575,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -2767,11 +2767,11 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::iterator2 iterator2_type;
#else
typedef typename M::const_iterator1 const_iterator1_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator1,
typename M::iterator1>::type iterator1_type;
typedef typename M::const_iterator2 const_iterator2_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator2,
typename M::iterator2>::type iterator2_type;
#endif
@@ -3499,18 +3499,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -4450,18 +4450,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif

View File

@@ -969,18 +969,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -995,11 +995,11 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::iterator2 iterator2_type;
#else
typedef typename M::const_iterator1 const_iterator1_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator1,
typename M::iterator1>::type iterator1_type;
typedef typename M::const_iterator2 const_iterator2_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator2,
typename M::iterator2>::type iterator2_type;
#endif

View File

@@ -132,12 +132,12 @@ namespace boost { namespace numeric { namespace ublas {
#ifndef BOOST_UBLAS_REFERENCE_CONST_MEMBER
bad_index ().raise ();
#endif
return one_;
return const_cast<reference>(one_);
} else {
#ifndef BOOST_UBLAS_REFERENCE_CONST_MEMBER
bad_index ().raise ();
#endif
return zero_;
return const_cast<reference>(zero_);
}
}
@@ -929,14 +929,14 @@ namespace boost { namespace numeric { namespace ublas {
size_type size1_;
size_type size2_;
array_type data_;
static value_type zero_;
static value_type one_;
static const value_type zero_;
static const value_type one_;
};
template<class T, class F1, class F2, class A>
typename triangular_matrix<T, F1, F2, A>::value_type triangular_matrix<T, F1, F2, A>::zero_ (0);
const typename triangular_matrix<T, F1, F2, A>::value_type triangular_matrix<T, F1, F2, A>::zero_ (0);
template<class T, class F1, class F2, class A>
typename triangular_matrix<T, F1, F2, A>::value_type triangular_matrix<T, F1, F2, A>::one_ (1);
const typename triangular_matrix<T, F1, F2, A>::value_type triangular_matrix<T, F1, F2, A>::one_ (1);
// Triangular matrix adaptor class
template<class M, class F>
@@ -959,18 +959,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::pointer pointer;
#else
typedef typename M::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_reference,
typename M::reference>::type reference;
typedef typename M::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_pointer,
typename M::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename M::closure_type matrix_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_closure_type,
typename M::closure_type>::type matrix_closure_type;
#endif
@@ -985,11 +985,11 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename M::iterator2 iterator2_type;
#else
typedef typename M::const_iterator1 const_iterator1_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator1,
typename M::iterator1>::type iterator1_type;
typedef typename M::const_iterator2 const_iterator2_type;
typedef typename boost::mpl::if_c<boost::is_const<M>::value,
typedef typename boost::mpl::if_<boost::is_const<M>,
typename M::const_iterator2,
typename M::iterator2>::type iterator2_type;
#endif
@@ -1053,12 +1053,12 @@ namespace boost { namespace numeric { namespace ublas {
#ifndef BOOST_UBLAS_REFERENCE_CONST_MEMBER
bad_index ().raise ();
#endif
return one_;
return const_cast<reference>(one_);
} else {
#ifndef BOOST_UBLAS_REFERENCE_CONST_MEMBER
bad_index ().raise ();
#endif
return zero_;
return const_cast<reference>(zero_);
}
}
#else
@@ -1072,12 +1072,12 @@ namespace boost { namespace numeric { namespace ublas {
#ifndef BOOST_UBLAS_REFERENCE_CONST_MEMBER
bad_index ().raise ();
#endif
return one_;
return const_cast<reference>(one_);
} else {
#ifndef BOOST_UBLAS_REFERENCE_CONST_MEMBER
bad_index ().raise ();
#endif
return zero_;
return const_cast<reference>(zero_);
}
}
#endif
@@ -1837,16 +1837,16 @@ namespace boost { namespace numeric { namespace ublas {
private:
matrix_closure_type data_;
static const_matrix_type nil_;
static value_type zero_;
static value_type one_;
static const value_type zero_;
static const value_type one_;
};
template<class M, class F>
typename triangular_adaptor<M, F>::const_matrix_type triangular_adaptor<M, F>::nil_;
template<class M, class F>
typename triangular_adaptor<M, F>::value_type triangular_adaptor<M, F>::zero_ (0);
const typename triangular_adaptor<M, F>::value_type triangular_adaptor<M, F>::zero_ (0);
template<class M, class F>
typename triangular_adaptor<M, F>::value_type triangular_adaptor<M, F>::one_ (1);
const typename triangular_adaptor<M, F>::value_type triangular_adaptor<M, F>::one_ (1);
template<class E1, class E2>
struct matrix_vector_solve_traits {

View File

@@ -326,11 +326,11 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename E::pointer pointer;
#else
typedef typename E::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<E>::value,
typedef typename boost::mpl::if_<boost::is_const<E>,
typename E::const_reference,
typename E::reference>::type reference;
typedef typename E::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<E>::value,
typedef typename boost::mpl::if_<boost::is_const<E>,
typename E::const_pointer,
typename E::pointer>::type pointer;
#endif
@@ -465,7 +465,7 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename E::iterator iterator;
#else
typedef typename E::const_iterator const_iterator;
typedef typename boost::mpl::if_c<boost::is_const<E>::value,
typedef typename boost::mpl::if_<boost::is_const<E>,
typename E::const_iterator,
typename E::iterator>::type iterator;
#endif
@@ -547,23 +547,23 @@ namespace boost { namespace numeric { namespace ublas {
#ifndef BOOST_UBLAS_NO_PROXY_SHORTCUTS
BOOST_UBLAS_USING vector_expression<vector_unary<E, F> >::operator ();
#endif
typedef typename boost::mpl::if_c<boost::is_same<F,
scalar_identity<typename E::value_type> >::value,
typedef typename boost::mpl::if_<boost::is_same<F,
scalar_identity<typename E::value_type> >,
E,
const E>::type expression_type;
typedef typename E::size_type size_type;
typedef typename E::difference_type difference_type;
typedef typename F::result_type value_type;
typedef value_type const_reference;
typedef typename boost::mpl::if_c<boost::is_same<F,
scalar_identity<value_type> >::value,
typedef typename boost::mpl::if_<boost::is_same<F,
scalar_identity<value_type> >,
typename E::reference,
value_type>::type reference;
typedef const value_type *const_pointer;
typedef const_pointer pointer;
private:
typedef F functor_type;
typedef typename boost::mpl::if_c<boost::is_const<expression_type>::value,
typedef typename boost::mpl::if_<boost::is_const<expression_type>,
typename E::const_closure_type,
typename E::closure_type>::type expression_closure_type;
typedef const vector_unary<E, F> const_self_type;

View File

@@ -45,18 +45,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename V::pointer pointer;
#else
typedef typename V::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_reference,
typename V::reference>::type reference;
typedef typename V::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_pointer,
typename V::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename V::closure_type vector_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_closure_type,
typename V::closure_type>::type vector_closure_type;
#endif
@@ -241,7 +241,7 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename V::iterator iterator_type;
#else
typedef typename V::const_iterator const_iterator_type;
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_iterator,
typename V::iterator>::type iterator_type;
#endif
@@ -577,18 +577,18 @@ namespace boost { namespace numeric { namespace ublas {
typedef typename V::pointer pointer;
#else
typedef typename V::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_reference,
typename V::reference>::type reference;
typedef typename V::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_pointer,
typename V::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename V::closure_type vector_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_closure_type,
typename V::closure_type>::type vector_closure_type;
#endif
@@ -1125,18 +1125,18 @@ return true;
typedef typename V::pointer pointer;
#else
typedef typename V::const_reference const_reference;
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_reference,
typename V::reference>::type reference;
typedef typename V::const_pointer const_pointer;
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_pointer,
typename V::pointer>::type pointer;
#endif
#ifndef BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS
typedef typename V::closure_type vector_closure_type;
#else
typedef typename boost::mpl::if_c<boost::is_const<V>::value,
typedef typename boost::mpl::if_<boost::is_const<V>,
typename V::const_closure_type,
typename V::closure_type>::type vector_closure_type;
#endif