Base class for discrete random variable.
More...
#include <discreteVariable.h>
Base class for discrete random variable.
This class is used as an interface.
Definition at line 59 of file discreteVariable.h.
◆ DiscreteVariable() [1/3]
gum::DiscreteVariable::DiscreteVariable |
( |
const std::string & |
aName, |
|
|
const std::string & |
aDesc |
|
) |
| |
◆ DiscreteVariable() [2/3]
Copy constructor.
Copy Constructor.
If aDRV haves any listener, it will not be copied.
- Parameters
-
◆ ~DiscreteVariable()
virtual gum::DiscreteVariable::~DiscreteVariable |
( |
| ) |
|
|
virtual |
◆ DiscreteVariable() [3/3]
gum::DiscreteVariable::DiscreteVariable |
( |
| ) |
|
|
inlineprotected |
(protected) Default constructor
Definition at line 159 of file discreteVariable.h.
DiscreteVariable()
(protected) Default constructor
◆ clone()
◆ copy_()
void gum::Variable::copy_ |
( |
const Variable & |
aRV | ) |
|
|
protectedinherited |
protected copy
- Parameters
-
◆ description()
const std::string& gum::Variable::description |
( |
| ) |
const |
|
inherited |
returns the description of the variable
◆ domain()
virtual const std::string gum::DiscreteVariable::domain |
( |
| ) |
const |
|
pure virtual |
◆ domainSize()
virtual Size gum::DiscreteVariable::domainSize |
( |
| ) |
const |
|
pure virtual |
◆ empty()
bool gum::DiscreteVariable::empty |
( |
| ) |
const |
◆ index()
virtual Idx gum::DiscreteVariable::index |
( |
const std::string & |
label | ) |
const |
|
pure virtual |
◆ label()
virtual std::string gum::DiscreteVariable::label |
( |
Idx |
i | ) |
const |
|
pure virtual |
◆ labels()
std::vector< std::string > gum::DiscreteVariable::labels |
( |
| ) |
const |
◆ name()
const std::string& gum::Variable::name |
( |
| ) |
const |
|
inherited |
returns the name of the variable
◆ numerical()
virtual double gum::DiscreteVariable::numerical |
( |
Idx |
indice | ) |
const |
|
pure virtual |
◆ operator!=() [1/2]
virtual bool gum::Variable::operator!= |
( |
const Variable & |
aRV | ) |
const |
|
virtualinherited |
◆ operator!=() [2/2]
◆ operator=()
Copy operator.
- Parameters
-
- Returns
- a ref to *this
◆ operator==() [1/2]
virtual bool gum::Variable::operator== |
( |
const Variable & |
aRV | ) |
const |
|
virtualinherited |
◆ operator==() [2/2]
◆ operator[]()
Idx gum::DiscreteVariable::operator[] |
( |
const std::string & |
label | ) |
const |
|
inline |
from the label to its index in var.
- Warning
- This operation may have different complexity in different subclasses.
- Exceptions
-
Definition at line 139 of file discreteVariable.h.
virtual std::string label(Idx i) const =0
get the indice-th label. This method is pure virtual.
virtual Idx index(const std::string &label) const =0
◆ setDescription()
void gum::Variable::setDescription |
( |
const std::string & |
theValue | ) |
const |
|
inherited |
sets the description of the variable
- Warning
- since description is mutable, setDescription() is const
- Parameters
-
◆ setName()
void gum::Variable::setName |
( |
const std::string & |
theValue | ) |
|
|
inherited |
sets the name of the variable
- Parameters
-
◆ toString()
std::string gum::DiscreteVariable::toString |
( |
| ) |
const |
◆ toStringWithDescription()
std::string gum::DiscreteVariable::toStringWithDescription |
( |
| ) |
const |
string version of *this using description attribute instead of name.
◆ varType()
virtual VarType gum::DiscreteVariable::varType |
( |
| ) |
const |
|
pure virtual |
The documentation for this class was generated from the following file: