From 4fb96b6af7d33a3afc2ba3ce12b7d648cd445b2e Mon Sep 17 00:00:00 2001 From: Michael Stevens Date: Fri, 27 Aug 2004 13:00:00 +0000 Subject: [PATCH] removed vector::size_ use data_.size () instead svn path=/trunk/boost/boost/numeric/ublas/; revision=24784 --- include/boost/numeric/ublas/vector.hpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/include/boost/numeric/ublas/vector.hpp b/include/boost/numeric/ublas/vector.hpp index d767bd8f..aa9e1e55 100644 --- a/include/boost/numeric/ublas/vector.hpp +++ b/include/boost/numeric/ublas/vector.hpp @@ -107,33 +107,33 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE vector (): vector_expression (), - size_ (0), data_ (0) {} + data_ (0) {} explicit BOOST_UBLAS_INLINE vector (size_type size): vector_expression (), - size_ (size), data_ (0) { + data_ (0) { resize (size); } BOOST_UBLAS_INLINE vector (size_type size, const array_type &data): vector_expression (), - size_ (size), data_ (data) {} + data_ (data) {} BOOST_UBLAS_INLINE vector (const vector &v): vector_expression (), - size_ (v.size_), data_ (v.data_) {} + data_ (v.data_) {} template BOOST_UBLAS_INLINE vector (const vector_expression &ae): vector_expression (), - size_ (ae ().size ()), data_ (size_) { + data_ (ae ().size ()) { vector_assign (scalar_assign (), *this, ae); } // Accessors BOOST_UBLAS_INLINE size_type size () const { - return size_; + return data_.size (); } BOOST_UBLAS_INLINE const_array_type &data () const { @@ -148,7 +148,6 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE void resize (size_type size, bool preserve = true) { detail::resize (data (), size, preserve); - size_ = size; } // Element access @@ -173,7 +172,6 @@ namespace boost { namespace numeric { namespace ublas { // Assignment BOOST_UBLAS_INLINE vector &operator = (const vector &v) { - size_ = v.size_; data () = v.data (); return *this; } @@ -258,7 +256,6 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE void swap (vector &v) { if (this != &v) { - std::swap (size_, v.size_); data ().swap (v.data ()); } } @@ -429,7 +426,7 @@ namespace boost { namespace numeric { namespace ublas { } BOOST_UBLAS_INLINE const_iterator end () const { - return find (size_); + return find (data_.size ()); } #ifndef BOOST_UBLAS_USE_INDEXED_ITERATOR @@ -528,7 +525,7 @@ namespace boost { namespace numeric { namespace ublas { } BOOST_UBLAS_INLINE iterator end () { - return find (size_); + return find (data_.size ()); } // Reverse iterator @@ -564,7 +561,6 @@ namespace boost { namespace numeric { namespace ublas { } private: - size_type size_; array_type data_; };