Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80487 - in trunk: boost/numeric/ublas libs/numeric/ublas/test
From: guwi17_at_[hidden]
Date: 2012-09-10 17:38:12


Author: guwi17
Date: 2012-09-10 17:38:11 EDT (Mon, 10 Sep 2012)
New Revision: 80487
URL: http://svn.boost.org/trac/boost/changeset/80487

Log:
* boost/numeric/ublas/matrix_sparse.hpp: see #7363, add new define BOOST_UBLAS_COO_ALWAYS_DO_FULL_SORT in order to force a full sort instead of partial sort + inplace merge

* libs/numeric/ublas/test/Jamfile.v2: add test to see effect of new define

Text files modified:
   trunk/boost/numeric/ublas/matrix_sparse.hpp | 6 +++++-
   trunk/libs/numeric/ublas/test/Jamfile.v2 | 7 +++++++
   2 files changed, 12 insertions(+), 1 deletions(-)

Modified: trunk/boost/numeric/ublas/matrix_sparse.hpp
==============================================================================
--- trunk/boost/numeric/ublas/matrix_sparse.hpp (original)
+++ trunk/boost/numeric/ublas/matrix_sparse.hpp 2012-09-10 17:38:11 EDT (Mon, 10 Sep 2012)
@@ -4397,11 +4397,15 @@
             if (! sorted_ && filled_ > 0) {
                 typedef index_triple_array<index_array_type, index_array_type, value_array_type> array_triple;
                 array_triple ita (filled_, index1_data_, index2_data_, value_data_);
+#ifndef BOOST_UBLAS_COO_ALWAYS_DO_FULL_SORT
                 const typename array_triple::iterator iunsorted = ita.begin () + sorted_filled_;
                 // sort new elements and merge
                 std::sort (iunsorted, ita.end ());
                 std::inplace_merge (ita.begin (), iunsorted, ita.end ());
-
+#else
+ const typename array_triple::iterator iunsorted = ita.begin ();
+ std::sort (iunsorted, ita.end ());
+#endif
                 // sum duplicates with += and remove
                 array_size_type filled = 0;
                 for (array_size_type i = 1; i < filled_; ++ i) {

Modified: trunk/libs/numeric/ublas/test/Jamfile.v2
==============================================================================
--- trunk/libs/numeric/ublas/test/Jamfile.v2 (original)
+++ trunk/libs/numeric/ublas/test/Jamfile.v2 2012-09-10 17:38:11 EDT (Mon, 10 Sep 2012)
@@ -152,6 +152,13 @@
       ]
       [ run test_coordinate_matrix_sort.cpp
       ]
+ [ run test_coordinate_matrix_sort.cpp
+ :
+ :
+ : <define>BOOST_UBLAS_COO_ALWAYS_DO_FULL_SORT
+ : test_coordinate_matrix_always_do_full_sort
+ :
+ ]
       [ run test_complex_norms.cpp
       ]
           [ run test_assignment.cpp


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk