1 #ifndef CASM_HallOfFame
2 #define CASM_HallOfFame
18 template<
typename ObjectType,
typename Metric,
typename ObjectCompare = std::less<ObjectType> >
23 typedef std::pair<double, ObjectType>
PairType;
31 Compare(ObjectCompare _obj_compare,
double _score_tol) :
34 bool operator()(
const PairType &A,
const PairType &B)
const {
62 InsertResult(const_iterator _pos,
bool _success,
double _score,
bool _excluded, const_iterator _excluded_pos) :
65 InsertResult(std::pair<const_iterator, bool> _res,
double _score,
bool _excluded, const_iterator _excluded_pos) :
82 HallOfFame(Metric _metric, ObjectCompare _obj_compare = std::less<ObjectType>(),
Index _max_size = 100,
double _score_tol =
TOL):
98 template<
typename ObjectIterator>
100 for(
auto it = begin; it !=
end; ++it) {
143 PairType
test(score, obj);
182 const_iterator
end()
const {
198 const_reverse_iterator
rend()
const {
202 const_reverse_iterator
crend()
const {
206 std::pair<const_iterator, const_iterator>
equal_range(
double key)
const {
214 const_iterator
find(
double key)
const {
ContainerType::const_iterator const_iterator
const_reverse_iterator rend() const
void exclude(const ObjectType &obj)
Add an object that should not be included in the hall of fame.
FloatCompare m_score_compare
HallOfFame::const_iterator const_iterator
bool operator()(const PairType &A, const PairType &B) const
std::set< PairType, Compare > ContainerType
size_type count(double key) const
const_iterator find(double key) const
Results data structure for HallOfFame::insert.
ContainerType m_halloffame
A container for storing best scoring objects.
ObjectCompare m_obj_compare
std::pair< const_iterator, const_iterator > equal_range(double key) const
ObjectCompare m_obj_compare
const_iterator begin() const
InsertResult(std::pair< const_iterator, bool > _res, double _score, bool _excluded, const_iterator _excluded_pos)
HallOfFame(Metric _metric, ObjectCompare _obj_compare=std::less< ObjectType >(), Index _max_size=100, double _score_tol=TOL)
Constructor.
const_iterator cbegin() const
EigenIndex Index
For long integer indexing:
ContainerType::const_reverse_iterator const_reverse_iterator
Compare(ObjectCompare _obj_compare, double _score_tol)
const_reverse_iterator rbegin() const
size_type max_size() const
const_iterator cend() const
InsertResult insert(const ObjectType &obj)
Insert object in HallOfFame.
const_iterator lower_bound(double key) const
const_reverse_iterator crbegin() const
const_iterator upper_bound(double key) const
const_iterator end() const
const_iterator excluded_pos
InsertResult(const_iterator _pos, bool _success, double _score, bool _excluded, const_iterator _excluded_pos)
void exclude(ObjectIterator begin, ObjectIterator end)
Add objects that should not be included in the hall of fame.
FloatCompare m_score_compare
std::pair< double, ObjectType > PairType
const_reverse_iterator crend() const