25 #ifndef DOXYGEN_SHOULD_SKIP_THIS 33 template <
template <
typename >
class ALLOC >
41 template <
template <
typename >
class ALLOC >
50 template <
template <
typename >
class ALLOC >
52 const ScoringCache< ALLOC >& from,
55 __scores(from.__scores) {
61 template <
template <
typename >
class ALLOC >
67 template <
template <
typename >
class ALLOC >
69 ScoringCache< ALLOC >&& from,
72 __scores(
std::move(from.__scores)) {
78 template <
template <
typename >
class ALLOC >
84 template <
template <
typename >
class ALLOC >
87 ALLOC< ScoringCache< ALLOC > > allocator(alloc);
88 ScoringCache< ALLOC >* cache = allocator.allocate(1);
90 allocator.construct(cache, *
this, alloc);
92 allocator.deallocate(cache, 1);
100 template <
template <
typename >
class ALLOC >
107 template <
template <
typename >
class ALLOC >
114 template <
template <
typename >
class ALLOC >
116 operator=(
const ScoringCache< ALLOC >& from) {
117 if (&from !=
this) { __scores = from.__scores; }
123 template <
template <
typename >
class ALLOC >
125 operator=(ScoringCache< ALLOC >&& from) {
126 if (&from !=
this) { __scores = std::move(from.__scores); }
132 template <
template <
typename >
class ALLOC >
135 __scores.insert(idset, score);
140 template <
template <
typename >
class ALLOC >
143 __scores.insert(std::move(idset), std::move(score));
148 template <
template <
typename >
class ALLOC >
150 __scores.erase(idset);
155 template <
template <
typename >
class ALLOC >
157 return __scores.exists(idset);
162 template <
template <
typename >
class ALLOC >
164 return __scores[idset];
169 template <
template <
typename >
class ALLOC >
176 template <
template <
typename >
class ALLOC >
178 return __scores.size();
virtual ~ScoringCache()
destructor
void erase(const IdSet< ALLOC > &idset)
removes a score (if it exists)
gum is the global namespace for all aGrUM entities
std::size_t size() const
returns the number of scores saved in the cache
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
void clear()
removes all the stored scores
double score(const IdSet< ALLOC > &idset)
returns a given score
ScoringCache< ALLOC > & operator=(const ScoringCache< ALLOC > &from)
copy operator
void insert(const IdSet< ALLOC > &idset, double score)
insert a new score into the cache
ScoringCache(const allocator_type &alloc=allocator_type())
default constructor
virtual ScoringCache< ALLOC > * clone() const
virtual copy constructor
allocator_type getAllocator() const
returns the allocator used by the translator
bool exists(const IdSet< ALLOC > &idset)
indicates whether a given score exists
Size NodeId
Type for node ids.