Rosetta 3.3
Public Types | Public Member Functions
utility::TopScoreSelector< T, S > Class Template Reference

The TopScoreSelector keeps an in-place, sorted, singly-linked list of the N top-scoring objects and their scores that it encounters. In the case of ties, the first object(s) encountered are kept. Class T must have a default constructor, a copy constructor, and must be assignable. Class S must be assignable and comparable, both by a < operator and by a > operator. More...

#include <TopScoreSelector.hh>

Collaboration diagram for utility::TopScoreSelector< T, S >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef platform::Size Size

Public Member Functions

 TopScoreSelector ()
void n_to_keep (Size setting)
Size n_to_keep () const
void low_is_better (bool setting)
bool low_is_better () const
bool better (S s1, S s2) const
void insert (T const &obj, S score)
 Keep a particular element if it is better than the worst element, or if we have not yet stored n_to_keep_ elements.
Size size () const
T const & operator[] (Size ind) const
S top_score (Size ind) const

Detailed Description

template<class T, class S>
class utility::TopScoreSelector< T, S >

The TopScoreSelector keeps an in-place, sorted, singly-linked list of the N top-scoring objects and their scores that it encounters. In the case of ties, the first object(s) encountered are kept. Class T must have a default constructor, a copy constructor, and must be assignable. Class S must be assignable and comparable, both by a < operator and by a > operator.


Member Typedef Documentation

template<class T , class S >
typedef platform::Size utility::TopScoreSelector< T, S >::Size

Constructor & Destructor Documentation

template<class T , class S >
utility::TopScoreSelector< T, S >::TopScoreSelector ( ) [inline]

Member Function Documentation

template<class T , class S >
bool utility::TopScoreSelector< T, S >::better ( S  s1,
S  s2 
) const [inline]
template<class T , class S >
void utility::TopScoreSelector< T, S >::insert ( T const &  obj,
S  score 
) [inline]

Keep a particular element if it is better than the worst element, or if we have not yet stored n_to_keep_ elements.

References utility::TopScoreSelector< T, S >::better().

template<class T , class S >
void utility::TopScoreSelector< T, S >::low_is_better ( bool  setting) [inline]
template<class T , class S >
bool utility::TopScoreSelector< T, S >::low_is_better ( ) const [inline]
template<class T , class S >
Size utility::TopScoreSelector< T, S >::n_to_keep ( ) const [inline]
template<class T , class S >
void utility::TopScoreSelector< T, S >::n_to_keep ( Size  setting) [inline]
template<class T , class S >
T const& utility::TopScoreSelector< T, S >::operator[] ( Size  ind) const [inline]
template<class T , class S >
Size utility::TopScoreSelector< T, S >::size ( ) const [inline]
template<class T , class S >
S utility::TopScoreSelector< T, S >::top_score ( Size  ind) const [inline]

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