Sort indices
sort_index.cpp File Reference
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <vector>
Include dependency graph for sort_index.cpp:

Go to the source code of this file.

Functions

template<typename T >
vector< size_t > sort_indexes (const vector< T > &v)
 Determines the permutation vector for ascending order of a vector. More...
 
vector< size_t > inverse_indexes (const vector< size_t > &v)
 
template<class T >
ostream & operator<< (ostream &s, const vector< T > &idx)
 
int main ()
 

Function Documentation

◆ inverse_indexes()

vector< size_t > inverse_indexes ( const vector< size_t > &  v)

Definition at line 74 of file sort_index.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( )

Definition at line 23 of file sort_index.cpp.

Here is the call graph for this function:

◆ operator<<()

template<class T >
ostream & operator<< ( ostream &  s,
const vector< T > &  idx 
)

Definition at line 81 of file sort_index.cpp.

◆ sort_indexes()

template<typename T >
vector< size_t > sort_indexes ( const vector< T > &  v)

Determines the permutation vector for ascending order of a vector.

Parameters
[in]vvector to determine sorting indices
Returns
permutation order
See also
Ideas in Stack Overflow

Definition at line 58 of file sort_index.cpp.

Here is the caller graph for this function: