A comparator for general index sorting. More...
#include <mbl_index_sort.h>
Public Member Functions | |
mbl_index_sort_cmp (const CONT &data, const CMP &c=CMP()) | |
bool | operator() (const INDEX &a, const INDEX &b) const |
Public Attributes | |
const CONT & | data_ |
const CMP & | cmp_ |
A comparator for general index sorting.
It will take any type of index on to any sort of container so long as T container.operator[](index) const is defined.
For example, a simple index sort can be done as follows.
vcl_vector<double> data (n); vcl_vector<unsigned> index (n/2); ... vcl_sort(index.begin(), index.end(), mbl_index_sort_cmp<double>(data));
Definition at line 106 of file mbl_index_sort.h.
mbl_index_sort_cmp< T, INDEX, CONT, CMP >::mbl_index_sort_cmp | ( | const CONT & | data, |
const CMP & | c = CMP() |
||
) | [inline, explicit] |
Definition at line 108 of file mbl_index_sort.h.
bool mbl_index_sort_cmp< T, INDEX, CONT, CMP >::operator() | ( | const INDEX & | a, |
const INDEX & | b | ||
) | const [inline] |
Definition at line 112 of file mbl_index_sort.h.
const CMP& mbl_index_sort_cmp< T, INDEX, CONT, CMP >::cmp_ |
Definition at line 111 of file mbl_index_sort.h.
const CONT& mbl_index_sort_cmp< T, INDEX, CONT, CMP >::data_ |
Definition at line 110 of file mbl_index_sort.h.