diff --git a/include/boost/numeric/ublas/matrix.hpp b/include/boost/numeric/ublas/matrix.hpp index 9dcf52e3..505726e6 100644 --- a/include/boost/numeric/ublas/matrix.hpp +++ b/include/boost/numeric/ublas/matrix.hpp @@ -2466,11 +2466,13 @@ namespace boost { namespace numeric { namespace ublas { 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 @@ -2487,6 +2489,7 @@ namespace boost { namespace numeric { namespace ublas { identity_matrix &operator = (const identity_matrix &m) { size1_ = m.size1_; size2_ = m.size2_; + size_common_ = m.size_common_; return *this; } BOOST_UBLAS_INLINE @@ -2501,6 +2504,7 @@ namespace boost { namespace numeric { namespace ublas { if (this != &m) { std::swap (size1_, m.size1_); std::swap (size2_, m.size2_); + std::swap (size_common_, m.size_common_); } } BOOST_UBLAS_INLINE