![]() |
aGrUM
0.16.0
|
This class represent the dependencies of all classes in a PRM<GUM_SCALAR>. More...
#include <agrum/PRM/classDependencyGraph.h>
Public Member Functions | |
Constructors and Destructor. | |
ClassDependencyGraph (const PRM< GUM_SCALAR > &prm) | |
Default constructor. More... | |
ClassDependencyGraph (const ClassDependencyGraph< GUM_SCALAR > &source) | |
Copy constructor. More... | |
~ClassDependencyGraph () | |
Destructor. More... | |
Getters & setters. | |
const DAG & | dag () const |
Returns a constant reference over the graph of the DAG representing the ClassDependencyGraph<GUM_SCALAR>. More... | |
const EltPair & | get (NodeId id) const |
Returns a constant reference over the element assiociated with the node id in the ClassDependencyGraph<GUM_SCALAR>. More... | |
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. More... | |
const NodeProperty< Size > & | modalities () const |
Returns a mapping between the ClassDependencyGraph<GUM_SCALAR>'s nodes and their modalities. More... | |
Public Types | |
typedef std::pair< const PRMClassElementContainer< GUM_SCALAR > *, const PRMClassElement< GUM_SCALAR > *> | EltPair |
Association between a class element and it's holding class. More... | |
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 47 of file classDependencyGraph.h.
typedef std::pair< const PRMClassElementContainer< GUM_SCALAR >*, const PRMClassElement< GUM_SCALAR >* > gum::prm::ClassDependencyGraph< GUM_SCALAR >::EltPair |
Association between a class element and it's holding class.
Definition at line 52 of file classDependencyGraph.h.
|
private |
Code shortcut.
Definition at line 139 of file classDependencyGraph.h.
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 107 of file classDependencyGraph_tpl.h.
INLINE gum::prm::ClassDependencyGraph< GUM_SCALAR >::ClassDependencyGraph | ( | const ClassDependencyGraph< GUM_SCALAR > & | source | ) |
Copy constructor.
Definition at line 114 of file classDependencyGraph_tpl.h.
References gum::prm::ClassDependencyGraph< GUM_SCALAR >::__node_map, and gum::HashTable< Key, Val, Alloc >::insert().
gum::prm::ClassDependencyGraph< GUM_SCALAR >::~ClassDependencyGraph | ( | ) |
Destructor.
Definition at line 36 of file classDependencyGraph_tpl.h.
|
private |
Add arcs in __graph.
Definition at line 76 of file classDependencyGraph_tpl.h.
References gum::prm::PRMClassElementContainer< GUM_SCALAR >::containerDag(), gum::prm::PRMSlotChain< GUM_SCALAR >::end(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), and gum::prm::PRMSlotChain< GUM_SCALAR >::lastElt().
|
private |
Add nodes in __graph while updating consequently all the mappings.
Definition at line 153 of file classDependencyGraph_tpl.h.
References gum::prm::ClassDependencyGraph< GUM_SCALAR >::__elt_map, gum::prm::ClassDependencyGraph< GUM_SCALAR >::__graph, gum::prm::ClassDependencyGraph< GUM_SCALAR >::__modalitites, gum::prm::ClassDependencyGraph< GUM_SCALAR >::__node_map, gum::NodeGraphPart::addNode(), gum::prm::PRMClassElement< GUM_SCALAR >::elt_type(), gum::HashTable< Key, Val, Alloc >::insert(), and gum::prm::PRMClassElement< GUM_SCALAR >::type().
|
private |
Build the class dependency graph.
Definition at line 48 of file classDependencyGraph_tpl.h.
References gum::prm::PRM< GUM_SCALAR >::classes(), and gum::prm::PRM< GUM_SCALAR >::interfaces().
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 129 of file classDependencyGraph_tpl.h.
References gum::prm::ClassDependencyGraph< GUM_SCALAR >::__graph.
Referenced by gum::prm::SVED< GUM_SCALAR >::__initElimOrder(), and gum::prm::SVE< GUM_SCALAR >::__initElimOrder().
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 135 of file classDependencyGraph_tpl.h.
References gum::prm::ClassDependencyGraph< GUM_SCALAR >::__elt_map.
Referenced by gum::prm::SVED< GUM_SCALAR >::__initElimOrder(), and gum::prm::SVE< 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 140 of file classDependencyGraph_tpl.h.
References gum::prm::ClassDependencyGraph< GUM_SCALAR >::__node_map.
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 148 of file classDependencyGraph_tpl.h.
References gum::prm::ClassDependencyGraph< GUM_SCALAR >::__modalitites.
|
private |
Mapping between the nodes in __graph with the PRMClassElement<GUM_SCALAR> in the PRM<GUM_SCALAR>.
Definition at line 133 of file classDependencyGraph.h.
Referenced by gum::prm::ClassDependencyGraph< GUM_SCALAR >::__addNode(), and gum::prm::ClassDependencyGraph< GUM_SCALAR >::get().
|
private |
The graph itself.
Definition at line 119 of file classDependencyGraph.h.
Referenced by gum::prm::ClassDependencyGraph< GUM_SCALAR >::__addNode(), and gum::prm::ClassDependencyGraph< GUM_SCALAR >::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 126 of file classDependencyGraph.h.
Referenced by gum::prm::ClassDependencyGraph< GUM_SCALAR >::__addNode(), and gum::prm::ClassDependencyGraph< GUM_SCALAR >::modalities().
|
private |
Map each Class to a HashTable mapping the Class's ClassElements to their assigned NodeId in __graph.
Definition at line 144 of file classDependencyGraph.h.
Referenced by gum::prm::ClassDependencyGraph< GUM_SCALAR >::__addNode(), gum::prm::ClassDependencyGraph< GUM_SCALAR >::ClassDependencyGraph(), and gum::prm::ClassDependencyGraph< GUM_SCALAR >::get().