CASM
AClustersApproachtoStatisticalMechanics
|
#include <HallOfFame.hh>
A container for storing best scoring objects.
Essentially a std::map with insert modified to calculate the 'score' of an object and insert while keeping only a particular number of best scoring objects.
ObjectCompare implements comparison of ObjectType objects
Definition at line 19 of file HallOfFame.hh.
Classes | |
class | Compare |
struct | InsertResult |
Results data structure for HallOfFame::insert. More... | |
Public Types | |
typedef std::pair< double, ObjectType > | PairType |
typedef std::set< PairType, Compare > | ContainerType |
typedef ContainerType::const_iterator | const_iterator |
typedef ContainerType::const_reverse_iterator | const_reverse_iterator |
typedef Index | size_type |
Public Member Functions | |
HallOfFame (Metric _metric, ObjectCompare _obj_compare=std::less< ObjectType >(), Index _max_size=100, double _score_tol=TOL) | |
Constructor. More... | |
void | exclude (const ObjectType &obj) |
Add an object that should not be included in the hall of fame. More... | |
template<typename ObjectIterator > | |
void | exclude (ObjectIterator begin, ObjectIterator end) |
Add objects that should not be included in the hall of fame. More... | |
void | clear_excluded () |
Metric | metric () const |
bool | empty () const |
size_type | size () const |
size_type | max_size () const |
InsertResult | insert (const ObjectType &obj) |
Insert object in HallOfFame. More... | |
void | clear () |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | end () const |
const_iterator | cend () const |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | rend () const |
const_reverse_iterator | crend () const |
std::pair< const_iterator, const_iterator > | equal_range (double key) const |
size_type | count (double key) const |
const_iterator | find (double key) const |
const_iterator | lower_bound (double key) const |
const_iterator | upper_bound (double key) const |
Private Attributes | |
Metric | m_metric |
ObjectCompare | m_obj_compare |
FloatCompare | m_score_compare |
ContainerType | m_halloffame |
bool | m_check_exclude |
ContainerType | m_exclude |
Index | m_max_size |
typedef ContainerType::const_iterator CASM::HallOfFame< ObjectType, Metric, ObjectCompare >::const_iterator |
Definition at line 53 of file HallOfFame.hh.
typedef ContainerType::const_reverse_iterator CASM::HallOfFame< ObjectType, Metric, ObjectCompare >::const_reverse_iterator |
Definition at line 54 of file HallOfFame.hh.
typedef std::set<PairType, Compare> CASM::HallOfFame< ObjectType, Metric, ObjectCompare >::ContainerType |
Definition at line 52 of file HallOfFame.hh.
typedef std::pair<double, ObjectType> CASM::HallOfFame< ObjectType, Metric, ObjectCompare >::PairType |
Definition at line 23 of file HallOfFame.hh.
typedef Index CASM::HallOfFame< ObjectType, Metric, ObjectCompare >::size_type |
Definition at line 55 of file HallOfFame.hh.
|
inline |
Constructor.
_metric | A function scoring 'ObjectType' objects |
_obj_compare | Functor implementing comparison of 'ObjectType' objects |
_max_size | The maximum number of 'ObjectType' objects to store in the HallOfFame |
_metric_tol | The tolerance used for comparing scores, via FloatCompare |
Definition at line 82 of file HallOfFame.hh.
|
inline |
Definition at line 174 of file HallOfFame.hh.
|
inline |
Definition at line 178 of file HallOfFame.hh.
|
inline |
Definition at line 186 of file HallOfFame.hh.
|
inline |
Definition at line 170 of file HallOfFame.hh.
|
inline |
Definition at line 105 of file HallOfFame.hh.
|
inline |
Definition at line 210 of file HallOfFame.hh.
|
inline |
Definition at line 194 of file HallOfFame.hh.
|
inline |
Definition at line 202 of file HallOfFame.hh.
|
inline |
Definition at line 113 of file HallOfFame.hh.
|
inline |
Definition at line 182 of file HallOfFame.hh.
|
inline |
Definition at line 206 of file HallOfFame.hh.
|
inline |
Add an object that should not be included in the hall of fame.
Definition at line 92 of file HallOfFame.hh.
|
inline |
Add objects that should not be included in the hall of fame.
Definition at line 99 of file HallOfFame.hh.
|
inline |
Definition at line 214 of file HallOfFame.hh.
|
inline |
Insert object in HallOfFame.
Definition at line 129 of file HallOfFame.hh.
|
inline |
Definition at line 218 of file HallOfFame.hh.
|
inline |
Definition at line 121 of file HallOfFame.hh.
|
inline |
Definition at line 109 of file HallOfFame.hh.
|
inline |
Definition at line 190 of file HallOfFame.hh.
|
inline |
Definition at line 198 of file HallOfFame.hh.
|
inline |
Definition at line 117 of file HallOfFame.hh.
|
inline |
Definition at line 222 of file HallOfFame.hh.
|
private |
Definition at line 233 of file HallOfFame.hh.
|
private |
Definition at line 234 of file HallOfFame.hh.
|
private |
Definition at line 232 of file HallOfFame.hh.
|
private |
Definition at line 235 of file HallOfFame.hh.
|
private |
Definition at line 229 of file HallOfFame.hh.
|
private |
Definition at line 230 of file HallOfFame.hh.
|
private |
Definition at line 231 of file HallOfFame.hh.