CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#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 21 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 48 of file HallOfFame.hh.
typedef ContainerType::const_reverse_iterator CASM::HallOfFame< ObjectType, Metric, ObjectCompare >::const_reverse_iterator |
Definition at line 49 of file HallOfFame.hh.
typedef std::set<PairType, Compare> CASM::HallOfFame< ObjectType, Metric, ObjectCompare >::ContainerType |
Definition at line 47 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 50 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 87 of file HallOfFame.hh.
|
inline |
Definition at line 173 of file HallOfFame.hh.
|
inline |
Definition at line 175 of file HallOfFame.hh.
|
inline |
Definition at line 179 of file HallOfFame.hh.
|
inline |
Definition at line 171 of file HallOfFame.hh.
|
inline |
Definition at line 112 of file HallOfFame.hh.
|
inline |
Definition at line 193 of file HallOfFame.hh.
|
inline |
Definition at line 183 of file HallOfFame.hh.
|
inline |
Definition at line 187 of file HallOfFame.hh.
|
inline |
Definition at line 116 of file HallOfFame.hh.
|
inline |
Definition at line 177 of file HallOfFame.hh.
|
inline |
Definition at line 189 of file HallOfFame.hh.
|
inline |
Add an object that should not be included in the hall of fame.
Definition at line 99 of file HallOfFame.hh.
|
inline |
Add objects that should not be included in the hall of fame.
Definition at line 106 of file HallOfFame.hh.
|
inline |
Definition at line 195 of file HallOfFame.hh.
|
inline |
Insert object in HallOfFame.
Definition at line 126 of file HallOfFame.hh.
|
inline |
Definition at line 197 of file HallOfFame.hh.
|
inline |
Definition at line 120 of file HallOfFame.hh.
|
inline |
Definition at line 114 of file HallOfFame.hh.
|
inline |
Definition at line 181 of file HallOfFame.hh.
|
inline |
Definition at line 185 of file HallOfFame.hh.
|
inline |
Definition at line 118 of file HallOfFame.hh.
|
inline |
Definition at line 201 of file HallOfFame.hh.
|
private |
Definition at line 210 of file HallOfFame.hh.
|
private |
Definition at line 211 of file HallOfFame.hh.
|
private |
Definition at line 209 of file HallOfFame.hh.
|
private |
Definition at line 212 of file HallOfFame.hh.
|
private |
Definition at line 206 of file HallOfFame.hh.
|
private |
Definition at line 207 of file HallOfFame.hh.
|
private |
Definition at line 208 of file HallOfFame.hh.