ARTS 2.5.11 (git: 6827797f)
sorting.h
Go to the documentation of this file.
1
2// File description
4
13#ifndef sorting_h
14#define sorting_h
15
16#include <algorithm>
17#include <functional>
18
19#include "array.h"
20#include "matpack_concepts.h"
21
22
38template <typename T>
39void get_sorted_indexes(ArrayOfIndex& sorted, const T& data) {
40 sorted.resize(data.size());
41 std::iota(sorted.begin(), sorted.end(), 0);
42 sort(sorted.begin(), sorted.end(), [&data](const Index a, const Index b) {
43 return data[a] < data[b];
44 });
45}
46
47#endif /* sorting_h */
This file contains the definition of Array.
void get_sorted_indexes(ArrayOfIndex &sorted, const T &data)
get_sorted_indexes
Definition: sorting.h:39
#define a
#define b