![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
a cache for caching scores and independence tests results More...
#include <agrum/base/database/scoringCache.h>
Public Member Functions | |
Constructors / Destructors | |
| ScoringCache () | |
| default constructor | |
| ScoringCache (const ScoringCache &from) | |
| copy constructor | |
| ScoringCache (ScoringCache &&from) | |
| move constructor | |
| virtual ScoringCache * | clone () const |
| virtual copy constructor | |
| virtual | ~ScoringCache () |
| destructor | |
Operators | |
| ScoringCache & | operator= (const ScoringCache &from) |
| copy operator | |
| ScoringCache & | operator= (ScoringCache &&from) |
| move operator | |
Accessors / Modifiers | |
| void | insert (const IdCondSet &idset, double score) |
| insert a new score into the cache | |
| void | insert (IdCondSet &&idset, double score) |
| insert a new score into the cache | |
| void | erase (const IdCondSet &idset) |
| removes a score (if it exists) | |
| bool | exists (const IdCondSet &idset) |
| indicates whether a given score exists | |
| double | score (const IdCondSet &idset) |
| returns a given score | |
| void | clear () |
| removes all the stored scores | |
| std::size_t | size () const |
| returns the number of scores saved in the cache | |
a cache for caching scores and independence tests results
Caching previously computed scores or the results of conditional independence tests is very important for learning algorithms because computing a score or an independence test requires parsing the database and this is the most time consuming operation in learning. This class provides an efficient cache that can significantly alleviate the learning computational burden.
Definition at line 79 of file scoringCache.h.
| gum::learning::ScoringCache::ScoringCache | ( | ) |
default constructor
Referenced by ScoringCache(), ScoringCache(), clone(), operator=(), and operator=().
| gum::learning::ScoringCache::ScoringCache | ( | const ScoringCache & | from | ) |
| gum::learning::ScoringCache::ScoringCache | ( | ScoringCache && | from | ) |
|
virtual |
destructor
| void gum::learning::ScoringCache::clear | ( | ) |
removes all the stored scores
|
virtual |
| void gum::learning::ScoringCache::erase | ( | const IdCondSet & | idset | ) |
removes a score (if it exists)
| idset | the IdCondSet storing the sets of variables |
indicates whether a given score exists
| idset | the IdCondSet storing the sets of variables |
insert a new score into the cache
| idset | the IdCondSet storing the sets of variables |
| score | the score assigned to the IdCondSet |
| DuplicateElement | exception is raised if a score for the same variables already exists |
References score().
insert a new score into the cache
| idset | the IdCondSet storing the sets of variables |
| score | the score assigned to the IdCondSet |
| DuplicateElement | exception is raised if a score for the same variables already exists |
References score().
| ScoringCache & gum::learning::ScoringCache::operator= | ( | const ScoringCache & | from | ) |
| ScoringCache & gum::learning::ScoringCache::operator= | ( | ScoringCache && | from | ) |
| std::size_t gum::learning::ScoringCache::size | ( | ) | const |
returns the number of scores saved in the cache