Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56163 - trunk/boost/numeric/ublas
From: guwi17_at_[hidden]
Date: 2009-09-12 19:07:47


Author: guwi17
Date: 2009-09-12 19:07:47 EDT (Sat, 12 Sep 2009)
New Revision: 56163
URL: http://svn.boost.org/trac/boost/changeset/56163

Log:
matrix.hpp, identity_matrix:

fix #3293: added assignments to size_common_ on each place where size1 or size2 are changed

Text files modified:
   trunk/boost/numeric/ublas/matrix.hpp | 4 ++++
   1 files changed, 4 insertions(+), 0 deletions(-)

Modified: trunk/boost/numeric/ublas/matrix.hpp
==============================================================================
--- trunk/boost/numeric/ublas/matrix.hpp (original)
+++ trunk/boost/numeric/ublas/matrix.hpp 2009-09-12 19:07:47 EDT (Sat, 12 Sep 2009)
@@ -2446,11 +2446,13 @@
         void resize (size_type size, bool preserve = true) {
             size1_ = size;
             size2_ = size;
+ size_common_ = ((std::min)(size1_, size2_));
         }
         BOOST_UBLAS_INLINE
         void resize (size_type size1, size_type size2, bool /*preserve*/ = true) {
             size1_ = size1;
             size2_ = size2;
+ size_common_ = ((std::min)(size1_, size2_));
         }
 
         // Element access
@@ -2467,6 +2469,7 @@
         identity_matrix &operator = (const identity_matrix &m) {
             size1_ = m.size1_;
             size2_ = m.size2_;
+ size_common_ = m.size_common_;
             return *this;
         }
         BOOST_UBLAS_INLINE
@@ -2481,6 +2484,7 @@
             if (this != &m) {
                 std::swap (size1_, m.size1_);
                 std::swap (size2_, m.size2_);
+ std::swap (size_common_, m.size_common_);
             }
         }
         BOOST_UBLAS_INLINE


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk