Boost logo

Ublas :

From: Max Weinberg (max.weinberg_at_[hidden])
Date: 2005-10-07 08:51:00


Hi,
the patch fixes a bug in ref() of matrix_sparse.hpp. I reported this already a
long time ago, but the bug is still in the current cvs head. So this time I
tried to create a patch. I hope this is useful.
Best, Max

@@ -143,9 +143,9 @@
         // Conversion to reference - may be invalidated
         BOOST_UBLAS_INLINE
         value_type& ref () const {
- pointer p = (*this) ().find_element (i_, i_);
+ pointer p = (*this) ().find_element (i_, j_);
             if (!p)
- (*this) ().insert_element (i_, j_, value_type/*zero*/());
+ p=&(*this) ().insert_element (i_, j_, value_type/*zero*/());
             return *p;
         }