All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
seaview Namespace Reference

Classes

class  seaDBSCAN
 
struct  cluster_score
 
class  cluster
 
class  SEAviewer
 

Functions

template<typename T >
std::vector< size_t > seaview_sort_indexes (const std::vector< T > &v)
 

Function Documentation

template<typename T >
std::vector<size_t> seaview::seaview_sort_indexes ( const std::vector< T > &  v)

Definition at line 75 of file SEAviewer.h.

75  {
76 
77  std::vector<size_t> idx(v.size());
78  std::iota(idx.begin(), idx.end(), 0); //fill the range with sequentially increasing values
79 
80  // sort indexes based on comparing values in v (descending order)
81  std::sort(idx.begin(), idx.end(), [&v](size_t i1, size_t i2) {return v[i1] > v[i2];});
82 
83  return idx;
84  }