![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
This class represent the dependencies of all classes in a PRM<GUM_SCALAR>. More...
#include <agrum/PRM/classDependencyGraph.h>
Public Types | |
| using | EltPair |
| Association between a class element and it's holding class. | |
Public Member Functions | |
Constructors and Destructor. | |
| ClassDependencyGraph (const PRM< GUM_SCALAR > &prm) | |
| Default constructor. | |
| ClassDependencyGraph (const ClassDependencyGraph< GUM_SCALAR > &source) | |
| Copy constructor. | |
| ~ClassDependencyGraph () | |
| Destructor. | |
Getters & setters. | |
| const DAG & | dag () const |
| Returns a constant reference over the graph of the DAG representing the ClassDependencyGraph<GUM_SCALAR>. | |
| const EltPair & | get (NodeId id) const |
| Returns a constant reference over the element assiociated with the node id in the ClassDependencyGraph<GUM_SCALAR>. | |
| NodeId | get (const PRMClassElementContainer< GUM_SCALAR > &c, const PRMClassElement< GUM_SCALAR > &elt) const |
| Returns the NodeId assign to the given PRMClassElement<GUM_SCALAR> of a given Class. Is is necessary to give both Class and PRMClassElement<GUM_SCALAR> because inherited PRMClassElement<GUM_SCALAR> are shared in the inheritance hierarchy. | |
| const NodeProperty< Size > & | modalities () const |
| Returns a mapping between the ClassDependencyGraph<GUM_SCALAR>'s nodes and their modalities. | |
Private Types | |
| using | NodeMap |
| Code shortcut. | |
Private Member Functions | |
| void | _buildGraph_ (const PRM< GUM_SCALAR > &prm) |
| Build the class dependency graph. | |
| void | _addNode_ (const PRMClassElementContainer< GUM_SCALAR > *c, const PRMClassElement< GUM_SCALAR > &elt) |
| Add nodes in graph while updating consequently all the mappings. | |
| void | _addArcs_ (const PRMClassElementContainer< GUM_SCALAR > &c, NodeId node, HashTable< const PRMClassElement< GUM_SCALAR > *, NodeId > &map) |
| Add arcs in graph. | |
Private Attributes | |
| DAG | _graph_ |
| The graph itself. | |
| NodeProperty< Size > | _modalitites_ |
| The modalities map for each node in the ClassDependencyGraph<GUM_SCALAR>. This is useful when using a Triangulation class over a ClassDependencyGraph<GUM_SCALAR>. | |
| NodeProperty< EltPair * > | _elt_map_ |
| Mapping between the nodes in graph with the PRMClassElement<GUM_SCALAR> in the PRM<GUM_SCALAR>. | |
| NodeMap | _node_map_ |
| Map each Class to a HashTable mapping the Class's ClassElements to their assigned NodeId in graph. | |
This class represent the dependencies of all classes in a PRM<GUM_SCALAR>.
A Class Dependency Graph does listen to changes in it's PRM<GUM_SCALAR>.
Definition at line 66 of file classDependencyGraph.h.
| using gum::prm::ClassDependencyGraph< GUM_SCALAR >::EltPair |
Association between a class element and it's holding class.
Definition at line 69 of file classDependencyGraph.h.
|
private |
| INLINE gum::prm::ClassDependencyGraph< GUM_SCALAR >::ClassDependencyGraph | ( | const PRM< GUM_SCALAR > & | prm | ) |
Default constructor.
| prm | The PRM<GUM_SCALAR> for which this ClassDependencyGraph<GUM_SCALAR> is constructed. |
Definition at line 123 of file classDependencyGraph_tpl.h.
References ClassDependencyGraph(), and _buildGraph_().
Referenced by ClassDependencyGraph(), ClassDependencyGraph(), and ~ClassDependencyGraph().
| INLINE gum::prm::ClassDependencyGraph< GUM_SCALAR >::ClassDependencyGraph | ( | const ClassDependencyGraph< GUM_SCALAR > & | source | ) |
Copy constructor.
Definition at line 129 of file classDependencyGraph_tpl.h.
References ClassDependencyGraph(), _elt_map_, _graph_, _modalitites_, and _node_map_.
| gum::prm::ClassDependencyGraph< GUM_SCALAR >::~ClassDependencyGraph | ( | ) |
Destructor.
Definition at line 56 of file classDependencyGraph_tpl.h.
References ClassDependencyGraph(), _elt_map_, and _node_map_.
|
private |
Add arcs in graph.
Definition at line 93 of file classDependencyGraph_tpl.h.
References _graph_, _node_map_, gum::ArcGraphPart::children(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::containerDag(), gum::prm::PRMSlotChain< GUM_SCALAR >::end(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), gum::prm::PRMSlotChain< GUM_SCALAR >::lastElt(), gum::prm::PRMClassElement< GUM_SCALAR >::prm_aggregate, gum::prm::PRMClassElement< GUM_SCALAR >::prm_attribute, and gum::prm::PRMClassElement< GUM_SCALAR >::prm_slotchain.
Referenced by _buildGraph_().
|
private |
Add nodes in graph while updating consequently all the mappings.
Definition at line 165 of file classDependencyGraph_tpl.h.
References _elt_map_, _graph_, _modalitites_, _node_map_, gum::DiscreteVariable::domainSize(), gum::prm::PRMClassElement< GUM_SCALAR >::elt_type(), gum::prm::PRMClassElement< GUM_SCALAR >::prm_aggregate, gum::prm::PRMClassElement< GUM_SCALAR >::prm_attribute, gum::prm::PRMClassElement< GUM_SCALAR >::type(), and gum::prm::PRMType::variable().
Referenced by _buildGraph_().
|
private |
Build the class dependency graph.
Definition at line 68 of file classDependencyGraph_tpl.h.
References _addArcs_(), _addNode_(), and _node_map_.
Referenced by ClassDependencyGraph().
| INLINE const DAG & gum::prm::ClassDependencyGraph< GUM_SCALAR >::dag | ( | ) | const |
Returns a constant reference over the graph of the DAG representing the ClassDependencyGraph<GUM_SCALAR>.
Definition at line 142 of file classDependencyGraph_tpl.h.
References _graph_.
Referenced by gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), and gum::prm::SVED< GUM_SCALAR >::_initElimOrder_().
| INLINE NodeId gum::prm::ClassDependencyGraph< GUM_SCALAR >::get | ( | const PRMClassElementContainer< GUM_SCALAR > & | c, |
| const PRMClassElement< GUM_SCALAR > & | elt ) const |
Returns the NodeId assign to the given PRMClassElement<GUM_SCALAR> of a given Class. Is is necessary to give both Class and PRMClassElement<GUM_SCALAR> because inherited PRMClassElement<GUM_SCALAR> are shared in the inheritance hierarchy.
Definition at line 154 of file classDependencyGraph_tpl.h.
References _node_map_.
| INLINE const ClassDependencyGraph< GUM_SCALAR >::EltPair & gum::prm::ClassDependencyGraph< GUM_SCALAR >::get | ( | NodeId | id | ) | const |
Returns a constant reference over the element assiociated with the node id in the ClassDependencyGraph<GUM_SCALAR>.
| NotFound | Raised if no nodes matches id. |
Definition at line 148 of file classDependencyGraph_tpl.h.
References _elt_map_.
Referenced by gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), and gum::prm::SVED< GUM_SCALAR >::_initElimOrder_().
| INLINE const NodeProperty< Size > & gum::prm::ClassDependencyGraph< GUM_SCALAR >::modalities | ( | ) | const |
Returns a mapping between the ClassDependencyGraph<GUM_SCALAR>'s nodes and their modalities.
Definition at line 160 of file classDependencyGraph_tpl.h.
References _modalitites_.
|
private |
Mapping between the nodes in graph with the PRMClassElement<GUM_SCALAR> in the PRM<GUM_SCALAR>.
Definition at line 151 of file classDependencyGraph.h.
Referenced by ClassDependencyGraph(), ~ClassDependencyGraph(), _addNode_(), and get().
|
private |
The graph itself.
Definition at line 137 of file classDependencyGraph.h.
Referenced by ClassDependencyGraph(), _addArcs_(), _addNode_(), and dag().
|
private |
The modalities map for each node in the ClassDependencyGraph<GUM_SCALAR>. This is useful when using a Triangulation class over a ClassDependencyGraph<GUM_SCALAR>.
Definition at line 144 of file classDependencyGraph.h.
Referenced by ClassDependencyGraph(), _addNode_(), and modalities().
|
private |
Map each Class to a HashTable mapping the Class's ClassElements to their assigned NodeId in graph.
Definition at line 160 of file classDependencyGraph.h.
Referenced by ClassDependencyGraph(), ~ClassDependencyGraph(), _addArcs_(), _addNode_(), _buildGraph_(), and get().