aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::IContinuousVariable Class Referenceabstract

A base class for continuous variables, independent of the GUM_SCALAR type. More...

#include <agrum/base/variables/IContinuousVariable.h>

Inheritance diagram for gum::IContinuousVariable:
Collaboration diagram for gum::IContinuousVariable:

Public Member Functions

Constructors / Destructors
 IContinuousVariable (const std::string &aName, const std::string &aDesc)
 Default constructor.
 IContinuousVariable (const IContinuousVariable &from)
 Copy Constructor.
 IContinuousVariable (IContinuousVariable &&from)
 move constructor
virtual ~IContinuousVariable ()
 destructor
virtual IContinuousVariableclone () const =0
 Copy Factory.
Accessors / Modifiers
virtual double lowerBoundAsDouble () const =0
 returns the lower bound of the domain of the variable as a double
virtual double upperBoundAsDouble () const =0
 returns the upper bound of the domain of the variable as a double
virtual void setLowerBoundFromDouble (const double new_bound)=0
 updates the lower bound of the domain of the variable
virtual void setUpperBoundFromDouble (const double new_bound)=0
 updates the lower bound of the domain of the variable
Operators
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

IContinuousVariableoperator= (const IContinuousVariable &from)
 copy operator
IContinuousVariableoperator= (IContinuousVariable &&from)
 move operator
void copy_ (const Variable &aRV)
 protected copy

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.

Detailed Description

A base class for continuous variables, independent of the GUM_SCALAR type.

Definition at line 66 of file IContinuousVariable.h.

Constructor & Destructor Documentation

◆ IContinuousVariable() [1/3]

gum::IContinuousVariable::IContinuousVariable ( const std::string & aName,
const std::string & aDesc )

Default constructor.

Referenced by IContinuousVariable(), IContinuousVariable(), clone(), operator=(), and operator=().

Here is the caller graph for this function:

◆ IContinuousVariable() [2/3]

gum::IContinuousVariable::IContinuousVariable ( const IContinuousVariable & from)

Copy Constructor.

If from has any listener, it will not be copied.

Parameters
fromthe variable we copy

References IContinuousVariable().

Here is the call graph for this function:

◆ IContinuousVariable() [3/3]

gum::IContinuousVariable::IContinuousVariable ( IContinuousVariable && from)

move constructor

References IContinuousVariable().

Here is the call graph for this function:

◆ ~IContinuousVariable()

virtual gum::IContinuousVariable::~IContinuousVariable ( )
virtual

destructor

Member Function Documentation

◆ _checkSameDomain_()

virtual bool gum::Variable::_checkSameDomain_ ( const Variable & aRV) const
privatepure virtualinherited

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().

Here is the call graph for this function:

◆ clone()

virtual IContinuousVariable * gum::IContinuousVariable::clone ( ) const
pure virtual

Copy Factory.

Implements gum::Variable.

Implemented in gum::ContinuousVariable< GUM_SCALAR >.

References IContinuousVariable().

Here is the call graph for this function:

◆ copy_()

void gum::Variable::copy_ ( const Variable & aRV)
protectedinherited

protected copy

Parameters
aRVto be copied

References Variable().

Here is the call graph for this function:

◆ description()

const std::string & gum::Variable::description ( ) const
inherited

returns the description of the variable

◆ domain()

virtual std::string gum::Variable::domain ( ) const
pure virtualinherited

◆ lowerBoundAsDouble()

virtual double gum::IContinuousVariable::lowerBoundAsDouble ( ) const
pure virtual

returns the lower bound of the domain of the variable as a double

Implemented in gum::ContinuousVariable< GUM_SCALAR >.

◆ name()

const std::string & gum::Variable::name ( ) const
inherited

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().

◆ operator=() [1/2]

IContinuousVariable & gum::IContinuousVariable::operator= ( const IContinuousVariable & from)
protected

copy operator

References IContinuousVariable().

Here is the call graph for this function:

◆ operator=() [2/2]

IContinuousVariable & gum::IContinuousVariable::operator= ( IContinuousVariable && from)
protected

move operator

References IContinuousVariable().

Here is the call graph for this function:

◆ operator==()

bool gum::Variable::operator== ( const Variable & aRV) const
inherited

equality operator

References Variable().

Here is the call graph for this function:

◆ 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
theValue

◆ setLowerBoundFromDouble()

virtual void gum::IContinuousVariable::setLowerBoundFromDouble ( const double new_bound)
pure virtual

updates the lower bound of the domain of the variable

Exceptions
OutOfBoundsis raised if the new bound is higher than the current upper bound.

Implemented in gum::ContinuousVariable< GUM_SCALAR >.

◆ setName()

void gum::Variable::setName ( const std::string & theValue)
inherited

sets the name of the variable

Parameters
theValue

◆ setUpperBoundFromDouble()

virtual void gum::IContinuousVariable::setUpperBoundFromDouble ( const double new_bound)
pure virtual

updates the lower bound of the domain of the variable

Exceptions
OutOfBoundsis raised if the new bound is lower than the current lower bound

Implemented in gum::ContinuousVariable< GUM_SCALAR >.

◆ upperBoundAsDouble()

virtual double gum::IContinuousVariable::upperBoundAsDouble ( ) const
pure virtual

returns the upper bound of the domain of the variable as a double

Implemented in gum::ContinuousVariable< GUM_SCALAR >.

◆ varType()

virtual VarType gum::Variable::varType ( ) const
pure virtualinherited

Member Data Documentation

◆ _description_

std::string gum::Variable::_description_
mutableprivateinherited

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.

◆ _name_

std::string gum::Variable::_name_
privateinherited

the name of the variable

Definition at line 160 of file variable.h.


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