17 std::vector<unsigned> order(to_sort.size());
19 std::iota(order.begin(), order.end(), ind++);
21 std::sort(order.begin(), order.end(), [&](
int i,
int j) {
return to_sort[i] < to_sort[
j]; });
23 std::sort(order.begin(), order.end(), [&](
int i,
int j) {
return to_sort[i] > to_sort[
j]; });
Utility to produce sorted information.
std::vector< unsigned > sortedIndices(const std::vector< Real > &to_sort, bool ascending)
Produces a vector of indices corresponding to the smallest-to-biggest entries in to_sort (or biggest-...
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")