From ee45ad5cc84f3191e2fd5e8f787894cba86ec380 Mon Sep 17 00:00:00 2001 From: Michael Stevens Date: Thu, 6 Oct 2005 19:56:35 +0000 Subject: [PATCH] MAJOR use boost::concept_check FIX missing Random Access Container functions and missing operator [] in Random Access Iterator svn path=/trunk/boost/boost/numeric/ublas/; revision=31213 --- include/boost/numeric/ublas/banded.hpp | 32 + .../boost/numeric/ublas/detail/concepts.hpp | 1424 +++++++---------- include/boost/numeric/ublas/detail/config.hpp | 2 +- include/boost/numeric/ublas/fwd.hpp | 22 +- include/boost/numeric/ublas/hermitian.hpp | 32 + include/boost/numeric/ublas/matrix.hpp | 56 + .../boost/numeric/ublas/matrix_expression.hpp | 64 + include/boost/numeric/ublas/matrix_proxy.hpp | 88 + include/boost/numeric/ublas/storage.hpp | 86 +- .../boost/numeric/ublas/storage_sparse.hpp | 12 +- include/boost/numeric/ublas/symmetric.hpp | 32 + include/boost/numeric/ublas/triangular.hpp | 32 + include/boost/numeric/ublas/vector.hpp | 34 +- .../boost/numeric/ublas/vector_expression.hpp | 16 + include/boost/numeric/ublas/vector_proxy.hpp | 25 + 15 files changed, 1112 insertions(+), 845 deletions(-) diff --git a/include/boost/numeric/ublas/banded.hpp b/include/boost/numeric/ublas/banded.hpp index d1ec9b5f..1ca6122e 100644 --- a/include/boost/numeric/ublas/banded.hpp +++ b/include/boost/numeric/ublas/banded.hpp @@ -411,6 +411,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -546,6 +550,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return (*this) ().at_element (it1_, it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -686,6 +694,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -821,6 +833,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return (*this) ().at_element (it1_, it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1363,6 +1379,10 @@ namespace boost { namespace numeric { namespace ublas { #endif return (*this) () (i, j); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1511,6 +1531,10 @@ namespace boost { namespace numeric { namespace ublas { #endif return (*this) () (i, j); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1665,6 +1689,10 @@ namespace boost { namespace numeric { namespace ublas { #endif return (*this) () (i, j); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1813,6 +1841,10 @@ namespace boost { namespace numeric { namespace ublas { #endif return (*this) () (i, j); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/detail/concepts.hpp b/include/boost/numeric/ublas/detail/concepts.hpp index 93c3959c..e1a3dcc3 100644 --- a/include/boost/numeric/ublas/detail/concepts.hpp +++ b/include/boost/numeric/ublas/detail/concepts.hpp @@ -24,178 +24,11 @@ namespace boost { namespace numeric { namespace ublas { - template - struct AssignableConcept { - typedef T value_type; - - static void constraints (value_type t) { - // Copy Constructor - value_type c1 (t); - value_type c2 = t; - // Assignment - value_type a = t; - std::swap (c1, c2); - ignore_unused_variable_warning (a); - } - }; - - template - struct EqualityComparableConcept { - typedef T value_type; - - static void constraints (const value_type t) { - bool b; - // Equality - b = t == t; - // Inequality - b = t != t; - ignore_unused_variable_warning (b); - } - }; - - template - struct LessThanComparableConcept { - typedef T value_type; - - static void constraints (const value_type t) { - bool b; - b = t < t; - b = t <= t; - b = t >= t; - b = t > t; - ignore_unused_variable_warning (b); - } - }; - - template - struct DefaultConstructibleConcept { - typedef T value_type; - - static void constraints () { - // Default Constructor - static value_type c1 = value_type (); - static value_type c2; - ignore_unused_variable_warning (c1); - ignore_unused_variable_warning (c2); - } - }; - - template::value_type> - struct BidirectionalIteratorConcept { - typedef I iterator_type; - - typedef typename std::iterator_traits::iterator_category iterator_category; - typedef typename std::iterator_traits::difference_type difference_type; - typedef typename std::iterator_traits::value_type value_type; - typedef typename std::iterator_traits::reference reference; - typedef typename std::iterator_traits::pointer pointer; - - static void constraints () { - AssignableConcept::constraints (iterator_type ()); - EqualityComparableConcept::constraints (iterator_type ()); - DefaultConstructibleConcept::constraints (); - iterator_type it = iterator_type (); - - // Associated types - assume constructable - iterator_category c; - difference_type d (0); - pointer p (0); - // Dereference - reference r (*it); - value_type t (r); - // Member access - // FIXME it->m; - // Preincrement - ++ it; - // Postincrement - it ++; - // Predecrement - -- it; - // Postdecrement - it --; - ignore_unused_variable_warning (t); - ignore_unused_variable_warning (c); - ignore_unused_variable_warning (d); - ignore_unused_variable_warning (p); - ignore_unused_variable_warning (r); - } - }; - - template::value_type> - struct MutableBidirectionalIteratorConcept { - typedef I iterator_type; - typedef T value_type; - - static void constraints () { - BidirectionalIteratorConcept::constraints (); - iterator_type it = iterator_type (); - value_type t = value_type (); - // Dereference assignment - *it = t; - ignore_unused_variable_warning (t); - } - }; - - template::difference_type, class T = typename std::iterator_traits::value_type> - struct RandomAccessIteratorConcept { - typedef I iterator_type; - typedef D difference_type; - typedef T value_type; - - static void constraints () { - LessThanComparableConcept::constraints (iterator_type ()); - BidirectionalIteratorConcept::constraints (); - iterator_type it = iterator_type (), it1 = iterator_type (), it2 = iterator_type (); - difference_type n (0); - value_type t; - // Forward motion - it += n; - // Iterator addition - it = it + n; - iterator_type itp (it + n); - // Backward motion - it -= n; - // Iterator subtraction - it = it - n; - iterator_type itm (it - n); - // Difference - n = it1 - it2; - // Element operator -#ifdef BOOST_UBLAS_ITERATOR_IS_INDEXABLE - t = it [n]; -#endif - t = *(it + n); - ignore_unused_variable_warning (itp); - ignore_unused_variable_warning (itm); - ignore_unused_variable_warning (t); - } - }; - - template::difference_type, class T = typename std::iterator_traits::value_type> - struct MutableRandomAccessIteratorConcept { - typedef I iterator_type; - typedef D difference_type; - typedef T value_type; - - static void constraints () { - MutableBidirectionalIteratorConcept::constraints (); - RandomAccessIteratorConcept::constraints (); - iterator_type it = iterator_type (); - difference_type n (0); - value_type t = value_type (); - // Element assignment -#ifdef BOOST_UBLAS_ITERATOR_IS_INDEXABLE - it [n] = t; -#endif - *(it + n) = t; - } - }; - template struct Indexed1DIteratorConcept { typedef I iterator_type; - static void constraints () { + void constraints () { iterator_type it = iterator_type (); // Index it.index (); @@ -206,19 +39,19 @@ namespace boost { namespace numeric { namespace ublas { struct IndexedBidirectional1DIteratorConcept { typedef I iterator_type; - static void constraints () { - BidirectionalIteratorConcept::constraints (); - Indexed1DIteratorConcept::constraints (); + void constraints () { + function_requires< BidirectionalIteratorConcept >(); + function_requires< Indexed1DIteratorConcept >(); } }; template - struct MutableIndexedBidirectional1DIteratorConcept { + struct Mutable_IndexedBidirectional1DIteratorConcept { typedef I iterator_type; - static void constraints () { - MutableBidirectionalIteratorConcept::constraints (); - Indexed1DIteratorConcept::constraints (); + void constraints () { + function_requires< Mutable_BidirectionalIteratorConcept >(); + function_requires< Indexed1DIteratorConcept >(); } }; @@ -226,19 +59,19 @@ namespace boost { namespace numeric { namespace ublas { struct IndexedRandomAccess1DIteratorConcept { typedef I iterator_type; - static void constraints () { - RandomAccessIteratorConcept::constraints (); - Indexed1DIteratorConcept::constraints (); + void constraints () { + function_requires< RandomAccessIteratorConcept >(); + function_requires< Indexed1DIteratorConcept >(); } }; template - struct MutableIndexedRandomAccess1DIteratorConcept { + struct Mutable_IndexedRandomAccess1DIteratorConcept { typedef I iterator_type; - static void constraints () { - MutableRandomAccessIteratorConcept::constraints (); - Indexed1DIteratorConcept::constraints (); + void constraints () { + function_requires< Mutable_RandomAccessIteratorConcept >(); + function_requires< Indexed1DIteratorConcept >(); } }; @@ -248,7 +81,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename I::dual_iterator_type dual_iterator_type; typedef typename I::dual_reverse_iterator_type dual_reverse_iterator_type; - static void constraints () { + void constraints () { iterator_type it = iterator_type (); // Indices it.index1 (); @@ -271,24 +104,24 @@ namespace boost { namespace numeric { namespace ublas { typedef I1 subiterator1_type; typedef I2 subiterator2_type; - static void constraints () { - BidirectionalIteratorConcept::constraints (); - BidirectionalIteratorConcept::constraints (); - Indexed2DIteratorConcept::constraints (); - Indexed2DIteratorConcept::constraints (); + void constraints () { + function_requires< BidirectionalIteratorConcept >(); + function_requires< BidirectionalIteratorConcept >(); + function_requires< Indexed2DIteratorConcept >(); + function_requires< Indexed2DIteratorConcept >(); } }; template - struct MutableIndexedBidirectional2DIteratorConcept { + struct Mutable_IndexedBidirectional2DIteratorConcept { typedef I1 subiterator1_type; typedef I2 subiterator2_type; - static void constraints () { - MutableBidirectionalIteratorConcept::constraints (); - MutableBidirectionalIteratorConcept::constraints (); - Indexed2DIteratorConcept::constraints (); - Indexed2DIteratorConcept::constraints (); + void constraints () { + function_requires< Mutable_BidirectionalIteratorConcept >(); + function_requires< Mutable_BidirectionalIteratorConcept >(); + function_requires< Indexed2DIteratorConcept >(); + function_requires< Indexed2DIteratorConcept >(); } }; @@ -297,135 +130,24 @@ namespace boost { namespace numeric { namespace ublas { typedef I1 subiterator1_type; typedef I2 subiterator2_type; - static void constraints () { - RandomAccessIteratorConcept::constraints (); - RandomAccessIteratorConcept::constraints (); - Indexed2DIteratorConcept::constraints (); - Indexed2DIteratorConcept::constraints (); + void constraints () { + function_requires< RandomAccessIteratorConcept >(); + function_requires< RandomAccessIteratorConcept >(); + function_requires< Indexed2DIteratorConcept >(); + function_requires< Indexed2DIteratorConcept >(); } }; template - struct MutableIndexedRandomAccess2DIteratorConcept { + struct Mutable_IndexedRandomAccess2DIteratorConcept { typedef I1 subiterator1_type; typedef I2 subiterator2_type; - static void constraints () { - MutableRandomAccessIteratorConcept::constraints (); - MutableRandomAccessIteratorConcept::constraints (); - Indexed2DIteratorConcept::constraints (); - Indexed2DIteratorConcept::constraints (); - } - }; - - template - struct ContainerConcept { - typedef C container_type; - typedef typename C::size_type size_type; - typedef typename C::const_iterator const_iterator_type; - - static void constraints () { - DefaultConstructibleConcept::constraints (); - container_type c = container_type (); - size_type n (0); - // Beginning of range - const_iterator_type cit_begin (c.begin ()); - // End of range - const_iterator_type cit_end (c.end ()); - // Size - n = c.size (); - ignore_unused_variable_warning (cit_end); - ignore_unused_variable_warning (cit_begin); - ignore_unused_variable_warning (n); - } - }; - - template - struct MutableContainerConcept { - typedef C container_type; - typedef typename C::iterator iterator_type; - - static void constraints () { - AssignableConcept::constraints (container_type ()); - ContainerConcept::constraints (); - container_type c = container_type (), c1 = container_type (), c2 = container_type (); - // Beginning of range - iterator_type it_begin (c.begin ()); - // End of range - iterator_type it_end (c.end ()); - // Swap - c1.swap (c2); - ignore_unused_variable_warning (it_end); - ignore_unused_variable_warning (it_begin); - } - }; - - template - struct ReversibleContainerConcept { - typedef C container_type; - typedef typename C::const_reverse_iterator const_reverse_iterator_type; - - static void constraints () { - ContainerConcept::constraints (); - const container_type cc = container_type (); - // Beginning of reverse range - const_reverse_iterator_type crit_begin (cc.rbegin ()); - // End of reverse range - const_reverse_iterator_type crit_end (cc.rend ()); - ignore_unused_variable_warning (crit_end); - ignore_unused_variable_warning (crit_begin); - } - }; - - template - struct MutableReversibleContainerConcept { - typedef C container_type; - typedef typename C::reverse_iterator reverse_iterator_type; - - static void constraints () { - MutableContainerConcept::constraints (); - ReversibleContainerConcept::constraints (); - container_type c = container_type (); - // Beginning of reverse range - reverse_iterator_type rit_begin (c.rbegin ()); - // End of reverse range - reverse_iterator_type rit_end (c.rend ()); - ignore_unused_variable_warning (rit_end); - ignore_unused_variable_warning (rit_begin); - } - }; - - template - struct RandomAccessContainerConcept { - typedef C container_type; - typedef typename C::size_type size_type; - typedef typename C::value_type value_type; - - static void constraints () { - ReversibleContainerConcept::constraints (); - container_type c = container_type (); - size_type n (0); - value_type t = value_type (); - // Element access - t = c [n]; - ignore_unused_variable_warning (t); - } - }; - - template - struct MutableRandomAccessContainerConcept { - typedef C container_type; - typedef typename C::size_type size_type; - typedef typename C::value_type value_type; - - static void constraints () { - MutableReversibleContainerConcept::constraints (); - RandomAccessContainerConcept::constraints (); - container_type c = container_type (); - size_type n (0); - value_type t = value_type (); - // Element access - c [n] = t; + void constraints () { + function_requires< Mutable_RandomAccessIteratorConcept >(); + function_requires< Mutable_RandomAccessIteratorConcept >(); + function_requires< Indexed2DIteratorConcept >(); + function_requires< Indexed2DIteratorConcept >(); } }; @@ -435,8 +157,8 @@ namespace boost { namespace numeric { namespace ublas { typedef typename C::size_type size_type; typedef typename C::value_type value_type; - static void constraints () { - RandomAccessContainerConcept::constraints (); + void constraints () { + function_requires< RandomAccessContainerConcept >(); size_type n (0); // Sizing constructor container_type c = container_type (n); @@ -447,14 +169,14 @@ namespace boost { namespace numeric { namespace ublas { }; template - struct MutableStorageArrayConcept { + struct Mutable_StorageArrayConcept { typedef C container_type; typedef typename C::size_type size_type; typedef typename C::value_type value_type; typedef typename C::iterator iterator_type; - static void constraints () { - MutableRandomAccessContainerConcept::constraints (); + void constraints () { + function_requires< Mutable_RandomAccessContainerConcept > (); size_type n (0); // Sizing constructor container_type c = container_type (n); @@ -472,20 +194,21 @@ namespace boost { namespace numeric { namespace ublas { typedef C container_type; typedef typename C::size_type size_type; - static void constraints () { - ReversibleContainerConcept::constraints (); + void constraints () { + function_requires< ReversibleContainerConcept > (); } }; template - struct MutableStorageSparseConcept { + struct Mutable_StorageSparseConcept { typedef C container_type; typedef typename C::size_type size_type; typedef typename C::value_type value_type; typedef typename C::iterator iterator_type; - static void constraints () { - MutableReversibleContainerConcept::constraints (); + void constraints () { + // NOTE - Not Mutable_ReversibleContainerConcept + function_requires< ReversibleContainerConcept >(); container_type c = container_type (); value_type t = value_type (); iterator_type it = iterator_type (), it1 = iterator_type (), it2 = iterator_type (); @@ -506,9 +229,9 @@ namespace boost { namespace numeric { namespace ublas { typedef typename G::size_type size_type; typedef typename G::value_type value_type; - static void constraints () { - AssignableConcept::constraints (generator_type ()); - ReversibleContainerConcept::constraints (); + void constraints () { + function_requires< AssignableConcept >(); + function_requires< ReversibleContainerConcept >(); generator_type g = generator_type (); size_type n (0); value_type t; @@ -523,8 +246,8 @@ namespace boost { namespace numeric { namespace ublas { typedef SE scalar_expression_type; typedef typename SE::value_type value_type; - static void constraints () { - scalar_expression_type *sp; + void constraints () { + scalar_expression_type *sp; scalar_expression_type s = *sp; value_type t; // Conversion @@ -542,9 +265,9 @@ namespace boost { namespace numeric { namespace ublas { typedef typename VE::const_iterator const_iterator_type; typedef typename VE::const_reverse_iterator const_reverse_iterator_type; - static void constraints () { - vector_expression_type *vp; - const vector_expression_type *cvp; + void constraints () { + vector_expression_type *vp; + const vector_expression_type *cvp; vector_expression_type v = *vp; const vector_expression_type cv = *cvp; size_type n (0), i (0); @@ -574,17 +297,17 @@ namespace boost { namespace numeric { namespace ublas { }; template - struct MutableVectorExpressionConcept { + struct Mutable_VectorExpressionConcept { typedef VE vector_expression_type; typedef typename VE::size_type size_type; typedef typename VE::value_type value_type; typedef typename VE::iterator iterator_type; typedef typename VE::reverse_iterator reverse_iterator_type; - static void constraints () { - vector_expression_type *vp; - AssignableConcept::constraints (*vp); - VectorExpressionConcept::constraints (); + void constraints () { + function_requires< AssignableConcept >(); + function_requires< VectorExpressionConcept >(); + vector_expression_type *vp; vector_expression_type v = *vp, v1 = *vp, v2 = *vp; size_type i (0); value_type t = value_type (); @@ -627,9 +350,9 @@ namespace boost { namespace numeric { namespace ublas { typedef typename ME::const_reverse_iterator1 const_reverse_subiterator1_type; typedef typename ME::const_reverse_iterator2 const_reverse_subiterator2_type; - static void constraints () { - matrix_expression_type *mp; - const matrix_expression_type *cmp; + void constraints () { + matrix_expression_type *mp; + const matrix_expression_type *cmp; matrix_expression_type m = *mp; const matrix_expression_type cm = *cmp; size_type n (0), i (0), j (0); @@ -670,7 +393,7 @@ namespace boost { namespace numeric { namespace ublas { }; template - struct MutableMatrixExpressionConcept { + struct Mutable_MatrixExpressionConcept { typedef ME matrix_expression_type; typedef typename ME::size_type size_type; typedef typename ME::value_type value_type; @@ -679,10 +402,10 @@ namespace boost { namespace numeric { namespace ublas { typedef typename ME::reverse_iterator1 reverse_subiterator1_type; typedef typename ME::reverse_iterator2 reverse_subiterator2_type; - static void constraints () { - matrix_expression_type *mp; - AssignableConcept::constraints (*mp); - MatrixExpressionConcept::constraints (); + void constraints () { + function_requires< AssignableConcept >(); + function_requires< MatrixExpressionConcept >(); + matrix_expression_type *mp; matrix_expression_type m = *mp, m1 = *mp, m2 = *mp; size_type i (0), j (0); value_type t = value_type (); @@ -731,8 +454,8 @@ namespace boost { namespace numeric { namespace ublas { typedef typename V::value_type value_type; typedef const value_type *const_pointer; - static void constraints () { - VectorExpressionConcept::constraints (); + void constraints () { + function_requires< VectorExpressionConcept >(); size_type n (0); size_type i (0); // Sizing constructor @@ -745,20 +468,19 @@ namespace boost { namespace numeric { namespace ublas { }; template - struct MutableVectorConcept { + struct Mutable_VectorConcept { typedef V vector_type; typedef typename V::size_type size_type; typedef typename V::value_type value_type; typedef value_type *pointer; - static void constraints () { - VectorConcept::constraints (); - MutableVectorExpressionConcept::constraints (); + void constraints () { + function_requires< VectorConcept >(); + function_requires< Mutable_VectorExpressionConcept >(); size_type n (0); value_type t = value_type (); size_type i (0); - // Sizing constructor - vector_type v (n); + vector_type v; // Element support pointer p = v.find_element (i); // Element assignment @@ -779,24 +501,22 @@ namespace boost { namespace numeric { namespace ublas { typedef V vector_type; typedef typename V::size_type size_type; - static void constraints () { - VectorConcept::constraints (); + void constraints () { + function_requires< VectorConcept >(); } }; template - struct MutableSparseVectorConcept { + struct Mutable_SparseVectorConcept { typedef V vector_type; typedef typename V::size_type size_type; typedef typename V::value_type value_type; - static void constraints () { - SparseVectorConcept::constraints (); - MutableVectorConcept::constraints (); - size_type n (0); + void constraints () { + function_requires< SparseVectorConcept >(); + function_requires< Mutable_VectorConcept >(); size_type i (0); - // Sizing constructor - vector_type v (n); + vector_type v; // Element erasure v.erase_element (i); } @@ -809,8 +529,8 @@ namespace boost { namespace numeric { namespace ublas { typedef typename M::value_type value_type; typedef const value_type *const_pointer; - static void constraints () { - MatrixExpressionConcept::constraints (); + void constraints () { + function_requires< MatrixExpressionConcept >(); size_type n (0); size_type i (0), j (0); // Sizing constructor @@ -828,20 +548,19 @@ namespace boost { namespace numeric { namespace ublas { }; template - struct MutableMatrixConcept { + struct Mutable_MatrixConcept { typedef M matrix_type; typedef typename M::size_type size_type; typedef typename M::value_type value_type; typedef value_type *pointer; - static void constraints () { - MatrixConcept::constraints (); - MutableMatrixExpressionConcept::constraints (); + void constraints () { + function_requires< MatrixConcept >(); + function_requires< Mutable_MatrixExpressionConcept >(); size_type n (0); value_type t = value_type (); size_type i (0), j (0); - // Sizing constructor - matrix_type m (n, n); + matrix_type m; // Element support #ifndef SKIP_BAD pointer p = m.find_element (i, j); @@ -869,24 +588,22 @@ namespace boost { namespace numeric { namespace ublas { typedef M matrix_type; typedef typename M::size_type size_type; - static void constraints () { - MatrixConcept::constraints (); + void constraints () { + function_requires< MatrixConcept >(); } }; template - struct MutableSparseMatrixConcept { + struct Mutable_SparseMatrixConcept { typedef M matrix_type; typedef typename M::size_type size_type; typedef typename M::value_type value_type; - static void constraints () { - SparseMatrixConcept::constraints (); - MutableMatrixConcept::constraints (); - size_type n (0); + void constraints () { + function_requires< SparseMatrixConcept >(); + function_requires< Mutable_MatrixConcept >(); size_type i (0), j (0); - // Sizing constructor - matrix_type m (n, n); + matrix_type m; // Elemnent erasure m.erase_element (i, j); } @@ -1021,7 +738,7 @@ namespace boost { namespace numeric { namespace ublas { struct AdditiveAbelianGroupConcept { typedef T value_type; - static void constraints () { + void constraints () { bool r; value_type a = value_type (), b = value_type (), c = value_type (); r = (a + b) + c == a + (b + c); @@ -1038,7 +755,7 @@ namespace boost { namespace numeric { namespace ublas { struct MultiplicativeAbelianGroupConcept { typedef T value_type; - static void constraints () { + void constraints () { bool r; value_type a = value_type (), b = value_type (), c = value_type (); r = (a * b) * c == a * (b * c); @@ -1055,8 +772,8 @@ namespace boost { namespace numeric { namespace ublas { struct RingWithIdentityConcept { typedef T value_type; - static void constraints () { - AdditiveAbelianGroupConcept::constraints (); + void constraints () { + function_requires< AdditiveAbelianGroupConcept >(); bool r; value_type a = value_type (), b = value_type (), c = value_type (); r = (a * b) * c == a * (b * c); @@ -1065,8 +782,14 @@ namespace boost { namespace numeric { namespace ublas { r = a * OneElement (value_type ()) == a; ignore_unused_variable_warning (r); } - static void constraints (int) { - AdditiveAbelianGroupConcept::constraints (); + }; + + template + struct Prod_RingWithIdentityConcept { + typedef T value_type; + + void constraints () { + function_requires< AdditiveAbelianGroupConcept >(); bool r; value_type a = value_type (), b = value_type (), c = value_type (); r = prod (T (prod (a, b)), c) == prod (a, T (prod (b, c))); @@ -1081,8 +804,8 @@ namespace boost { namespace numeric { namespace ublas { struct CommutativeRingWithIdentityConcept { typedef T value_type; - static void constraints () { - RingWithIdentityConcept::constraints (); + void constraints () { + function_requires< RingWithIdentityConcept >(); bool r; value_type a = value_type (), b = value_type (); r = a * b == b * a; @@ -1094,8 +817,8 @@ namespace boost { namespace numeric { namespace ublas { struct FieldConcept { typedef T value_type; - static void constraints () { - CommutativeRingWithIdentityConcept::constraints (); + void constraints () { + function_requires< CommutativeRingWithIdentityConcept >(); bool r; value_type a = value_type (); r = a == ZeroElement (value_type ()) || a * (OneElement (value_type ()) / a) == a; @@ -1109,9 +832,9 @@ namespace boost { namespace numeric { namespace ublas { typedef T value_type; typedef V vector_type; - static void constraints () { - FieldConcept::constraints (); - AdditiveAbelianGroupConcept::constraints (); + void constraints () { + function_requires< FieldConcept >(); + function_requires< AdditiveAbelianGroupConcept >(); bool r; value_type alpha = value_type (), beta = value_type (); vector_type a = vector_type (), b = vector_type (); @@ -1129,8 +852,8 @@ namespace boost { namespace numeric { namespace ublas { typedef V vector_type; typedef M matrix_type; - static void constraints () { - VectorSpaceConcept::constraints (); + void constraints () { + function_requires< VectorSpaceConcept >(); bool r; value_type alpha = value_type (), beta = value_type (); vector_type a = vector_type (), b = vector_type (); @@ -1157,565 +880,612 @@ namespace boost { namespace numeric { namespace ublas { // Storage Array #if defined (INTERNAL_STORAGE) || defined (INTERNAL_STORAGE_DENSE) - StorageArrayConcept >::constraints (); - MutableStorageArrayConcept >::constraints (); - RandomAccessIteratorConcept::const_iterator>::constraints (); - MutableRandomAccessIteratorConcept::iterator>::constraints (); + { + typedef std::vector container_model; + function_requires< Mutable_StorageArrayConcept >(); + function_requires< RandomAccessIteratorConcept >(); + function_requires< Mutable_RandomAccessIteratorConcept >(); + } - StorageArrayConcept >::constraints (); - MutableStorageArrayConcept >::constraints (); - RandomAccessIteratorConcept::const_iterator>::constraints (); - MutableRandomAccessIteratorConcept::iterator>::constraints (); + { + typedef bounded_array container_model; + function_requires< Mutable_StorageArrayConcept >(); + function_requires< RandomAccessIteratorConcept >(); + function_requires< Mutable_RandomAccessIteratorConcept >(); + } - StorageArrayConcept >::constraints (); - MutableStorageArrayConcept >::constraints (); - RandomAccessIteratorConcept::const_iterator>::constraints (); - MutableRandomAccessIteratorConcept::iterator>::constraints (); + { + typedef unbounded_array container_model; + function_requires< Mutable_StorageArrayConcept >(); + function_requires< RandomAccessIteratorConcept >(); + function_requires< Mutable_RandomAccessIteratorConcept >(); + } - StorageArrayConcept >::constraints (); - MutableStorageArrayConcept >::constraints (); - RandomAccessIteratorConcept::const_iterator>::constraints (); - MutableRandomAccessIteratorConcept::iterator>::constraints (); +/* FIXME array_adaptors are in progress + { + typedef array_adaptor container_model; + function_requires< Mutable_StorageArrayConcept >(); + function_requires< RandomAccessIteratorConcept >(); + function_requires< Mutable_RandomAccessIteratorConcept >(); + } +*/ - IndexSetConcept::constraints (); - RandomAccessIteratorConcept::constraints (); + { + typedef range container_model; + function_requires< IndexSetConcept >(); + function_requires< RandomAccessIteratorConcept >(); + } - IndexSetConcept::constraints (); - RandomAccessIteratorConcept::constraints (); + { + typedef slice container_model; + function_requires< IndexSetConcept >(); + function_requires< RandomAccessIteratorConcept >(); + } - IndexSetConcept >::constraints (); - RandomAccessIteratorConcept::const_iterator>::constraints (); + { + typedef indirect_array<> container_model; + function_requires< IndexSetConcept >(); + function_requires< RandomAccessIteratorConcept >(); + } #endif // Storage Sparse #if defined (INTERNAL_STORAGE) || defined (INTERNAL_STORAGE_SPARSE) - StorageSparseConcept >::constraints (); - MutableStorageSparseConcept >::constraints (); - RandomAccessIteratorConcept::const_iterator>::constraints (); - MutableRandomAccessIteratorConcept::iterator>::constraints (); + { + typedef map_array container_model; + function_requires< Mutable_StorageSparseConcept >(); + function_requires< RandomAccessIteratorConcept >(); + function_requires< RandomAccessIteratorConcept >(); + } - StorageSparseConcept >::constraints (); - MutableStorageSparseConcept >::constraints (); - BidirectionalIteratorConcept::const_iterator>::constraints (); - // Not value_type mutable - BidirectionalIteratorConcept::iterator>::constraints (); + { + typedef std::map container_model; + function_requires< Mutable_StorageSparseConcept >(); + function_requires< BidirectionalIteratorConcept >(); + function_requires< BidirectionalIteratorConcept >(); + } #endif // Vector #if defined (INTERNAL_VECTOR) || defined (INTERNAL_VECTOR_DENSE) - VectorConcept >::constraints (); - MutableVectorConcept >::constraints (); - IndexedRandomAccess1DIteratorConcept::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept::reverse_iterator>::constraints (); + { + typedef vector container_model; + function_requires< RandomAccessContainerConcept >(); + function_requires< Mutable_VectorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } - VectorConcept >::constraints (); - IndexedBidirectional1DIteratorConcept::const_iterator>::constraints (); - IndexedBidirectional1DIteratorConcept::const_reverse_iterator>::constraints (); + { + typedef zero_vector container_model; + function_requires< VectorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + } - VectorConcept >::constraints (); - IndexedBidirectional1DIteratorConcept::const_iterator>::constraints (); - IndexedBidirectional1DIteratorConcept::const_reverse_iterator>::constraints (); + { + typedef unit_vector container_model; + function_requires< VectorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + } - VectorConcept >::constraints (); - IndexedRandomAccess1DIteratorConcept::const_iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept::const_reverse_iterator>::constraints (); + { + typedef scalar_vector container_model; + function_requires< VectorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + } - VectorConcept >::constraints (); - MutableVectorConcept >::constraints (); - IndexedRandomAccess1DIteratorConcept::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept::reverse_iterator>::constraints (); + { + typedef c_vector container_model; + function_requires< Mutable_VectorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } #endif // Vector Proxies #if defined (INTERNAL_VECTOR) || defined (INTERNAL_VECTOR_PROXY) - VectorExpressionConcept > >::constraints (); - MutableVectorExpressionConcept > >::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::reverse_iterator>::constraints (); + { + typedef vector_range > container_model; + function_requires< Mutable_VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept > >::constraints (); - MutableVectorExpressionConcept > >::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::reverse_iterator>::constraints (); + { + typedef vector_slice > container_model; + function_requires< Mutable_VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept > >::constraints (); - MutableVectorExpressionConcept > >::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::reverse_iterator>::constraints (); + { + typedef vector_indirect > container_model; + function_requires< Mutable_VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } #endif // Sparse Vector #if defined (INTERNAL_SPARSE) || defined (INTERNAL_VECTOR_SPARSE) - SparseVectorConcept >::constraints (); - MutableSparseVectorConcept >::constraints (); - IndexedBidirectional1DIteratorConcept::const_iterator>::constraints (); - MutableIndexedBidirectional1DIteratorConcept::iterator>::constraints (); - IndexedBidirectional1DIteratorConcept::const_reverse_iterator>::constraints (); - MutableIndexedBidirectional1DIteratorConcept::reverse_iterator>::constraints (); + { + typedef mapped_vector container_model; + function_requires< Mutable_SparseVectorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional1DIteratorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional1DIteratorConcept >(); + } - SparseVectorConcept >::constraints (); - MutableSparseVectorConcept >::constraints (); - IndexedBidirectional1DIteratorConcept::const_iterator>::constraints (); - MutableIndexedBidirectional1DIteratorConcept::iterator>::constraints (); - IndexedBidirectional1DIteratorConcept::const_reverse_iterator>::constraints (); - MutableIndexedBidirectional1DIteratorConcept::reverse_iterator>::constraints (); + { + typedef compressed_vector container_model; + function_requires< Mutable_SparseVectorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional1DIteratorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional1DIteratorConcept >(); + } - SparseVectorConcept >::constraints (); - MutableSparseVectorConcept >::constraints (); - IndexedBidirectional1DIteratorConcept::const_iterator>::constraints (); - MutableIndexedBidirectional1DIteratorConcept::iterator>::constraints (); - IndexedBidirectional1DIteratorConcept::const_reverse_iterator>::constraints (); - MutableIndexedBidirectional1DIteratorConcept::reverse_iterator>::constraints (); + { + typedef coordinate_vector container_model; + function_requires< Mutable_SparseVectorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional1DIteratorConcept >(); + function_requires< IndexedBidirectional1DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional1DIteratorConcept >(); + } #endif // Matrix #if defined (INTERNAL_MATRIX) || defined (INTERNAL_MATRIX_DENSE) - MatrixConcept >::constraints (); - MutableMatrixConcept >::constraints (); - IndexedRandomAccess2DIteratorConcept::const_iterator1, - matrix::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::iterator1, - matrix::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept::const_reverse_iterator1, - matrix::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::reverse_iterator1, - matrix::reverse_iterator2>::constraints (); + { + typedef matrix container_model; + function_requires< Mutable_MatrixConcept > >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } - MatrixConcept >::constraints (); - MutableMatrixConcept >::constraints (); - IndexedRandomAccess2DIteratorConcept::const_iterator1, - vector_of_vector::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::iterator1, - vector_of_vector::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept::const_reverse_iterator1, - vector_of_vector::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::reverse_iterator1, - vector_of_vector::reverse_iterator2>::constraints (); + { + typedef vector_of_vector container_model; + function_requires< Mutable_MatrixConcept > >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } - MatrixConcept >::constraints (); - IndexedBidirectional2DIteratorConcept::const_iterator1, - zero_matrix::const_iterator2>::constraints (); - IndexedBidirectional2DIteratorConcept::const_reverse_iterator1, - zero_matrix::const_reverse_iterator2>::constraints (); + { + typedef zero_matrix container_model; + function_requires< Mutable_MatrixConcept > >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + } - MatrixConcept >::constraints (); - IndexedBidirectional2DIteratorConcept::const_iterator1, - identity_matrix::const_iterator2>::constraints (); - IndexedBidirectional2DIteratorConcept::const_reverse_iterator1, - identity_matrix::const_reverse_iterator2>::constraints (); + { + typedef identity_matrix container_model; + function_requires< Mutable_MatrixConcept > >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + } - MatrixConcept >::constraints (); - IndexedRandomAccess2DIteratorConcept::const_iterator1, - scalar_matrix::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept::const_reverse_iterator1, - scalar_matrix::const_reverse_iterator2>::constraints (); + { + typedef scalar_matrix container_model; + function_requires< Mutable_MatrixConcept > >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - MatrixConcept >::constraints (); - MutableMatrixConcept >::constraints (); - IndexedRandomAccess2DIteratorConcept::const_iterator1, - c_matrix::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::iterator1, - c_matrix::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept::const_reverse_iterator1, - c_matrix::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::reverse_iterator1, - c_matrix::reverse_iterator2>::constraints (); + { + typedef c_matrix container_model; + function_requires< Mutable_MatrixConcept > >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } #endif // Matrix Proxies #if defined (INTERNAL_MATRIX) || defined (INTERNAL_MATRIX_PROXY) - VectorExpressionConcept > >::constraints (); - MutableVectorExpressionConcept > >::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::reverse_iterator>::constraints (); + { + typedef matrix_row > container_model; + function_requires< Mutable_VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept > >::constraints (); - MutableVectorExpressionConcept > >::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::reverse_iterator>::constraints (); + { + typedef matrix_column > container_model; + function_requires< Mutable_VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept > >::constraints (); - MutableVectorExpressionConcept > >::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::reverse_iterator>::constraints (); + { + typedef matrix_vector_range > container_model; + function_requires< Mutable_VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept > >::constraints (); - MutableVectorExpressionConcept > >::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::reverse_iterator>::constraints (); + { + typedef matrix_vector_slice > container_model; + function_requires< Mutable_VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept, vector > >::constraints (); - MutableVectorExpressionConcept, vector > >::constraints (); - IndexedRandomAccess1DIteratorConcept, vector >::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept, vector >::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept, vector >::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept, vector >::reverse_iterator>::constraints (); + { + typedef matrix_vector_indirect > container_model; + function_requires< Mutable_VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } - MatrixExpressionConcept > >::constraints (); - MutableMatrixExpressionConcept > >::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_iterator1, - matrix_range >::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::iterator1, - matrix_range >::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_reverse_iterator1, - matrix_range >::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::reverse_iterator1, - matrix_range >::reverse_iterator2>::constraints (); + { + typedef matrix_range > container_model; + function_requires< Mutable_MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept > >::constraints (); - MutableMatrixExpressionConcept > >::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_iterator1, - matrix_slice >::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::iterator1, - matrix_slice >::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_reverse_iterator1, - matrix_slice >::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::reverse_iterator1, - matrix_slice >::reverse_iterator2>::constraints (); + { + typedef matrix_slice > container_model; + function_requires< Mutable_MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept > >::constraints (); - MutableMatrixExpressionConcept > >::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_iterator1, - matrix_indirect >::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::iterator1, - matrix_indirect >::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_reverse_iterator1, - matrix_indirect >::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::reverse_iterator1, - matrix_indirect >::reverse_iterator2>::constraints (); + { + typedef matrix_indirect > container_model; + function_requires< Mutable_MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } #endif // Banded Matrix #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_BANDED) - MatrixConcept >::constraints (); - MutableMatrixConcept >::constraints (); - IndexedRandomAccess2DIteratorConcept::const_iterator1, - banded_matrix::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::iterator1, - banded_matrix::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept::const_reverse_iterator1, - banded_matrix::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::reverse_iterator1, - banded_matrix::reverse_iterator2>::constraints (); + { + typedef banded_matrix container_model; + function_requires< Mutable_MatrixConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept > >::constraints (); - MutableMatrixExpressionConcept > >::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_iterator1, - banded_adaptor >::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::iterator1, - banded_adaptor >::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_reverse_iterator1, - banded_adaptor >::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::reverse_iterator1, - banded_adaptor >::reverse_iterator2>::constraints (); + { + typedef banded_adaptor > container_model; + function_requires< Mutable_MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } #endif // Triangular Matrix #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_TRIANGULAR) - MatrixConcept >::constraints (); - MutableMatrixConcept >::constraints (); - IndexedRandomAccess2DIteratorConcept::const_iterator1, - triangular_matrix::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::iterator1, - triangular_matrix::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept::const_reverse_iterator1, - triangular_matrix::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::reverse_iterator1, - triangular_matrix::reverse_iterator2>::constraints (); + { + typedef triangular_matrix container_model; + function_requires< Mutable_MatrixConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept > >::constraints (); - MutableMatrixExpressionConcept > >::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_iterator1, - triangular_adaptor >::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::iterator1, - triangular_adaptor >::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_reverse_iterator1, - triangular_adaptor >::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::reverse_iterator1, - triangular_adaptor >::reverse_iterator2>::constraints (); + { + typedef triangular_adaptor > container_model; + function_requires< Mutable_MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } #endif // Symmetric Matrix #if defined (INTERNA_SPECIAL) || defined (INTERNAL_SYMMETRIC) - MatrixConcept >::constraints (); - MutableMatrixConcept >::constraints (); - IndexedRandomAccess2DIteratorConcept::const_iterator1, - symmetric_matrix::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::iterator1, - symmetric_matrix::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept::const_reverse_iterator1, - symmetric_matrix::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::reverse_iterator1, - symmetric_matrix::reverse_iterator2>::constraints (); + { + typedef symmetric_matrix container_model; + function_requires< Mutable_MatrixConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept > >::constraints (); + { + typedef banded_adaptor > container_model; #ifndef SKIP_BAD - // const_iterator (iterator) constructor is bad - MutableMatrixExpressionConcept > >::constraints (); + // const_iterator (iterator) constructor is bad + function_requires< Mutable_MatrixExpressionConcept >(); #endif - IndexedRandomAccess2DIteratorConcept >::const_iterator1, - symmetric_adaptor >::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::iterator1, - symmetric_adaptor >::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_reverse_iterator1, - symmetric_adaptor >::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::reverse_iterator1, - symmetric_adaptor >::reverse_iterator2>::constraints (); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } #endif // Hermitian Matrix #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_HERMITIAN) - MatrixConcept >::constraints (); - MutableMatrixConcept >::constraints (); - IndexedRandomAccess2DIteratorConcept::const_iterator1, - hermitian_matrix::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::iterator1, - hermitian_matrix::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept::const_reverse_iterator1, - hermitian_matrix::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept::reverse_iterator1, - hermitian_matrix::reverse_iterator2>::constraints (); - - MatrixExpressionConcept > >::constraints (); + { + typedef hermitian_matrix container_model; + function_requires< Mutable_MatrixConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } + + { + typedef hermitian_adaptor > container_model; #ifndef SKIP_BAD - // const_iterator (iterator) constructor is bad - MutableMatrixExpressionConcept > >::constraints (); + // const_iterator (iterator) constructor is bad + function_requires< Mutable_MatrixExpressionConcept >(); #endif - IndexedRandomAccess2DIteratorConcept >::const_iterator1, - hermitian_adaptor >::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::iterator1, - hermitian_adaptor >::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_reverse_iterator1, - hermitian_adaptor >::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::reverse_iterator1, - hermitian_adaptor >::reverse_iterator2>::constraints (); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } #endif // Sparse Matrix #if defined (INTERNAL_SPARSE) || defined (INTERNAL_MATRIX_SPARSE) { typedef mapped_matrix container_model; - SparseMatrixConcept::constraints (); - MutableSparseMatrixConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); + function_requires< Mutable_SparseMatrixConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); } { typedef mapped_vector_of_mapped_vector container_model; - SparseMatrixConcept::constraints (); - MutableSparseMatrixConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); + function_requires< Mutable_SparseMatrixConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); } { typedef compressed_matrix container_model; - SparseMatrixConcept::constraints (); - MutableSparseMatrixConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); + function_requires< Mutable_SparseMatrixConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); } { typedef coordinate_matrix container_model; - SparseMatrixConcept::constraints (); - MutableSparseMatrixConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); + function_requires< Mutable_SparseMatrixConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); } { typedef generalized_vector_of_vector > > container_model; - SparseMatrixConcept::constraints (); - MutableSparseMatrixConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); - IndexedBidirectional2DIteratorConcept::constraints (); - MutableIndexedBidirectional2DIteratorConcept::constraints (); + function_requires< Mutable_SparseMatrixConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); + function_requires< IndexedBidirectional2DIteratorConcept >(); + function_requires< Mutable_IndexedBidirectional2DIteratorConcept >(); } #endif // Scalar Expressions #if defined (INTERNAL_EXPRESSION) || defined (INTERNAL_VECTOR_EXPRESSION) - ScalarExpressionConcept >::constraints (); - ScalarExpressionConcept >::constraints (); + function_requires< ScalarExpressionConcept > >(); + function_requires< ScalarExpressionConcept > >(); // Vector Expressions - VectorExpressionConcept > >::constraints (); - MutableVectorExpressionConcept > >::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept >::const_reverse_iterator>::constraints (); - MutableIndexedRandomAccess1DIteratorConcept >::reverse_iterator>::constraints (); + { + typedef vector_reference > expression_model; + function_requires< VectorExpressionConcept >(); + function_requires< Mutable_VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept, scalar_identity > >::constraints (); - IndexedRandomAccess1DIteratorConcept, scalar_identity >::const_iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept, scalar_identity >::const_reverse_iterator>::constraints (); + { + typedef vector_unary, scalar_identity > expression_model; + function_requires< VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept, vector, scalar_plus > >::constraints (); - IndexedRandomAccess1DIteratorConcept, vector, scalar_plus >::const_iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept, vector, scalar_plus >::const_reverse_iterator>::constraints (); + { + typedef vector_binary, vector, scalar_plus > expression_model; + function_requires< VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept, scalar_multiplies > >::constraints (); - IndexedRandomAccess1DIteratorConcept, scalar_multiplies >::const_iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept, scalar_multiplies >::const_reverse_iterator>::constraints (); + { + typedef vector_binary_scalar1, scalar_multiplies > expression_model; + function_requires< VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept, scalar_value, scalar_multiplies > >::constraints (); - IndexedRandomAccess1DIteratorConcept, scalar_value, scalar_multiplies >::const_iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept, scalar_value, scalar_multiplies >::const_reverse_iterator>::constraints (); + { + typedef vector_binary_scalar2, scalar_value, scalar_multiplies > expression_model; + function_requires< VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept, vector, scalar_multiplies > >::constraints (); - IndexedRandomAccess1DIteratorConcept, vector, scalar_multiplies >::const_iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept, vector, scalar_multiplies >::const_reverse_iterator>::constraints (); + { + typedef vector_binary_scalar1, vector, scalar_multiplies > expression_model; + function_requires< VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept, scalar_value, scalar_multiplies > >::constraints (); - IndexedRandomAccess1DIteratorConcept, scalar_value, scalar_multiplies >::const_iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept, scalar_value, scalar_multiplies >::const_reverse_iterator>::constraints (); + { + typedef vector_binary_scalar2, scalar_value, scalar_multiplies > expression_model; + function_requires< VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + } - ScalarExpressionConcept, vector_sum > >::constraints (); - ScalarExpressionConcept, vector_norm_1 > >::constraints (); - ScalarExpressionConcept, vector_norm_2 > >::constraints (); - ScalarExpressionConcept, vector_norm_inf > >::constraints (); + function_requires< ScalarExpressionConcept, vector_sum > > >(); + function_requires< ScalarExpressionConcept, vector_norm_1 > > >(); + function_requires< ScalarExpressionConcept, vector_norm_2 > > >(); + function_requires< ScalarExpressionConcept, vector_norm_inf > > >(); - ScalarExpressionConcept, vector, vector_inner_prod > >::constraints (); + function_requires< ScalarExpressionConcept, vector, vector_inner_prod > > >(); #endif // Matrix Expressions #if defined (INTERNAL_EXPRESSION) || defined (INTERNAL_MATRIX_EXPRESSION) - MatrixExpressionConcept > >::constraints (); - MutableMatrixExpressionConcept > >::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_iterator1, - matrix_reference >::const_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::iterator1, - matrix_reference >::iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept >::const_reverse_iterator1, - matrix_reference >::const_reverse_iterator2>::constraints (); - MutableIndexedRandomAccess2DIteratorConcept >::reverse_iterator1, - matrix_reference >::reverse_iterator2>::constraints (); + { + typedef matrix_reference > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< Mutable_MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< Mutable_IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept, vector, scalar_multiplies > >::constraints (); - IndexedRandomAccess2DIteratorConcept, vector, scalar_multiplies >::const_iterator1, - vector_matrix_binary, vector, scalar_multiplies >::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept, vector, scalar_multiplies >::const_reverse_iterator1, - vector_matrix_binary, vector, scalar_multiplies >::const_reverse_iterator2>::constraints (); + { + typedef vector_matrix_binary, vector, scalar_multiplies > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept, scalar_identity > >::constraints (); - IndexedRandomAccess2DIteratorConcept, scalar_identity >::const_iterator1, - matrix_unary1, scalar_identity >::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept, scalar_identity >::const_reverse_iterator1, - matrix_unary1, scalar_identity >::const_reverse_iterator2>::constraints (); + { + typedef matrix_unary1, scalar_identity > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept, scalar_identity > >::constraints (); - IndexedRandomAccess2DIteratorConcept, scalar_identity >::const_iterator1, - matrix_unary2, scalar_identity >::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept, scalar_identity >::const_reverse_iterator1, - matrix_unary2, scalar_identity >::const_reverse_iterator2>::constraints (); + { + typedef matrix_unary2, scalar_identity > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept, matrix, scalar_plus > >::constraints (); - IndexedRandomAccess2DIteratorConcept, matrix, scalar_plus >::const_iterator1, - matrix_binary, matrix, scalar_plus >::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept, matrix, scalar_plus >::const_reverse_iterator1, - matrix_binary, matrix, scalar_plus >::const_reverse_iterator2>::constraints (); + { + typedef matrix_binary, matrix, scalar_plus > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept, scalar_multiplies > >::constraints (); - IndexedRandomAccess2DIteratorConcept, scalar_multiplies >::const_iterator1, - matrix_binary_scalar1, scalar_multiplies >::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept, scalar_multiplies >::const_reverse_iterator1, - matrix_binary_scalar1, scalar_multiplies >::const_reverse_iterator2>::constraints (); + { + typedef matrix_binary_scalar1, scalar_multiplies > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept, T, scalar_multiplies > >::constraints (); - IndexedRandomAccess2DIteratorConcept, T, scalar_multiplies >::const_iterator1, - matrix_binary_scalar2, T, scalar_multiplies >::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept, T, scalar_multiplies >::const_reverse_iterator1, - matrix_binary_scalar2, T, scalar_multiplies >::const_reverse_iterator2>::constraints (); + { + typedef matrix_binary_scalar2, T, scalar_multiplies > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept, matrix, scalar_multiplies > >::constraints (); - IndexedRandomAccess2DIteratorConcept, matrix, scalar_multiplies >::const_iterator1, - matrix_binary_scalar1, matrix, scalar_multiplies >::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept, matrix, scalar_multiplies >::const_reverse_iterator1, - matrix_binary_scalar1, matrix, scalar_multiplies >::const_reverse_iterator2>::constraints (); + { + typedef matrix_binary_scalar1, matrix, scalar_multiplies > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - MatrixExpressionConcept, scalar_value, scalar_multiplies > >::constraints (); - IndexedRandomAccess2DIteratorConcept, scalar_value, scalar_multiplies >::const_iterator1, - matrix_binary_scalar2, scalar_value, scalar_multiplies >::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept, scalar_value, scalar_multiplies >::const_reverse_iterator1, - matrix_binary_scalar2, scalar_value, scalar_multiplies >::const_reverse_iterator2>::constraints (); + { + typedef matrix_binary_scalar2, scalar_value, scalar_multiplies > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - VectorExpressionConcept, vector, matrix_vector_prod1 > >::constraints (); - IndexedRandomAccess1DIteratorConcept, vector, matrix_vector_prod1 >::const_iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept, vector, matrix_vector_prod1 >::const_reverse_iterator>::constraints (); + { + typedef matrix_vector_binary1, vector, matrix_vector_prod1 > expression_model; + function_requires< VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + } - VectorExpressionConcept, matrix, matrix_vector_prod2 > >::constraints (); - IndexedRandomAccess1DIteratorConcept, matrix, matrix_vector_prod2 >::const_iterator>::constraints (); - IndexedRandomAccess1DIteratorConcept, matrix, matrix_vector_prod2 >::const_reverse_iterator>::constraints (); + { + typedef matrix_vector_binary2, matrix, matrix_vector_prod2 > expression_model; + function_requires< VectorExpressionConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + function_requires< IndexedRandomAccess1DIteratorConcept >(); + } - MatrixExpressionConcept, matrix, matrix_matrix_prod > >::constraints (); - IndexedRandomAccess2DIteratorConcept, matrix, matrix_matrix_prod >::const_iterator1, - matrix_matrix_binary, matrix, matrix_matrix_prod >::const_iterator2>::constraints (); - IndexedRandomAccess2DIteratorConcept, matrix, matrix_matrix_prod >::const_reverse_iterator1, - matrix_matrix_binary, matrix, matrix_matrix_prod >::const_reverse_iterator2>::constraints (); + { + typedef matrix_matrix_binary, matrix, matrix_matrix_prod > expression_model; + function_requires< MatrixExpressionConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + function_requires< IndexedRandomAccess2DIteratorConcept >(); + } - ScalarExpressionConcept, matrix_norm_1 > >::constraints (); - ScalarExpressionConcept, matrix_norm_frobenius > >::constraints (); - ScalarExpressionConcept, matrix_norm_inf > >::constraints (); + function_requires< ScalarExpressionConcept, matrix_norm_1 > > >(); + function_requires< ScalarExpressionConcept, matrix_norm_frobenius > > >(); + function_requires< ScalarExpressionConcept, matrix_norm_inf > > >(); #endif #ifdef EXTERNAL - AdditiveAbelianGroupConcept::constraints (); - CommutativeRingWithIdentityConcept::constraints (); - FieldConcept::constraints (); - VectorSpaceConcept >::constraints (); - RingWithIdentityConcept >::constraints (0); - VectorSpaceConcept >::constraints (); - LinearOperatorConcept, matrix >::constraints (); + function_requires< AdditiveAbelianGroupConcept >(); + function_requires< CommutativeRingWithIdentityConcept >(); + function_requires< FieldConcept >(); + function_requires< VectorSpaceConcept > >(); + function_requires< Prod_RingWithIdentityConcept > >(); + function_requires< VectorSpaceConcept > >(); + function_requires< LinearOperatorConcept, matrix > >(); - AdditiveAbelianGroupConcept::constraints (); - CommutativeRingWithIdentityConcept::constraints (); - FieldConcept::constraints (); - VectorSpaceConcept >::constraints (); - RingWithIdentityConcept >::constraints (0); - VectorSpaceConcept >::constraints (); - LinearOperatorConcept, matrix >::constraints (); - - AdditiveAbelianGroupConcept >::constraints (); - CommutativeRingWithIdentityConcept >::constraints (); - FieldConcept >::constraints (); - VectorSpaceConcept, vector > >::constraints (); - RingWithIdentityConcept > >::constraints (0); - VectorSpaceConcept, matrix > >::constraints (); - LinearOperatorConcept, vector >, matrix > >::constraints (); - - AdditiveAbelianGroupConcept >::constraints (); - CommutativeRingWithIdentityConcept >::constraints (); - FieldConcept >::constraints (); - VectorSpaceConcept, vector > >::constraints (); - RingWithIdentityConcept > >::constraints (0); - VectorSpaceConcept, matrix > >::constraints (); - LinearOperatorConcept, vector >, matrix > >::constraints (); + function_requires< AdditiveAbelianGroupConcept > >(); + function_requires< CommutativeRingWithIdentityConcept > >(); + function_requires< FieldConcept > >(); + function_requires< VectorSpaceConcept, vector > > >(); + function_requires< Prod_RingWithIdentityConcept > > >(); + function_requires< VectorSpaceConcept, matrix > > >(); + function_requires< LinearOperatorConcept, vector >, matrix > > >(); #endif } diff --git a/include/boost/numeric/ublas/detail/config.hpp b/include/boost/numeric/ublas/detail/config.hpp index 4c00c9a9..65a03ef2 100644 --- a/include/boost/numeric/ublas/detail/config.hpp +++ b/include/boost/numeric/ublas/detail/config.hpp @@ -20,10 +20,10 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/include/boost/numeric/ublas/fwd.hpp b/include/boost/numeric/ublas/fwd.hpp index a4658cff..57f912c6 100644 --- a/include/boost/numeric/ublas/fwd.hpp +++ b/include/boost/numeric/ublas/fwd.hpp @@ -64,22 +64,28 @@ namespace boost { namespace numeric { namespace ublas { template class matrix_reference; - template + template class vector_range; - template + template class vector_slice; - template > + template > class vector_indirect; - template + template class matrix_row; - template + template class matrix_column; - template + template + class matrix_vector_range; + template + class matrix_vector_slice; + template > + class matrix_vector_indirect; + template class matrix_range; - template + template class matrix_slice; - template > + template > class matrix_indirect; template > diff --git a/include/boost/numeric/ublas/hermitian.hpp b/include/boost/numeric/ublas/hermitian.hpp index def15894..a2afb7fa 100644 --- a/include/boost/numeric/ublas/hermitian.hpp +++ b/include/boost/numeric/ublas/hermitian.hpp @@ -580,6 +580,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -715,6 +719,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return (*this) ().at_element (it1_, it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -855,6 +863,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -990,6 +1002,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return (*this) ().at_element (it1_, it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1647,6 +1663,10 @@ namespace boost { namespace numeric { namespace ublas { return type_traits::conj (*it2_); } } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1812,6 +1832,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return *it1_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2093,6 +2117,10 @@ namespace boost { namespace numeric { namespace ublas { return type_traits::conj (*it2_); } } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2258,6 +2286,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return *it2_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/matrix.hpp b/include/boost/numeric/ublas/matrix.hpp index 41f06edf..2d6a4637 100644 --- a/include/boost/numeric/ublas/matrix.hpp +++ b/include/boost/numeric/ublas/matrix.hpp @@ -386,6 +386,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -524,6 +528,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -665,6 +673,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -803,6 +815,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1336,6 +1352,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1491,6 +1511,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1649,6 +1673,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1804,6 +1832,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2846,6 +2878,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return (*this) () (index1 (), index2 ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2987,6 +3023,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return (*this) () (index1 (), index2 ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3440,6 +3480,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3579,6 +3623,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3720,6 +3768,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3858,6 +3910,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/matrix_expression.hpp b/include/boost/numeric/ublas/matrix_expression.hpp index c37d032c..7ca322e3 100644 --- a/include/boost/numeric/ublas/matrix_expression.hpp +++ b/include/boost/numeric/ublas/matrix_expression.hpp @@ -478,6 +478,10 @@ namespace boost { namespace numeric { namespace ublas { return functor_type::apply (*it1_, *it2_); #endif } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -639,6 +643,10 @@ namespace boost { namespace numeric { namespace ublas { return functor_type::apply (*it1_, *it2_); #endif } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -934,6 +942,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (*it_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1065,6 +1077,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (*it_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1389,6 +1405,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (*it_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1520,6 +1540,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (*it_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2005,6 +2029,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return dereference (iterator_category ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2316,6 +2344,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return dereference (iterator_category ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2645,6 +2677,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2784,6 +2820,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3070,6 +3110,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (*it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3209,6 +3253,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (*it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3565,6 +3613,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return dereference (iterator_category ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -3951,6 +4003,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return dereference (iterator_category ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -4379,6 +4435,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return dereference (iterator_category ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -4601,6 +4661,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return dereference (iterator_category ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/matrix_proxy.hpp b/include/boost/numeric/ublas/matrix_proxy.hpp index c46a6f21..a90163f0 100644 --- a/include/boost/numeric/ublas/matrix_proxy.hpp +++ b/include/boost/numeric/ublas/matrix_proxy.hpp @@ -293,6 +293,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -386,6 +390,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -742,6 +750,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -835,6 +847,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -1190,6 +1206,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -1291,6 +1311,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -1647,6 +1671,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -1748,6 +1776,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -2103,6 +2135,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -2204,6 +2240,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -2596,6 +2636,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2727,6 +2771,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2863,6 +2911,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -2994,6 +3046,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3492,6 +3548,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3627,6 +3687,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3767,6 +3831,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -3902,6 +3970,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -4410,6 +4482,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -4545,6 +4621,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -4685,6 +4765,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -4820,6 +4904,10 @@ namespace boost { namespace numeric { namespace ublas { // FIXME replace find with at_element return (*this) ().data_ (*it1_, *it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/storage.hpp b/include/boost/numeric/ublas/storage.hpp index 9c638451..fdb8d6a2 100644 --- a/include/boost/numeric/ublas/storage.hpp +++ b/include/boost/numeric/ublas/storage.hpp @@ -177,6 +177,17 @@ namespace boost { namespace numeric { namespace ublas { resize_internal (size, init, true); } + // Random Access Container + BOOST_UBLAS_INLINE + size_type max_size () const { + return ALLOC ().max_size(); + } + + BOOST_UBLAS_INLINE + bool empty () const { + return size_ == 0; + } + BOOST_UBLAS_INLINE size_type size () const { return size_; @@ -335,6 +346,17 @@ namespace boost { namespace numeric { namespace ublas { size_ = size; } + // Random Access Container + BOOST_UBLAS_INLINE + size_type max_size () const { + return ALLOC ().max_size(); + } + + BOOST_UBLAS_INLINE + bool empty () const { + return size_ == 0; + } + BOOST_UBLAS_INLINE size_type size () const { return size_; @@ -486,6 +508,17 @@ namespace boost { namespace numeric { namespace ublas { data_ = data; } + // Random Access Container + BOOST_UBLAS_INLINE + size_type max_size () const { + return std::numeric_limits::max (); + } + + BOOST_UBLAS_INLINE + bool empty () const { + return size_ == 0; + } + BOOST_UBLAS_INLINE size_type size () const { return size_; @@ -614,13 +647,17 @@ namespace boost { namespace numeric { namespace ublas { return size_; } - // Assignment - basic_range operator=( basic_range const& r ) { - start_ = r.start_ ; - size_ = r.size_ ; - return *this ; + // Random Access Container + BOOST_UBLAS_INLINE + size_type max_size () const { + return size_; } - + + BOOST_UBLAS_INLINE + bool empty () const { + return size_ == 0; + } + // Element access BOOST_UBLAS_INLINE const_reference operator () (size_type i) const { @@ -708,6 +745,11 @@ namespace boost { namespace numeric { namespace ublas { return it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } + // Index BOOST_UBLAS_INLINE size_type index () const { @@ -819,6 +861,17 @@ namespace boost { namespace numeric { namespace ublas { return size_; } + // Random Access Container + BOOST_UBLAS_INLINE + size_type max_size () const { + return size_; + } + + BOOST_UBLAS_INLINE + bool empty () const { + return size_ == 0; + } + // Element access BOOST_UBLAS_INLINE const_reference operator () (size_type i) const { @@ -912,6 +965,11 @@ namespace boost { namespace numeric { namespace ublas { return (*this) ().start () + it_* (*this) ().stride (); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } + // Index BOOST_UBLAS_INLINE size_type index () const { @@ -1033,6 +1091,17 @@ namespace boost { namespace numeric { namespace ublas { return data_; } + // Random Access Container + BOOST_UBLAS_INLINE + size_type max_size () const { + return size_; + } + + BOOST_UBLAS_INLINE + bool empty () const { + return data_.size () == 0; + } + // Element access BOOST_UBLAS_INLINE const_reference operator () (size_type i) const { @@ -1157,6 +1226,11 @@ namespace boost { namespace numeric { namespace ublas { return (*this) () (it_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } + // Index BOOST_UBLAS_INLINE size_type index () const { diff --git a/include/boost/numeric/ublas/storage_sparse.hpp b/include/boost/numeric/ublas/storage_sparse.hpp index 2603570f..f4867f48 100644 --- a/include/boost/numeric/ublas/storage_sparse.hpp +++ b/include/boost/numeric/ublas/storage_sparse.hpp @@ -299,6 +299,7 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (size_ <= capacity_, internal_logic ()); } + // Random Access Container BOOST_UBLAS_INLINE size_type size () const { return size_; @@ -307,7 +308,16 @@ namespace boost { namespace numeric { namespace ublas { size_type capacity () const { return capacity_; } - + BOOST_UBLAS_INLINE + size_type max_size () const { + return 0; //TODO + } + + BOOST_UBLAS_INLINE + bool empty () const { + return size_ == 0; + } + // Element access BOOST_UBLAS_INLINE data_reference operator [] (key_type i) { diff --git a/include/boost/numeric/ublas/symmetric.hpp b/include/boost/numeric/ublas/symmetric.hpp index 663fc0ef..b6e16cf0 100644 --- a/include/boost/numeric/ublas/symmetric.hpp +++ b/include/boost/numeric/ublas/symmetric.hpp @@ -358,6 +358,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -492,6 +496,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -632,6 +640,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -767,6 +779,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1356,6 +1372,10 @@ namespace boost { namespace numeric { namespace ublas { return *it2_; } } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1521,6 +1541,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return *it1_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1794,6 +1818,10 @@ namespace boost { namespace numeric { namespace ublas { return *it2_; } } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1959,6 +1987,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return *it2_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/triangular.hpp b/include/boost/numeric/ublas/triangular.hpp index 75d96c79..49dc82fa 100644 --- a/include/boost/numeric/ublas/triangular.hpp +++ b/include/boost/numeric/ublas/triangular.hpp @@ -347,6 +347,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -482,6 +486,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -622,6 +630,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -757,6 +769,10 @@ namespace boost { namespace numeric { namespace ublas { reference operator * () const { return (*this) () (it1_, it2_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1200,6 +1216,10 @@ namespace boost { namespace numeric { namespace ublas { else return (*this) () (i, j); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1338,6 +1358,10 @@ namespace boost { namespace numeric { namespace ublas { else return (*this) () (i, j); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1481,6 +1505,10 @@ namespace boost { namespace numeric { namespace ublas { else return (*this) () (i, j); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE @@ -1619,6 +1647,10 @@ namespace boost { namespace numeric { namespace ublas { else return (*this) () (i, j); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/vector.hpp b/include/boost/numeric/ublas/vector.hpp index 477289ff..b230139c 100644 --- a/include/boost/numeric/ublas/vector.hpp +++ b/include/boost/numeric/ublas/vector.hpp @@ -30,8 +30,6 @@ namespace boost { namespace numeric { namespace ublas { class vector: public vector_container > { - typedef T *pointer; - typedef const T *const_pointer; typedef vector self_type; public: #ifdef BOOST_UBLAS_ENABLE_PROXY_SHORTCUTS @@ -42,6 +40,8 @@ namespace boost { namespace numeric { namespace ublas { typedef T value_type; typedef typename type_traits::const_reference const_reference; typedef T &reference; + typedef T *pointer; + typedef const T *const_pointer; typedef A array_type; typedef const vector_reference const_closure_type; typedef vector_reference closure_type; @@ -74,6 +74,16 @@ namespace boost { namespace numeric { namespace ublas { vector_assign (*this, ae); } + // Random Access Container + BOOST_UBLAS_INLINE + size_type max_size () const { + return data_.max_size (); + } + + BOOST_UBLAS_INLINE + bool empty () const { + return data_.size () == 0; + } // Accessors BOOST_UBLAS_INLINE size_type size () const { @@ -325,6 +335,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_, bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(it_ + n); + } // Index BOOST_UBLAS_INLINE @@ -422,6 +436,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_ , bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(it_ + n); + } // Index BOOST_UBLAS_INLINE @@ -1112,6 +1130,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (it_ < (*this) ().size (), bad_index ()); return (*this) () (index ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -1478,6 +1500,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_, bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(it_ + n); + } // Index BOOST_UBLAS_INLINE @@ -1575,6 +1601,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_, bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(it_ + n); + } // Index BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/vector_expression.hpp b/include/boost/numeric/ublas/vector_expression.hpp index 3774ca88..ab7db2d6 100644 --- a/include/boost/numeric/ublas/vector_expression.hpp +++ b/include/boost/numeric/ublas/vector_expression.hpp @@ -385,6 +385,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (*it_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -822,6 +826,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return dereference (iterator_category ()); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -1085,6 +1093,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (it1_, *it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -1306,6 +1318,10 @@ namespace boost { namespace numeric { namespace ublas { const_reference operator * () const { return functor_type::apply (*it1_, it2_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/vector_proxy.hpp b/include/boost/numeric/ublas/vector_proxy.hpp index 5a64d32a..f669917b 100644 --- a/include/boost/numeric/ublas/vector_proxy.hpp +++ b/include/boost/numeric/ublas/vector_proxy.hpp @@ -310,6 +310,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -403,6 +407,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return *it_; } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -810,6 +818,10 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return (*this) ().data_ (*it_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -904,6 +916,11 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return (*this) ().data_ (*it_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } + // Index BOOST_UBLAS_INLINE @@ -1326,6 +1343,10 @@ return true; BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return (*this) ().data_ (*it_); } + BOOST_UBLAS_INLINE + const_reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE @@ -1420,6 +1441,10 @@ return true; BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ()); return (*this) ().data_ (*it_); } + BOOST_UBLAS_INLINE + reference operator [] (difference_type n) const { + return *(*this + n); + } // Index BOOST_UBLAS_INLINE