Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Sorter Class 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...
 

Private Types

typedef std::pair< int, double > pair_t
 

Private Member Functions

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

Private Attributes

by_orderm_order
 

Detailed Description

Definition at line 38 of file sorter.h.

Member Typedef Documentation

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

Definition at line 70 of file sorter.h.

Constructor & Destructor Documentation

Sorter::Sorter ( const std::string &  type)

constructor with sort ordering as a string arg

Definition at line 98 of file sorter.cpp.

Sorter::~Sorter ( )
virtual

destructor

Definition at line 109 of file sorter.cpp.

Sorter::Sorter ( const Sorter )
private

Member Function Documentation

bool Sorter::comp ( const double  lhs,
const double  rhs 
)

call sort condition.

Definition at line 189 of file sorter.cpp.

Sorter& Sorter::operator= ( const Sorter )
private
void Sorter::sort ( std::vector< double > &  v)

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

Definition at line 117 of file sorter.cpp.

void Sorter::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.

std::vector< int > Sorter::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.

std::vector< int > Sorter::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.

Member Data Documentation

by_order* Sorter::m_order
private

Definition at line 74 of file sorter.h.


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