2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-21 15:32:12 +00:00

* boost/numeric/ublas/vector_sparse.hpp: add ifdef BOOST_UBLAS_COO_ALWAYS_DO_FULL_SORT to coordinate_vector::sort() (similar to coordinate_matrix::sort()), see #7363

* libs/numeric/ublas/test/Jamfile.v2: use COO_ALWAYS_DO_FULL_SORT in test_assign because we do not want to test performance here

svn path=/trunk/libs/numeric/ublas/; revision=80591
This commit is contained in:
Gunter Winkler
2012-09-18 21:40:05 +00:00
parent 3d603da030
commit f87cebe293
2 changed files with 7 additions and 0 deletions

View File

@@ -1807,10 +1807,15 @@ namespace boost { namespace numeric { namespace ublas {
if (! sorted_ && filled_ > 0) {
typedef index_pair_array<index_array_type, value_array_type> array_pair;
array_pair ipa (filled_, index_data_, value_data_);
#ifndef BOOST_UBLAS_COO_ALWAYS_DO_FULL_SORT
const typename array_pair::iterator iunsorted = ipa.begin () + sorted_filled_;
// sort new elements and merge
std::sort (iunsorted, ipa.end ());
std::inplace_merge (ipa.begin (), iunsorted, ipa.end ());
#else
const typename array_pair::iterator iunsorted = ipa.begin ();
std::sort (iunsorted, ipa.end ());
#endif
// sum duplicates with += and remove
size_type filled = 0;

View File

@@ -170,6 +170,8 @@ test-suite numeric/uBLAS
[ run test_complex_norms.cpp
]
[ run test_assignment.cpp
: : : <define>BOOST_UBLAS_COO_ALWAYS_DO_FULL_SORT
: :
]
[ run test_triangular.cpp
]