![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Class for discretized random variable. More...
#include <discretizedVariable.h>
Public Member Functions | |
virtual DiscretizedVariable< T_TICKS > * | clone () const |
a virtual clone More... | |
virtual VarType | varType () const |
returns the type of variable More... | |
DiscretizedVariable< T_TICKS > & | operator= (const DiscretizedVariable< T_TICKS > &aDRV) |
operator = More... | |
bool | isTick (const T_TICKS &aTick) const |
DiscretizedVariable & | addTick (const T_TICKS &aTick) |
add a tick. More... | |
void | eraseTicks () |
erase all the Ticks More... | |
virtual std::string | label (Idx i) const |
virtual double | numerical (Idx indice) const |
get a numerical representation of he indice-the value. More... | |
virtual Idx | index (const std::string &label) const |
from the label to its index in var. More... | |
virtual Size | domainSize () const |
virtual const std::string | domain () const |
string represent the domain of the variable More... | |
const T_TICKS & | tick (Idx i) const |
from the index to the tick. More... | |
const std::vector< T_TICKS > & | ticks () const |
Return the list of ticks. More... | |
virtual std::vector< double > | ticksAsDoubles () const |
return the list of ticks as a vector of doubles More... | |
Idx | operator[] (const std::string &label) const |
from the label to its index in var. More... | |
std::string | toString () const |
string version of *this More... | |
std::string | toStringWithDescription () const |
string version of *this using description attribute instead of name. More... | |
constructors & destructors | |
DiscretizedVariable (const std::string &aName, const std::string &aDesc) | |
Constructor. More... | |
DiscretizedVariable (const std::string &aName, const std::string &aDesc, const std::vector< T_TICKS > &ticks) | |
Constructor. More... | |
DiscretizedVariable (const DiscretizedVariable< T_TICKS > &aDRV) | |
Copy constructor. More... | |
virtual | ~DiscretizedVariable () |
Destructor. More... | |
Accessors / Modifiers | |
bool | empty () const |
std::vector< std::string > | labels () const |
vector of labels More... | |
Operators | |
virtual bool | operator== (const DiscreteVariable &aRV) const |
equality operator More... | |
virtual bool | operator!= (const DiscreteVariable &aRV) const |
inequality operator More... | |
Operators | |
virtual bool | operator== (const Variable &aRV) const |
equality operator More... | |
virtual bool | operator!= (const Variable &aRV) const |
inequality operator More... | |
Accessors / Modifiers | |
void | setName (const std::string &theValue) |
sets the name of the variable More... | |
const std::string & | name () const |
returns the name of the variable More... | |
void | setDescription (const std::string &theValue) const |
sets the description of the variable More... | |
const std::string & | description () const |
returns the description of the variable More... | |
Protected Member Functions | |
void | copy_ (const DiscretizedVariable< T_TICKS > &aDRV) |
make a copy More... | |
Idx | dichotomy_ (const T_TICKS &target, Idx min, Idx max) const |
perform a dichotomy on ticks More... | |
Idx | pos_ (const T_TICKS &target) const |
seach the class of target (internally use dichotomy_) More... | |
void | copy_ (const Variable &aRV) |
protected copy More... | |
Class for discretized random variable.
a DiscretizedVariable contains a vector of T_TICKS, assuming that the modalities of the variable arc [T1,T2[,[T2,T3[,...,[Tn-1,Tn]. T can be plus_infinity or minus_infinity.
operator [] has a T_TICKS argument.
Definition at line 56 of file discretizedVariable.h.
gum::DiscretizedVariable< T_TICKS >::DiscretizedVariable | ( | const std::string & | aName, |
const std::string & | aDesc | ||
) |
Constructor.
aName | the name |
aDesc | the description |
gum::DiscretizedVariable< T_TICKS >::DiscretizedVariable | ( | const std::string & | aName, |
const std::string & | aDesc, | ||
const std::vector< T_TICKS > & | ticks | ||
) |
Constructor.
aName | the name |
aDesc | the description |
gum::DiscretizedVariable< T_TICKS >::DiscretizedVariable | ( | const DiscretizedVariable< T_TICKS > & | aDRV | ) |
Copy constructor.
aDRV |
|
virtual |
Destructor.
DiscretizedVariable& gum::DiscretizedVariable< T_TICKS >::addTick | ( | const T_TICKS & | aTick | ) |
|
virtual |
a virtual clone
Implements gum::IDiscretizedVariable.
|
protected |
make a copy
aDRV | the copied object |
|
protectedinherited |
protected copy
aRV | to be copied |
|
inherited |
returns the description of the variable
|
protected |
perform a dichotomy on ticks
target | T_TICKS value |
min | first index |
max | last index |
|
virtual |
string represent the domain of the variable
Implements gum::DiscreteVariable.
|
virtual |
Implements gum::DiscreteVariable.
|
inherited |
void gum::DiscretizedVariable< T_TICKS >::eraseTicks | ( | ) |
erase all the Ticks
|
virtual |
bool gum::DiscretizedVariable< T_TICKS >::isTick | ( | const T_TICKS & | aTick | ) | const |
aTick |
|
virtual |
|
inherited |
vector of labels
|
inherited |
returns the name of the variable
|
virtual |
get a numerical representation of he indice-the value.
Implements gum::DiscreteVariable.
inequality operator
|
virtualinherited |
inequality operator
DiscretizedVariable< T_TICKS >& gum::DiscretizedVariable< T_TICKS >::operator= | ( | const DiscretizedVariable< T_TICKS > & | aDRV | ) |
operator =
aDRV | a labelized discrete random variable |
equality operator
|
virtualinherited |
equality operator
|
inlineinherited |
from the label to its index in var.
NotFound |
Definition at line 139 of file discreteVariable.h.
|
protected |
seach the class of target (internally use dichotomy_)
target |
|
inherited |
sets the description of the variable
theValue |
|
inherited |
sets the name of the variable
theValue |
const T_TICKS& gum::DiscretizedVariable< T_TICKS >::tick | ( | Idx | i | ) | const |
from the index to the tick.
NotFound |
const std::vector< T_TICKS >& gum::DiscretizedVariable< T_TICKS >::ticks | ( | ) | const |
Return the list of ticks.
|
virtual |
return the list of ticks as a vector of doubles
Implements gum::IDiscretizedVariable.
|
inherited |
string version of *this
|
inherited |
string version of *this using description attribute instead of name.
|
virtual |
returns the type of variable
Implements gum::DiscreteVariable.
|
private |
Definition at line 58 of file discretizedVariable.h.
|
private |
Definition at line 59 of file discretizedVariable.h.