Bridge++  Ver. 2.0.2
Sorter< T > Class Template Reference

#include <sorter.h>

Classes

struct  by_abs_ascend
 absolute ascending order More...
 
struct  by_abs_descend
 absolute descending order More...
 
struct  by_ascend
 ascending order More...
 
struct  by_descend
 descending order More...
 
struct  by_order
 base class for sort ordering More...
 
struct  proxy
 proxy object to pass to stl sort algorithm More...
 

Public Member Functions

 Sorter (const std::string &type)
 constructor with sort ordering as a string arg More...
 
virtual ~Sorter ()
 destructor More...
 
void sort (std::vector< double > &v)
 sort an array of values; v is sorted on exit. More...
 
void sort (std::vector< double > &v, const size_t nelem)
 sort first n elements of an array of values; v is sorted on exit. More...
 
std::vector< int > sort_index (std::vector< double > &v)
 sort an array and return list of index; v is sorted on exit. More...
 
std::vector< int > sort_index (std::vector< double > &v, const size_t nelem)
 sort an array and return list of index. first n elemnts are considered. More...
 
bool comp (const double lhs, const double rhs)
 call sort condition. More...
 
 Sorter (const std::string &type)
 
virtual ~Sorter ()
 
void sort (std::vector< T > &v)
 sort an array of values; v is sorted on exit. More...
 
void sort (std::vector< T > &v, const size_t nelem)
 sort first n elements of an array of values; v is sorted on exit. More...
 
std::vector< int > sort_index (std::vector< T > &v)
 sort an array and return list of index; v is sorted on exit. More...
 
std::vector< int > sort_index (std::vector< T > &v, const size_t nelem)
 sort an array and return list of index. first n elemnts are considered. More...
 
bool comp (const T &lhs, const T &rhs)
 call sort condition. More...
 

Private Types

typedef std::pair< int, double > pair_t
 
typedef std::pair< int, T > pair_t
 

Private Member Functions

 Sorter (const Sorter &)
 
Sorteroperator= (const Sorter &)
 
 Sorter (const Sorter &)
 
Sorteroperator= (const Sorter &)
 

Private Attributes

by_orderm_order
 

Detailed Description

template<typename T>
class Sorter< T >

Definition at line 38 of file sorter.h.

Member Typedef Documentation

◆ pair_t [1/2]

template<typename T >
typedef std::pair<int, double> Sorter< T >::pair_t
private

Definition at line 70 of file sorter.h.

◆ pair_t [2/2]

template<typename T >
typedef std::pair<int, T> Sorter< T >::pair_t
private

Definition at line 75 of file sorter_alt.h.

Constructor & Destructor Documentation

◆ Sorter() [1/4]

template<typename T >
Sorter< T >::Sorter ( const std::string &  type)

constructor with sort ordering as a string arg

Definition at line 98 of file sorter.cpp.

◆ ~Sorter() [1/2]

template<typename T >
Sorter< T >::~Sorter
virtual

destructor

Definition at line 109 of file sorter.cpp.

◆ Sorter() [2/4]

template<typename T >
Sorter< T >::Sorter ( const Sorter< T > &  )
private

◆ Sorter() [3/4]

template<typename T >
Sorter< T >::Sorter ( const std::string &  type)

◆ ~Sorter() [2/2]

template<typename T >
virtual Sorter< T >::~Sorter ( )
virtual

◆ Sorter() [4/4]

template<typename T >
Sorter< T >::Sorter ( const Sorter< T > &  )
private

Member Function Documentation

◆ comp() [1/2]

template<typename T >
bool Sorter< T >::comp ( const double  lhs,
const double  rhs 
)

call sort condition.

Definition at line 189 of file sorter.cpp.

◆ comp() [2/2]

template<typename T >
bool Sorter< T >::comp ( const T &  lhs,
const T &  rhs 
)

call sort condition.

Definition at line 272 of file sorter_alt.h.

◆ operator=() [1/2]

template<typename T >
Sorter& Sorter< T >::operator= ( const Sorter< T > &  )
private

◆ operator=() [2/2]

template<typename T >
Sorter& Sorter< T >::operator= ( const Sorter< T > &  )
private

◆ sort() [1/4]

template<typename T >
void Sorter< T >::sort ( std::vector< double > &  v)

sort an array of values; v is sorted on exit.

Definition at line 117 of file sorter.cpp.

◆ sort() [2/4]

template<typename T >
void Sorter< T >::sort ( std::vector< double > &  v,
const size_t  nelem 
)

sort first n elements of an array of values; v is sorted on exit.

sort first n elments of an array of values; v is sorted on exit.

Definition at line 127 of file sorter.cpp.

◆ sort() [3/4]

template<typename T >
void Sorter< T >::sort ( std::vector< T > &  v)

sort an array of values; v is sorted on exit.

Definition at line 196 of file sorter_alt.h.

◆ sort() [4/4]

template<typename T >
void Sorter< T >::sort ( std::vector< T > &  v,
const size_t  nelem 
)

sort first n elements of an array of values; v is sorted on exit.

sort first n elments of an array of values; v is sorted on exit.

Definition at line 207 of file sorter_alt.h.

◆ sort_index() [1/4]

template<typename T >
std::vector< int > Sorter< T >::sort_index ( std::vector< double > &  v)

sort an array and return list of index; v is sorted on exit.

sort an array and return list of index.

Definition at line 137 of file sorter.cpp.

◆ sort_index() [2/4]

template<typename T >
std::vector< int > Sorter< T >::sort_index ( std::vector< double > &  v,
const size_t  nelem 
)

sort an array and return list of index. first n elemnts are considered.

sort an array and return list of index. first n elements are condidered.

Definition at line 163 of file sorter.cpp.

◆ sort_index() [3/4]

template<typename T >
std::vector< int > Sorter< T >::sort_index ( std::vector< T > &  v)

sort an array and return list of index; v is sorted on exit.

sort an array and return list of index.

Definition at line 218 of file sorter_alt.h.

◆ sort_index() [4/4]

template<typename T >
std::vector< int > Sorter< T >::sort_index ( std::vector< T > &  v,
const size_t  nelem 
)

sort an array and return list of index. first n elemnts are considered.

sort an array and return list of index. first n elements are condidered.

Definition at line 245 of file sorter_alt.h.

Member Data Documentation

◆ m_order

template<typename T >
by_order * Sorter< T >::m_order
private

Definition at line 74 of file sorter.h.


The documentation for this class was generated from the following files: