![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
the class for computing the log2 of the parametric complexity of an r-ary multinomial variable More...
#include <variableLog2ParamComplexity.h>
Public Member Functions | |
Constructors / Destructors | |
| VariableLog2ParamComplexity () | |
| default constructor | |
| VariableLog2ParamComplexity (const VariableLog2ParamComplexity &from) | |
| copy constructor | |
| VariableLog2ParamComplexity (VariableLog2ParamComplexity &&from) | |
| move constructor | |
| virtual VariableLog2ParamComplexity * | clone () const |
| virtual copy constructor | |
| virtual | ~VariableLog2ParamComplexity () |
| destructor | |
Operators | |
| VariableLog2ParamComplexity & | operator= (const VariableLog2ParamComplexity &from) |
| copy operator | |
| VariableLog2ParamComplexity & | operator= (VariableLog2ParamComplexity &&from) |
| move operator | |
Accessors / Modifiers | |
| double | log2Cnr (const std::size_t r, const double n) |
| returns the value of the log in base 2 of Cnr | |
| void | CnrToFile (const std::string &filename) |
| the function used to write the cpp file with the values of log2(Cnr) | |
| void | useCache (const bool on_off) |
| indicates whether we wish to use a cache for the Cnr | |
| void | clearCache () |
| clears the current cache | |
Private Attributes | |
| const double | _cst1_ = -0.5 + std::log2(std::sqrt(M_PI)) |
| the value of N above which we should use Szpankowski's approximation | |
| const double | _cst2_ = std::sqrt(2.0 / M_PI) / 3.0 |
| const double | _cst3_ = 3.0 / 36.0 - 4.0 / (9.0 * M_PI) |
| bool | _use_cache_ {true} |
| HashTable< std::pair< std::size_t, double >, double > | _cache_ |
the class for computing the log2 of the parametric complexity of an r-ary multinomial variable
This class enables to compute the log in base 2 of the parametric complexity of a single r-ary multinomial variable, i.e., the log in base 2 of the C_N^r term used by NML scores in Bayesian network structure learning algorithm (see, e.g., Silander, Roos, Kontkanen and Myllymaki (2007) "Factorized Normalized Maximum " Likelihood Criterion for Learning Bayesian network Structures)"
Definition at line 87 of file variableLog2ParamComplexity.h.
| gum::VariableLog2ParamComplexity::VariableLog2ParamComplexity | ( | ) |
default constructor
Referenced by VariableLog2ParamComplexity(), VariableLog2ParamComplexity(), clone(), operator=(), and operator=().
| gum::VariableLog2ParamComplexity::VariableLog2ParamComplexity | ( | const VariableLog2ParamComplexity & | from | ) |
copy constructor
References VariableLog2ParamComplexity().
| gum::VariableLog2ParamComplexity::VariableLog2ParamComplexity | ( | VariableLog2ParamComplexity && | from | ) |
move constructor
References VariableLog2ParamComplexity().
|
virtual |
destructor
| void gum::VariableLog2ParamComplexity::clearCache | ( | ) |
clears the current cache
|
virtual |
virtual copy constructor
References VariableLog2ParamComplexity().
| void gum::VariableLog2ParamComplexity::CnrToFile | ( | const std::string & | filename | ) |
the function used to write the cpp file with the values of log2(Cnr)
Definition at line 156 of file variableLog2ParamComplexity.cpp.
References GUM_ERROR, M_LN2, and gum::VariableLog2ParamComplexityCTableNSize.
returns the value of the log in base 2 of Cnr
Definition at line 59 of file variableLog2ParamComplexity.cpp.
References _cache_, _cst1_, _cst2_, _cst3_, _use_cache_, GUM_ERROR, log2Cnr(), M_LN2, gum::VariableLog2ParamComplexityCTable, gum::VariableLog2ParamComplexityCTableNSize, and gum::VariableLog2ParamComplexityCTableRSize.
Referenced by log2Cnr().
| VariableLog2ParamComplexity & gum::VariableLog2ParamComplexity::operator= | ( | const VariableLog2ParamComplexity & | from | ) |
| VariableLog2ParamComplexity & gum::VariableLog2ParamComplexity::operator= | ( | VariableLog2ParamComplexity && | from | ) |
| void gum::VariableLog2ParamComplexity::useCache | ( | const bool | on_off | ) |
indicates whether we wish to use a cache for the Cnr
|
private |
Definition at line 170 of file variableLog2ParamComplexity.h.
Referenced by log2Cnr().
the value of N above which we should use Szpankowski's approximation
Definition at line 162 of file variableLog2ParamComplexity.h.
Referenced by log2Cnr().
Definition at line 163 of file variableLog2ParamComplexity.h.
Referenced by log2Cnr().
Definition at line 164 of file variableLog2ParamComplexity.h.
Referenced by log2Cnr().
|
private |