![]() |
aGrUM 2.3.2
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 (const std::string &theValue) |
| sets the name of the variable | |
| const std::string & | name () const |
| returns the name of the variable | |
| void | setDescription (const std::string &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 (const std::string &aName, const std::string &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 79 of file variable.h.
|
virtual |
destructor
|
inlineprotected |
(protected) Default constructor
Definition at line 143 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().
|
pure 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::MultiDimImplementation< double >::MultiDimImplementation(), gum::NumericalDiscreteVariable::NumericalDiscreteVariable(), gum::BNdistance< GUM_SCALAR >::_checkCompatibility_(), gum::BayesNet< double >::_copyTensors_(), gum::prm::PRMFactory< GUM_SCALAR >::_retrieveCommonType_(), gum::prm::PRMFactory< GUM_SCALAR >::_retrieveInputs_(), gum::BayesNetFactory< GUM_SCALAR >::_setCPTAndParents_(), gum::Instantiation::add(), gum::FMDP< double >::addCostForAction(), gum::FMDP< GUM_SCALAR >::addVariable(), gum::MultiDimICIModel< GUM_SCALAR >::causalWeight(), gum::Instantiation::chgVal(), gum::GibbsBNdistance< GUM_SCALAR >::computeKL_(), gum::InfluenceDiagram< GUM_SCALAR >::copyStructureAndTables_(), gum::prm::PRMFactory< GUM_SCALAR >::endDiscreteType(), gum::prm::PRMFactory< GUM_SCALAR >::endDiscretizedType(), gum::BayesNetFactory< GUM_SCALAR >::endVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::BayesNetFragment< GUM_SCALAR >::nodeId(), 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_SCALAR, TerminalNodePolicy >::toDot(), gum::RangeVariable::toFast(), gum::Estimator< GUM_SCALAR >::update(), and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::varNodeListe().
Copy operator.
| aRV | to be copied |
References Variable().
| void gum::Variable::setDescription | ( | const std::string & | theValue | ) | const |
sets the description of the variable
| theValue |
| void gum::Variable::setName | ( | const std::string & | 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 165 of file variable.h.
|
private |
the name of the variable
Definition at line 160 of file variable.h.