![]() |
aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
|
Base class for every random variable. More...
#include <variable.h>
Public Member Functions | |
Constructors / Destructors | |
| virtual | ~Variable () |
| destructor | |
| virtual Variable * | clone () const =0 |
| Copy Factory. | |
Operators | |
| Variable & | operator= (const Variable &aRV) |
| Copy operator. | |
| bool | operator== (const Variable &aRV) const |
| equality operator | |
Accessors / Modifiers | |
| void | setName (std::string_view theValue) |
| sets the name of the variable | |
| const std::string & | name () const |
| returns the name of the variable | |
| void | setDescription (std::string_view theValue) const |
| sets the description of the variable | |
| const std::string & | description () const |
| returns the description of the variable | |
| virtual VarType | varType () const =0 |
| returns the type of variable | |
| virtual std::string | domain () const =0 |
| string represent the domain of the variable | |
Protected Member Functions | |
| Variable () | |
| (protected) Default constructor | |
| void | copy_ (const Variable &aRV) |
| protected copy | |
| Variable (std::string_view aName, std::string_view aDesc) | |
| constructor | |
| Variable (const Variable &aRV) | |
| copy constructor | |
Private Member Functions | |
| virtual bool | _checkSameDomain_ (const Variable &aRV) const =0 |
| check the domain | |
Private Attributes | |
| std::string | _name_ |
| the name of the variable | |
| std::string | _description_ |
| the description of the variable since description is not a characteristic of a variable, we allow the description to be changed even in a const reference. | |
Base class for every random variable.
Definition at line 81 of file variable.h.
|
virtual |
destructor
|
inlineprotected |
(protected) Default constructor
Definition at line 145 of file variable.h.
References Variable().
Referenced by Variable(), Variable(), _checkSameDomain_(), clone(), copy_(), operator=(), and operator==().
|
protected |
constructor
| aName | name of the variable |
| aDesc | description of the variable |
|
protected |
copy constructor
| aRV | the variable we copy |
References Variable().
check the domain
this function use the assumption that the concrete type of the variable is the same as *this
Implemented in gum::ContinuousVariable< GUM_SCALAR >, gum::DiscretizedVariable< T_TICKS >, gum::IntegerVariable, gum::LabelizedVariable, gum::NumericalDiscreteVariable, and gum::RangeVariable.
References Variable().
|
nodiscardpure virtual |
Copy Factory.
Implemented in gum::ContinuousVariable< GUM_SCALAR >, gum::DiscreteVariable, gum::DiscretizedVariable< T_TICKS >, gum::IContinuousVariable, gum::IDiscretizedVariable, gum::IntegerVariable, gum::LabelizedVariable, gum::NumericalDiscreteVariable, and gum::RangeVariable.
References Variable().
|
protected |
protected copy
| aRV | to be copied |
References Variable().
| const std::string & gum::Variable::description | ( | ) | const |
returns the description of the variable
|
pure virtual |
string represent the domain of the variable
Implemented in gum::ContinuousVariable< GUM_SCALAR >, gum::DiscreteVariable, gum::DiscretizedVariable< T_TICKS >, gum::IntegerVariable, gum::LabelizedVariable, gum::NumericalDiscreteVariable, and gum::RangeVariable.
| const std::string & gum::Variable::name | ( | ) | const |
returns the name of the variable
Referenced by gum::learning::IBNLearner::Database::Database(), gum::Estimator< GUM_SCALAR >::Estimator(), gum::NumericalDiscreteVariable::NumericalDiscreteVariable(), gum::MultiDimImplementation< double >::~MultiDimImplementation(), gum::BNdistance< GUM_SCALAR >::_checkCompatibility_(), gum::ASTposteriorProba< GUM_SCALAR >::_compute_knw_from_bn(), gum::prm::PRMFactory< GUM_SCALAR >::_retrieveCommonType_(), gum::prm::PRMFactory< GUM_SCALAR >::_retrieveInputs_(), gum::BayesNetFactory< GUM_SCALAR >::_setCPTAndParents_(), gum::Instantiation::add(), gum::MultiDimImplementation< GUM_ELEMENT >::add(), gum::Instantiation::chgVal(), gum::GibbsBNdistance< GUM_SCALAR >::computeKL_(), gum::InfluenceDiagram< GUM_SCALAR >::copyStructureAndTables_(), gum::FMDP< double >::cost(), gum::prm::PRMFactory< GUM_SCALAR >::endDiscreteType(), gum::prm::PRMFactory< GUM_SCALAR >::endDiscretizedType(), gum::BayesNetFactory< GUM_SCALAR >::endVariableDeclaration(), gum::FMDPFactory< GUM_ELEMENT >::endVariableDeclaration(), gum::BayesNetFragment< GUM_SCALAR >::nodeId(), gum::IBayesNet< GUM_SCALAR >::operator==(), gum::Estimator< GUM_SCALAR >::posterior(), gum::Estimator< GUM_SCALAR >::setFromBN(), gum::Instantiation::setValsFrom(), gum::BayesNetFactory< GUM_SCALAR >::setVariable(), gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked(), gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >::toDot(), gum::RangeVariable::toFast(), gum::Estimator< GUM_SCALAR >::update(), and gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >::varNodeListe().
Copy operator.
| aRV | to be copied |
References Variable().
| void gum::Variable::setDescription | ( | std::string_view | theValue | ) | const |
sets the description of the variable
| theValue |
| void gum::Variable::setName | ( | std::string_view | theValue | ) |
sets the name of the variable
| theValue |
|
pure virtual |
returns the type of variable
Implemented in gum::ContinuousVariable< GUM_SCALAR >, gum::DiscreteVariable, gum::DiscretizedVariable< T_TICKS >, gum::IntegerVariable, gum::LabelizedVariable, gum::NumericalDiscreteVariable, and gum::RangeVariable.
|
mutableprivate |
the description of the variable since description is not a characteristic of a variable, we allow the description to be changed even in a const reference.
Definition at line 167 of file variable.h.
|
private |
the name of the variable
Definition at line 162 of file variable.h.