diff options
Diffstat (limited to 'boost/sort/parallel_stable_sort/parallel_stable_sort.hpp')
-rw-r--r-- | boost/sort/parallel_stable_sort/parallel_stable_sort.hpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/boost/sort/parallel_stable_sort/parallel_stable_sort.hpp b/boost/sort/parallel_stable_sort/parallel_stable_sort.hpp index 9df7dffd2a..3dc92f21dd 100644 --- a/boost/sort/parallel_stable_sort/parallel_stable_sort.hpp +++ b/boost/sort/parallel_stable_sort/parallel_stable_sort.hpp @@ -218,7 +218,7 @@ using bsc::merge_half; // //----------------------------------------------------------------------------- // function : parallel_stable_sort -/// @brief : parallel stable sort algorithm. +/// @brief : parallel stable sort with 2 parameters /// /// @param first : iterator to the first element of the range to sort /// @param last : iterator after the last element to the range to sort @@ -232,7 +232,8 @@ void parallel_stable_sort(Iter_t first, Iter_t last) // //----------------------------------------------------------------------------- // function : parallel_stable_sort -/// @brief parallel stable sort. +/// @brief parallel stable sort with 3 parameters. The third is the number +/// of threads /// /// @param first : iterator to the first element of the range to sort /// @param last : iterator after the last element to the range to sort @@ -248,7 +249,8 @@ void parallel_stable_sort(Iter_t first, Iter_t last, uint32_t nthread) // //----------------------------------------------------------------------------- // function : parallel_stable_sort -/// @brief : parallel stable sort. +/// @brief : parallel stable sort with 3 parameters. The thisrd is the +/// comparison object /// /// @param first : iterator to the first element of the range to sort /// @param last : iterator after the last element to the range to sort @@ -261,6 +263,26 @@ void parallel_stable_sort(Iter_t first, Iter_t last, Compare comp) { stable_detail::parallel_stable_sort<Iter_t, Compare>(first, last, comp); }; + +// +//----------------------------------------------------------------------------- +// function : parallel_stable_sort +/// @brief : parallel stable sort with 3 parameters. +/// +/// @param first : iterator to the first element of the range to sort +/// @param last : iterator after the last element to the range to sort +/// @param comp : object for to compare two elements pointed by Iter_t +/// iterators +/// @param nthread : Number of threads to use in the process. When this value +/// is lower than 2, the sorting is done with 1 thread +//----------------------------------------------------------------------------- +template<class Iter_t, class Compare> +void parallel_stable_sort (Iter_t first, Iter_t last, Compare comp, + uint32_t nthread) +{ + stable_detail::parallel_stable_sort<Iter_t, Compare> + (first, last, comp, nthread); +} // //**************************************************************************** };// End namespace sort |