Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2005-03-22 07:20:13


Hallo,

reserve sometimes throws an error that the storage invariants are violatet.
This always happens if the first entry of index1_data has a non zero value
and a non-preserving resize is done. The patch below fixes this.

mfg
Gunter

Index: matrix_sparse.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/numeric/ublas/matrix_sparse.hpp,v
retrieving revision 1.50.2.15
diff -u -p -r1.50.2.15 matrix_sparse.hpp
--- matrix_sparse.hpp 29 Oct 2004 12:36:43 -0000 1.50.2.15
+++ matrix_sparse.hpp 22 Mar 2005 12:15:22 -0000
@@ -2640,6 +2667,7 @@ namespace boost { namespace numeric { na
                 value_data_.resize (capacity_);
                 filled1_ = 1;
                 filled2_ = 0;
+ index1_data_ [filled1_ - 1] = k_based (filled2_);
             }
             storage_invariants ();
        }