diff options
Diffstat (limited to 'boost/numeric/ublas/vector_expression.hpp')
-rw-r--r-- | boost/numeric/ublas/vector_expression.hpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/boost/numeric/ublas/vector_expression.hpp b/boost/numeric/ublas/vector_expression.hpp index a5cf3104ee..aebb403b65 100644 --- a/boost/numeric/ublas/vector_expression.hpp +++ b/boost/numeric/ublas/vector_expression.hpp @@ -188,9 +188,17 @@ namespace boost { namespace numeric { namespace ublas { return expression ().begin (); } BOOST_UBLAS_INLINE + const_iterator cbegin () const { + return begin (); + } + BOOST_UBLAS_INLINE const_iterator end () const { return expression ().end (); } + BOOST_UBLAS_INLINE + const_iterator cend () const { + return end (); + } BOOST_UBLAS_INLINE iterator begin () { @@ -210,10 +218,19 @@ namespace boost { namespace numeric { namespace ublas { return const_reverse_iterator (end ()); } BOOST_UBLAS_INLINE + const_reverse_iterator crbegin () const { + return rbegin (); + } + BOOST_UBLAS_INLINE const_reverse_iterator rend () const { return const_reverse_iterator (begin ()); } BOOST_UBLAS_INLINE + const_reverse_iterator crend () const { + return rend (); + } + + BOOST_UBLAS_INLINE reverse_iterator rbegin () { return reverse_iterator (end ()); } @@ -422,9 +439,17 @@ namespace boost { namespace numeric { namespace ublas { return find (0); } BOOST_UBLAS_INLINE + const_iterator cbegin () const { + return begin (); + } + BOOST_UBLAS_INLINE const_iterator end () const { return find (size ()); } + BOOST_UBLAS_INLINE + const_iterator cend () const { + return end (); + } // Reverse iterator typedef reverse_iterator_base<const_iterator> const_reverse_iterator; @@ -434,9 +459,17 @@ namespace boost { namespace numeric { namespace ublas { return const_reverse_iterator (end ()); } BOOST_UBLAS_INLINE + const_reverse_iterator crbegin () const { + return rbegin (); + } + BOOST_UBLAS_INLINE const_reverse_iterator rend () const { return const_reverse_iterator (begin ()); } + BOOST_UBLAS_INLINE + const_reverse_iterator crend () const { + return rend (); + } private: expression_closure_type e_; @@ -871,9 +904,17 @@ namespace boost { namespace numeric { namespace ublas { return find (0); } BOOST_UBLAS_INLINE + const_iterator cbegin () const { + return begin (); + } + BOOST_UBLAS_INLINE const_iterator end () const { return find (size ()); } + BOOST_UBLAS_INLINE + const_iterator cend () const { + return end (); + } // Reverse iterator typedef reverse_iterator_base<const_iterator> const_reverse_iterator; @@ -883,9 +924,17 @@ namespace boost { namespace numeric { namespace ublas { return const_reverse_iterator (end ()); } BOOST_UBLAS_INLINE + const_reverse_iterator crbegin () const { + return rbegin (); + } + BOOST_UBLAS_INLINE const_reverse_iterator rend () const { return const_reverse_iterator (begin ()); } + BOOST_UBLAS_INLINE + const_reverse_iterator crend () const { + return rend (); + } private: expression1_closure_type e1_; @@ -1136,9 +1185,17 @@ namespace boost { namespace numeric { namespace ublas { return find (0); } BOOST_UBLAS_INLINE + const_iterator cbegin () const { + return begin (); + } + BOOST_UBLAS_INLINE const_iterator end () const { return find (size ()); } + BOOST_UBLAS_INLINE + const_iterator cend () const { + return end (); + } // Reverse iterator typedef reverse_iterator_base<const_iterator> const_reverse_iterator; @@ -1148,9 +1205,17 @@ namespace boost { namespace numeric { namespace ublas { return const_reverse_iterator (end ()); } BOOST_UBLAS_INLINE + const_reverse_iterator crbegin () const { + return rbegin (); + } + BOOST_UBLAS_INLINE const_reverse_iterator rend () const { return const_reverse_iterator (begin ()); } + BOOST_UBLAS_INLINE + const_reverse_iterator crend () const { + return end (); + } private: expression1_closure_type e1_; @@ -1363,9 +1428,17 @@ namespace boost { namespace numeric { namespace ublas { return find (0); } BOOST_UBLAS_INLINE + const_iterator cbegin () const { + return begin (); + } + BOOST_UBLAS_INLINE const_iterator end () const { return find (size ()); } + BOOST_UBLAS_INLINE + const_iterator cend () const { + return end (); + } // Reverse iterator typedef reverse_iterator_base<const_iterator> const_reverse_iterator; @@ -1375,9 +1448,17 @@ namespace boost { namespace numeric { namespace ublas { return const_reverse_iterator (end ()); } BOOST_UBLAS_INLINE + const_reverse_iterator crbegin () const { + return rbegin (); + } + BOOST_UBLAS_INLINE const_reverse_iterator rend () const { return const_reverse_iterator (begin ()); } + BOOST_UBLAS_INLINE + const_reverse_iterator crend () const { + return rend (); + } private: expression1_closure_type e1_; @@ -1409,7 +1490,9 @@ namespace boost { namespace numeric { namespace ublas { // (v / t) [i] = v [i] / t template<class E1, class T2> BOOST_UBLAS_INLINE + typename enable_if< is_convertible<T2, typename E1::value_type >, typename vector_binary_scalar2_traits<E1, const T2, scalar_divides<typename E1::value_type, T2> >::result_type + >::type operator / (const vector_expression<E1> &e1, const T2 &e2) { typedef typename vector_binary_scalar2_traits<E1, const T2, scalar_divides<typename E1::value_type, T2> >::expression_type expression_type; |