![]() |
aGrUM
0.17.2
a C++ library for (probabilistic) graphical models
|
Virtual base class for probabilistic graphical models. More...
#include <graphicalModel.h>
Public Member Functions | |
double | log10DomainSize () const |
Constructors / Destructors | |
GraphicalModel () | |
Default constructor. More... | |
virtual | ~GraphicalModel () |
Destructor. More... | |
GraphicalModel (const GraphicalModel &source) | |
Copy constructor. More... | |
Getter and setters | |
const std::string & | property (const std::string &name) const |
Return the value of the property name of this GraphicalModel. More... | |
const std::string & | propertyWithDefault (const std::string &name, const std::string &byDefault) const |
Return the value of the property name of this GraphicalModel. More... | |
void | setProperty (const std::string &name, const std::string &value) |
Add or change a property of this GraphicalModel. More... | |
Variable manipulation methods. | |
virtual const VariableNodeMap & | variableNodeMap () const =0 |
Returns a constant reference to the VariableNodeMap of this Graphical Model. More... | |
virtual Size | size () const =0 |
Returns the number of variables in this Directed Graphical Model. More... | |
virtual bool | empty () const |
Retursn true if this Directed Graphical Model is empty. More... | |
virtual const NodeGraphPart & | nodes () const =0 |
Returns a constant reference to the VariableNodeMap of this Graphical Model. More... | |
Instantiation | completeInstantiation () const |
Get an instantiation over all the variables of the model. More... | |
virtual const DiscreteVariable & | variable (NodeId id) const =0 |
Returns a constant reference over a variable given it's node id. More... | |
virtual NodeId | nodeId (const DiscreteVariable &var) const =0 |
Return id node src discrete var pointer. More... | |
virtual NodeId | idFromName (const std::string &name) const =0 |
Getter by name. More... | |
virtual const DiscreteVariable & | variableFromName (const std::string &name) const =0 |
Getter by name. More... | |
Protected Member Functions | |
GraphicalModel & | operator= (const GraphicalModel &source) |
Private copy operator. More... | |
Virtual base class for probabilistic graphical models.
Definition at line 48 of file graphicalModel.h.
gum::GraphicalModel::GraphicalModel | ( | ) |
Default constructor.
Definition at line 30 of file graphicalModel.cpp.
|
virtual |
Destructor.
Definition at line 44 of file graphicalModel.cpp.
References __propertiesMap.
gum::GraphicalModel::GraphicalModel | ( | const GraphicalModel & | source | ) |
Copy constructor.
Do nothing.
Definition at line 34 of file graphicalModel.cpp.
References __propertiesMap.
|
private |
Return the properties of this Directed Graphical Model and initialize the hash table is necessary.
Definition at line 47 of file graphicalModel_inl.h.
References __propertiesMap.
Referenced by property(), propertyWithDefault(), and setProperty().
INLINE Instantiation gum::GraphicalModel::completeInstantiation | ( | ) | const |
Get an instantiation over all the variables of the model.
Definition at line 85 of file graphicalModel_inl.h.
References nodes(), and variable().
|
virtual |
Retursn true if this Directed Graphical Model is empty.
Definition at line 95 of file graphicalModel_inl.h.
References size().
|
pure virtual |
Getter by name.
NotFound | if no such name exists in the graph. |
Implemented in gum::BayesNet< GUM_SCALAR >, gum::BayesNet< double >, gum::InfluenceDiagram< GUM_SCALAR >, gum::BayesNetFragment< GUM_SCALAR >, gum::IMarkovNet< GUM_SCALAR >, gum::IBayesNet< GUM_SCALAR >, gum::IBayesNet< double >, gum::prm::ClassBayesNet< GUM_SCALAR >, gum::DAGmodel, gum::UGmodel, and gum::prm::InstanceBayesNet< GUM_SCALAR >.
INLINE double gum::GraphicalModel::log10DomainSize | ( | ) | const |
Definition at line 74 of file graphicalModel_inl.h.
References nodes(), and variable().
Referenced by gum::InfluenceDiagram< GUM_SCALAR >::toString(), and gum::IMarkovNet< GUM_SCALAR >::toString().
|
pure virtual |
Return id node src discrete var pointer.
NotFound | If no variable matches var. |
Implemented in gum::BayesNet< GUM_SCALAR >, gum::BayesNet< double >, gum::InfluenceDiagram< GUM_SCALAR >, gum::BayesNetFragment< GUM_SCALAR >, gum::IMarkovNet< GUM_SCALAR >, gum::IBayesNet< GUM_SCALAR >, gum::IBayesNet< double >, gum::prm::ClassBayesNet< GUM_SCALAR >, gum::DAGmodel, gum::UGmodel, and gum::prm::InstanceBayesNet< GUM_SCALAR >.
|
pure virtual |
Returns a constant reference to the VariableNodeMap of this Graphical Model.
Implemented in gum::DAGmodel, and gum::UGmodel.
Referenced by completeInstantiation(), and log10DomainSize().
|
protected |
Private copy operator.
Definition at line 49 of file graphicalModel.cpp.
References __propertiesMap.
Referenced by gum::UGmodel::operator=(), and gum::DAGmodel::operator=().
INLINE const std::string & gum::GraphicalModel::property | ( | const std::string & | name | ) | const |
Return the value of the property name of this GraphicalModel.
NotFound | Raised if no name property is found. |
Definition at line 37 of file graphicalModel_inl.h.
References __properties(), and GUM_ERROR.
Referenced by gum::InfluenceDiagram< GUM_SCALAR >::toDot().
INLINE const std::string & gum::GraphicalModel::propertyWithDefault | ( | const std::string & | name, |
const std::string & | byDefault | ||
) | const |
Return the value of the property name of this GraphicalModel.
return byDefault if the property name is not found
Definition at line 57 of file graphicalModel_inl.h.
References __properties().
INLINE void gum::GraphicalModel::setProperty | ( | const std::string & | name, |
const std::string & | value | ||
) |
Add or change a property of this GraphicalModel.
Definition at line 65 of file graphicalModel_inl.h.
References __properties(), and gum::HashTable< Key, Val, Alloc >::insert().
Referenced by gum::BayesNet< double >::fastPrototype(), and gum::IMarkovNet< GUM_SCALAR >::IMarkovNet().
|
pure virtual |
Returns the number of variables in this Directed Graphical Model.
Implemented in gum::DAGmodel, and gum::UGmodel.
Referenced by empty().
|
pure virtual |
Returns a constant reference over a variable given it's node id.
NotFound | If no variable's id matches varId. |
Implemented in gum::BayesNet< GUM_SCALAR >, gum::BayesNet< double >, gum::InfluenceDiagram< GUM_SCALAR >, gum::BayesNetFragment< GUM_SCALAR >, gum::IMarkovNet< GUM_SCALAR >, gum::IBayesNet< GUM_SCALAR >, gum::IBayesNet< double >, gum::prm::ClassBayesNet< GUM_SCALAR >, gum::DAGmodel, gum::UGmodel, and gum::prm::InstanceBayesNet< GUM_SCALAR >.
Referenced by completeInstantiation(), and log10DomainSize().
|
pure virtual |
Getter by name.
NotFound | if no such name exists in the graph. |
Implemented in gum::BayesNet< GUM_SCALAR >, gum::BayesNet< double >, gum::InfluenceDiagram< GUM_SCALAR >, gum::BayesNetFragment< GUM_SCALAR >, gum::IMarkovNet< GUM_SCALAR >, gum::IBayesNet< GUM_SCALAR >, gum::IBayesNet< double >, gum::prm::ClassBayesNet< GUM_SCALAR >, gum::DAGmodel, gum::UGmodel, and gum::prm::InstanceBayesNet< GUM_SCALAR >.
|
pure virtual |
Returns a constant reference to the VariableNodeMap of this Graphical Model.
Implemented in gum::BayesNet< GUM_SCALAR >, gum::BayesNet< double >, gum::BayesNetFragment< GUM_SCALAR >, gum::IMarkovNet< GUM_SCALAR >, gum::InfluenceDiagram< GUM_SCALAR >, gum::IBayesNet< GUM_SCALAR >, gum::IBayesNet< double >, gum::prm::ClassBayesNet< GUM_SCALAR >, and gum::prm::InstanceBayesNet< GUM_SCALAR >.
|
mutableprivate |
The properties of this Directed Graphical Model. Initialized using a lazy instantiation.
Definition at line 148 of file graphicalModel.h.
Referenced by __properties(), GraphicalModel(), operator=(), and ~GraphicalModel().