24#if !defined(LOOS_SORTING_HPP)
25#define LOOS_SORTING_HPP
32#include <loos_defs.hpp>
41 bool operator()(
const uint i,
const uint j)
const {
42 return(A_[i] < A_[j]);
54 bool operator()(
const uint i,
const uint j)
const {
55 return(A_[i] > A_[j]);
70 template<
typename T,
class SortPredicate>
72 std::vector<uint> indices(A.size());
74 for (uint i = 0; i<A.size(); ++i)
77 std::sort(indices.begin(), indices.end(), SortPredicate(A));
Policy class for sorting in ascending sequence.
Definition sorting.hpp:38
Policy class for sorting in descending sequence.
Definition sorting.hpp:51
Namespace for most things not already encapsulated within a class.
Definition version.cpp:3
std::vector< uint > sortedIndex(const T &A)
Definition sorting.hpp:71