2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-19 14:52:17 +00:00

FIX coordinate_matrix::set_filled() , thanks Georg Baum

[SVN r29885]
This commit is contained in:
Michael Stevens
2005-07-04 08:56:28 +00:00
parent b479889772
commit c40aaba9d1

View File

@@ -3920,9 +3920,13 @@ namespace boost { namespace numeric { namespace ublas {
}
BOOST_UBLAS_INLINE
void set_filled (const array_size_type &filled) {
// Make sure that storage_invariants() succeeds
if (sorted_ && filled < filled_)
sorted_filled_ = filled_;
else
sorted_ = (sorted_filled_ == filled_);
filled_ = filled;
storage_invariants ();
return filled_;
}
BOOST_UBLAS_INLINE
index_array_type &index1_data () {
@@ -4186,8 +4190,8 @@ namespace boost { namespace numeric { namespace ublas {
std::inplace_merge (ita.begin (), iunsorted, ita.end ());
// sum duplicates with += and remove
size_type filled = 0;
for (size_type i = 1; i < filled_; ++ i) {
array_size_type filled = 0;
for (array_size_type i = 1; i < filled_; ++ i) {
if (index1_data_ [filled] != index1_data_ [i] ||
index2_data_ [filled] != index2_data_ [i]) {
++ filled;