aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::VariableLog2ParamComplexity< ALLOC > Class Template Reference

the class for computing the log2 of the parametric complexity of an r-ary multinomial variableThis 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)" More...

#include <variableLog2ParamComplexity.h>

Inherits ALLOC< double >.

+ Collaboration diagram for gum::VariableLog2ParamComplexity< ALLOC >:

Public Member Functions

Constructors / Destructors
 VariableLog2ParamComplexity (const allocator_type &alloc=allocator_type())
 default constructor More...
 
 VariableLog2ParamComplexity (const VariableLog2ParamComplexity &from)
 copy constructor More...
 
 VariableLog2ParamComplexity (const VariableLog2ParamComplexity &from, const allocator_type &alloc)
 copy constructor with a given allocator More...
 
 VariableLog2ParamComplexity (VariableLog2ParamComplexity &&from)
 move constructor More...
 
 VariableLog2ParamComplexity (VariableLog2ParamComplexity &&from, const allocator_type &alloc)
 move constructor with a given allocator More...
 
virtual VariableLog2ParamComplexityclone () const
 virtual copy constructor More...
 
virtual VariableLog2ParamComplexityclone (const allocator_type &alloc) const
 virtual copy constructor with a given allocator More...
 
virtual ~VariableLog2ParamComplexity ()
 destructor More...
 
Operators
VariableLog2ParamComplexityoperator= (const VariableLog2ParamComplexity &from)
 copy operator More...
 
VariableLog2ParamComplexityoperator= (VariableLog2ParamComplexity &&from)
 move operator More...
 
Accessors / Modifiers
double log2Cnr (const std::size_t r, const double n)
 returns the value of the log in base 2 of Cnr More...
 
void CnrToFile (const std::string &filename)
 the function used to write the cpp file with the values of log2(Cnr) More...
 
void useCache (const bool on_off)
 indicates whether we wish to use a cache for the Cnr More...
 
void clearCache ()
 clears the current cache More...
 
allocator_type getAllocator () const
 returns the allocator used by the parameterized complexity class More...
 

Public Types

using allocator_type = ALLOC< double >
 type for the allocators passed in arguments of methods More...
 

Detailed Description

template<template< typename > class ALLOC = std::allocator>
class gum::VariableLog2ParamComplexity< ALLOC >

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 67 of file variableLog2ParamComplexity.h.

Member Typedef Documentation

◆ allocator_type

template<template< typename > class ALLOC = std::allocator>
using gum::VariableLog2ParamComplexity< ALLOC >::allocator_type = ALLOC< double >

type for the allocators passed in arguments of methods

Definition at line 70 of file variableLog2ParamComplexity.h.

Constructor & Destructor Documentation

◆ VariableLog2ParamComplexity() [1/5]

template<template< typename > class ALLOC = std::allocator>
gum::VariableLog2ParamComplexity< ALLOC >::VariableLog2ParamComplexity ( const allocator_type alloc = allocator_type())

default constructor

◆ VariableLog2ParamComplexity() [2/5]

template<template< typename > class ALLOC = std::allocator>
gum::VariableLog2ParamComplexity< ALLOC >::VariableLog2ParamComplexity ( const VariableLog2ParamComplexity< ALLOC > &  from)

copy constructor

◆ VariableLog2ParamComplexity() [3/5]

template<template< typename > class ALLOC = std::allocator>
gum::VariableLog2ParamComplexity< ALLOC >::VariableLog2ParamComplexity ( const VariableLog2ParamComplexity< ALLOC > &  from,
const allocator_type alloc 
)

copy constructor with a given allocator

◆ VariableLog2ParamComplexity() [4/5]

template<template< typename > class ALLOC = std::allocator>
gum::VariableLog2ParamComplexity< ALLOC >::VariableLog2ParamComplexity ( VariableLog2ParamComplexity< ALLOC > &&  from)

move constructor

◆ VariableLog2ParamComplexity() [5/5]

template<template< typename > class ALLOC = std::allocator>
gum::VariableLog2ParamComplexity< ALLOC >::VariableLog2ParamComplexity ( VariableLog2ParamComplexity< ALLOC > &&  from,
const allocator_type alloc 
)

move constructor with a given allocator

◆ ~VariableLog2ParamComplexity()

template<template< typename > class ALLOC = std::allocator>
virtual gum::VariableLog2ParamComplexity< ALLOC >::~VariableLog2ParamComplexity ( )
virtual

destructor

Member Function Documentation

◆ clearCache()

template<template< typename > class ALLOC = std::allocator>
void gum::VariableLog2ParamComplexity< ALLOC >::clearCache ( )

clears the current cache

◆ clone() [1/2]

template<template< typename > class ALLOC = std::allocator>
virtual VariableLog2ParamComplexity* gum::VariableLog2ParamComplexity< ALLOC >::clone ( ) const
virtual

virtual copy constructor

◆ clone() [2/2]

template<template< typename > class ALLOC = std::allocator>
virtual VariableLog2ParamComplexity* gum::VariableLog2ParamComplexity< ALLOC >::clone ( const allocator_type alloc) const
virtual

virtual copy constructor with a given allocator

◆ CnrToFile()

template<template< typename > class ALLOC = std::allocator>
void gum::VariableLog2ParamComplexity< ALLOC >::CnrToFile ( const std::string &  filename)

the function used to write the cpp file with the values of log2(Cnr)

◆ getAllocator()

template<template< typename > class ALLOC = std::allocator>
allocator_type gum::VariableLog2ParamComplexity< ALLOC >::getAllocator ( ) const

returns the allocator used by the parameterized complexity class

◆ log2Cnr()

template<template< typename > class ALLOC = std::allocator>
double gum::VariableLog2ParamComplexity< ALLOC >::log2Cnr ( const std::size_t  r,
const double  n 
)

returns the value of the log in base 2 of Cnr

◆ operator=() [1/2]

template<template< typename > class ALLOC = std::allocator>
VariableLog2ParamComplexity& gum::VariableLog2ParamComplexity< ALLOC >::operator= ( const VariableLog2ParamComplexity< ALLOC > &  from)

copy operator

◆ operator=() [2/2]

template<template< typename > class ALLOC = std::allocator>
VariableLog2ParamComplexity& gum::VariableLog2ParamComplexity< ALLOC >::operator= ( VariableLog2ParamComplexity< ALLOC > &&  from)

move operator

◆ useCache()

template<template< typename > class ALLOC = std::allocator>
void gum::VariableLog2ParamComplexity< ALLOC >::useCache ( const bool  on_off)

indicates whether we wish to use a cache for the Cnr

Member Data Documentation

◆ _cache_

template<template< typename > class ALLOC = std::allocator>
HashTable< std::pair< std::size_t, double >, double > gum::VariableLog2ParamComplexity< ALLOC >::_cache_
private

Definition at line 167 of file variableLog2ParamComplexity.h.

◆ _cst1_

template<template< typename > class ALLOC = std::allocator>
const double gum::VariableLog2ParamComplexity< ALLOC >::_cst1_ = -0.5 + std::log2(std::sqrt(M_PI))
private

Definition at line 159 of file variableLog2ParamComplexity.h.

◆ _cst2_

template<template< typename > class ALLOC = std::allocator>
const double gum::VariableLog2ParamComplexity< ALLOC >::_cst2_ = std::sqrt(2.0 / M_PI) / 3.0
private

Definition at line 160 of file variableLog2ParamComplexity.h.

◆ _cst3_

template<template< typename > class ALLOC = std::allocator>
const double gum::VariableLog2ParamComplexity< ALLOC >::_cst3_ = 3.0 / 36.0 - 4.0 / (9.0 * M_PI)
private

Definition at line 161 of file variableLog2ParamComplexity.h.

◆ _Szpankowski_threshold_

template<template< typename > class ALLOC = std::allocator>
const double gum::VariableLog2ParamComplexity< ALLOC >::_Szpankowski_threshold_ {VariableLog2ParamComplexityCTableNSize}
private

the value of N above which we should use Szpankowski's approximation

Definition at line 144 of file variableLog2ParamComplexity.h.

◆ _use_cache_

template<template< typename > class ALLOC = std::allocator>
bool gum::VariableLog2ParamComplexity< ALLOC >::_use_cache_ {true}
private

Definition at line 164 of file variableLog2ParamComplexity.h.


The documentation for this class was generated from the following file: