1 #ifndef _theplu_yat_utility_sort_index_
2 #define _theplu_yat_utility_sort_index_
25 #include "StrideIterator.h"
27 #include <boost/concept_check.hpp>
49 template<
typename ForwardIterator>
50 void sort_index(ForwardIterator first, ForwardIterator last,
60 StrideIterator<double*> last,
68 void sort_index(StrideIterator<const double*> first,
69 StrideIterator<const double*> last,
77 void sort_index(std::vector<double>::iterator first,
78 std::vector<double>::iterator last,
86 void sort_index(std::vector<double>::const_iterator first,
87 std::vector<double>::const_iterator last,
93 template<
typename ForwardIterator>
94 void sort_index(ForwardIterator first, ForwardIterator last,
95 std::vector<size_t>& result)
97 BOOST_CONCEPT_ASSERT((boost::ForwardIterator<ForwardIterator>));
98 std::vector<double> vec;
99 vec.reserve(std::distance(first, last));
100 std::copy(first, last,
101 std::back_insert_iterator<std::vector<double> >(vec));