Rosetta 3.3
Public Member Functions
utility::IndirectSorter< DataContainerType, ComparatorType > Class Template Reference

Sorts a container of things indirectly. More...

#include <IndirectSorter.hh>

Inheritance diagram for utility::IndirectSorter< DataContainerType, ComparatorType >:
Inheritance graph
[legend]
Collaboration diagram for utility::IndirectSorter< DataContainerType, ComparatorType >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 IndirectSorter (DataContainerType &data, ComparatorType &comp)
 Creates a new sorter for a given data container and sorting rule.
 ~IndirectSorter ()
void sort (vector1< Size > &order)
 sorts a given container and returns a vector that defines the right order of the sorted data
bool operator() (int index_1, int index_2)
 compares two indexes by comparing the two referenced objects

Detailed Description

template<class DataContainerType, class ComparatorType>
class utility::IndirectSorter< DataContainerType, ComparatorType >

Sorts a container of things indirectly.

Detailed: The original vector remains untouched. The class provides a vector
with indexes that defines the order user wants

Constructor & Destructor Documentation

template<class DataContainerType , class ComparatorType >
utility::IndirectSorter< DataContainerType, ComparatorType >::IndirectSorter ( DataContainerType &  data,
ComparatorType &  comp 
) [inline]

Creates a new sorter for a given data container and sorting rule.

Detailed: The given comparator must be a valid way to sort the given container,
e.g. when DataContainerType = vector1<Real> then ComparatorType must be an object that implements bool operator()(Real,Real) method
template<class DataContainerType , class ComparatorType >
utility::IndirectSorter< DataContainerType, ComparatorType >::~IndirectSorter ( ) [inline]

Member Function Documentation

template<class DataContainerType , class ComparatorType >
bool utility::IndirectSorter< DataContainerType, ComparatorType >::operator() ( int  index_1,
int  index_2 
) [inline]

compares two indexes by comparing the two referenced objects

Detailed: returns the result of comparison between data[index_1] and data[index_2]
The result of a comparison depends on a comparator definition provided by a user
template<class DataContainerType , class ComparatorType >
void utility::IndirectSorter< DataContainerType, ComparatorType >::sort ( vector1< Size > &  order) [inline]

sorts a given container and returns a vector that defines the right order of the sorted data

References color_pdb::i.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines