19 std::sort(
v2.begin(),
v2.end());
20 std::cout <<
"Sort vector " <<
v1 <<
": " <<
v2 << std::endl;
25 std::cout <<
"Sort vector " <<
v1 <<
": " <<
v3 << std::endl;
29 std::cout <<
"Reverse vector " <<
v1 <<
": " <<
v4 << std::endl;
34 std::cout <<
"Indices that sort the vector " <<
v1 <<
": " << i << std::endl;
37 auto v6 =
Take(v5, i);
38 std::cout <<
"Sort vector " << v5 <<
" respective to the previously"
39 <<
" determined indices: " << v6 << std::endl;
44 std::cout <<
"Take the two first and last elements of vector " <<
v1
45 <<
": " << v7 <<
", " << v8 << std::endl;
50 std::cout <<
"Sort the vector " <<
v1 <<
", take the two last elements and "
51 <<
"reverse the selection: " << v9 << std::endl;
RVec< T > Reverse(const RVec< T > &v)
Return copy of reversed vector.
RVec< T > Take(const RVec< T > &v, const RVec< typename RVec< T >::size_type > &i)
Return elements of a vector at given indices.
RVec< typename RVec< T >::size_type > Argsort(const RVec< T > &v)
Return an RVec of indices that sort the input RVec.
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Sort the n elements of the array a of generic templated type Element.