1 #ifndef CASM_HallOfFame
2 #define CASM_HallOfFame
19 template <
typename ObjectType,
typename Metric,
20 typename ObjectCompare = std::less<ObjectType> >
23 typedef std::pair<double, ObjectType>
PairType;
29 Compare(ObjectCompare _obj_compare,
double _score_tol)
88 ObjectCompare _obj_compare = std::less<ObjectType>(),
89 Index _max_size = 100,
double _score_tol =
TOL)
105 template <
typename ObjectIterator>
107 for (
auto it =
begin; it !=
end; ++it) {
130 std::numeric_limits<double>::quiet_NaN(),
false,
189 std::pair<const_iterator, const_iterator>
equal_range(
double key)
const {
Compare(ObjectCompare _obj_compare, double _score_tol)
ObjectCompare m_obj_compare
FloatCompare m_score_compare
bool operator()(const PairType &A, const PairType &B) const
A container for storing best scoring objects.
const_iterator cend() const
FloatCompare m_score_compare
std::pair< double, ObjectType > PairType
std::pair< const_iterator, const_iterator > equal_range(double key) const
void exclude(const ObjectType &obj)
Add an object that should not be included in the hall of fame.
InsertResult insert(const ObjectType &obj)
Insert object in HallOfFame.
const_iterator find(double key) const
ObjectCompare m_obj_compare
size_type max_size() const
const_reverse_iterator rbegin() const
void exclude(ObjectIterator begin, ObjectIterator end)
Add objects that should not be included in the hall of fame.
HallOfFame(Metric _metric, ObjectCompare _obj_compare=std::less< ObjectType >(), Index _max_size=100, double _score_tol=TOL)
Constructor.
const_reverse_iterator rend() const
const_iterator begin() const
size_type count(double key) const
ContainerType m_halloffame
const_reverse_iterator crbegin() const
const_iterator end() const
ContainerType::const_iterator const_iterator
const_iterator cbegin() const
const_iterator lower_bound(double key) const
const_reverse_iterator crend() const
std::set< PairType, Compare > ContainerType
const_iterator upper_bound(double key) const
ContainerType::const_reverse_iterator const_reverse_iterator
GenericDatumFormatter< double, Result > score()
INDEX_TYPE Index
For long integer indexing:
Results data structure for HallOfFame::insert.
const_iterator excluded_pos
HallOfFame::const_iterator const_iterator
InsertResult(std::pair< const_iterator, bool > _res, double _score, bool _excluded, const_iterator _excluded_pos)
InsertResult(const_iterator _pos, bool _success, double _score, bool _excluded, const_iterator _excluded_pos)