![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
An algorithm producing a junction given the elimination tree produced by a triangulation algorithm. More...
#include <defaultJunctionTreeStrategy.h>
Public Member Functions | |
Constructors / Destructors | |
| DefaultJunctionTreeStrategy () | |
| default constructor | |
| DefaultJunctionTreeStrategy (const DefaultJunctionTreeStrategy &from) | |
| copy constructor | |
| DefaultJunctionTreeStrategy (DefaultJunctionTreeStrategy &&from) | |
| move constructor | |
| virtual | ~DefaultJunctionTreeStrategy () |
| destructor | |
| virtual DefaultJunctionTreeStrategy * | newFactory () const final |
| create a clone not assigned to any triangulation algorithm | |
| virtual DefaultJunctionTreeStrategy * | copyFactory (StaticTriangulation *triangulation=nullptr) const final |
| virtual copy constructor | |
Accessors / Modifiers | |
| virtual bool | requiresFillIns () const final |
| indicates whether the junction tree strategy needs fill-ins to work properly | |
| virtual const CliqueGraph & | junctionTree () final |
| returns the junction tree computed | |
| virtual void | setTriangulation (StaticTriangulation *triangulation) final |
| assigns the triangulation to the junction tree strategy | |
| virtual const NodeProperty< NodeId > & | createdCliques () final |
| returns, for each node, the clique of the junction tree which was created by its deletion | |
| virtual NodeId | createdClique (const NodeId id) final |
| returns the Id of the clique of the junction tree created by the elimination of a given node during the triangulation process | |
| virtual void | clear () final |
| resets the current junction tree strategy data structures | |
Accessors / Modifiers | |
| virtual void | moveTriangulation (StaticTriangulation *triangulation) |
| assigns a new triangulation to the junction tree strategy during a move construction | |
Protected Attributes | |
| StaticTriangulation * | triangulation_ {nullptr} |
| the triangulation to which the junction tree is associated | |
Private Member Functions | |
| void | _computeJunctionTree_ () |
| computes a junction tree from an elimination tree | |
Private Attributes | |
| bool | _has_junction_tree_ {false} |
| a boolean indicating whether the junction tree has been constructed | |
| CliqueGraph | _junction_tree_ |
| the junction tree computed by the algorithm | |
| NodeProperty< NodeId > | _node_2_junction_clique_ |
| indicates which clique of the junction tree was created by the elimination of a given node (the key of the table) | |
An algorithm producing a junction given the elimination tree produced by a triangulation algorithm.
Definition at line 63 of file defaultJunctionTreeStrategy.h.
| gum::DefaultJunctionTreeStrategy::DefaultJunctionTreeStrategy | ( | ) |
default constructor
Definition at line 59 of file defaultJunctionTreeStrategy.cpp.
References DefaultJunctionTreeStrategy().
Referenced by DefaultJunctionTreeStrategy(), DefaultJunctionTreeStrategy(), DefaultJunctionTreeStrategy(), ~DefaultJunctionTreeStrategy(), copyFactory(), and newFactory().
| gum::DefaultJunctionTreeStrategy::DefaultJunctionTreeStrategy | ( | const DefaultJunctionTreeStrategy & | from | ) |
copy constructor
Definition at line 64 of file defaultJunctionTreeStrategy.cpp.
References DefaultJunctionTreeStrategy(), gum::JunctionTreeStrategy::JunctionTreeStrategy(), _has_junction_tree_, _junction_tree_, and _node_2_junction_clique_.
| gum::DefaultJunctionTreeStrategy::DefaultJunctionTreeStrategy | ( | DefaultJunctionTreeStrategy && | from | ) |
move constructor
Definition at line 73 of file defaultJunctionTreeStrategy.cpp.
References DefaultJunctionTreeStrategy(), gum::JunctionTreeStrategy::JunctionTreeStrategy(), _has_junction_tree_, _junction_tree_, and _node_2_junction_clique_.
|
virtual |
destructor
Definition at line 81 of file defaultJunctionTreeStrategy.cpp.
References DefaultJunctionTreeStrategy().
|
private |
computes a junction tree from an elimination tree
Definition at line 160 of file defaultJunctionTreeStrategy.cpp.
References _has_junction_tree_, _junction_tree_, _node_2_junction_clique_, GUM_ERROR, gum::HashTable< Key, Val >::insert(), and gum::JunctionTreeStrategy::triangulation_.
Referenced by createdClique(), createdCliques(), and junctionTree().
|
finalvirtual |
resets the current junction tree strategy data structures
Implements gum::JunctionTreeStrategy.
Definition at line 153 of file defaultJunctionTreeStrategy.cpp.
References _has_junction_tree_, _junction_tree_, and _node_2_junction_clique_.
Referenced by setTriangulation().
|
finalvirtual |
virtual copy constructor
| triangulation | if triangulation is different from nullptr, this becomes the new triangulation algorithm associated with the junction tree strategy |
Implements gum::JunctionTreeStrategy.
Definition at line 93 of file defaultJunctionTreeStrategy.cpp.
References DefaultJunctionTreeStrategy(), gum::StaticTriangulation::originalGraph(), and gum::JunctionTreeStrategy::triangulation_.
returns the Id of the clique of the junction tree created by the elimination of a given node during the triangulation process
| id | the id of the node in the original undirected graph whose created clique's id is looked for |
| UndefinedElement | is raised if no triangulation has been assigned to the DefaultJunctionTreeStrategy |
Implements gum::JunctionTreeStrategy.
Definition at line 137 of file defaultJunctionTreeStrategy.cpp.
References _computeJunctionTree_(), _has_junction_tree_, and _node_2_junction_clique_.
|
finalvirtual |
returns, for each node, the clique of the junction tree which was created by its deletion
| UndefinedElement | is raised if no triangulation has been assigned to the DefaultJunctionTreeStrategy |
Implements gum::JunctionTreeStrategy.
Definition at line 128 of file defaultJunctionTreeStrategy.cpp.
References _computeJunctionTree_(), _has_junction_tree_, and _node_2_junction_clique_.
|
finalvirtual |
returns the junction tree computed
The idea behind this method is that the JunctionTreeStrategy asks its assigned triangulation (see method setTriangulation) all the data it needs to compute correctly the junction tree. For instance, it may asks for a triangulated graph or an elimination tree, or even the order of elimination of the nodes, etc. All these data are available from the triangulation class. Knowing these data, the junctionTreeStrategy computes and returns a junction tree corresponding to the triangulated graph.
| UndefinedElement | is raised if no triangulation has been assigned to the DefaultJunctionTreeStrategy |
Implements gum::JunctionTreeStrategy.
Definition at line 145 of file defaultJunctionTreeStrategy.cpp.
References _computeJunctionTree_(), _has_junction_tree_, and _junction_tree_.
|
virtualinherited |
assigns a new triangulation to the junction tree strategy during a move construction
Definition at line 80 of file junctionTreeStrategy.cpp.
References triangulation_.
|
finalvirtual |
create a clone not assigned to any triangulation algorithm
Implements gum::JunctionTreeStrategy.
Definition at line 87 of file defaultJunctionTreeStrategy.cpp.
References DefaultJunctionTreeStrategy().
|
finalvirtual |
indicates whether the junction tree strategy needs fill-ins to work properly
If the junctionTreeStrategy needs fill-ins to work properly, its assigned triangulation instance (see method setTriangulation) will be commited to compute them.
Implements gum::JunctionTreeStrategy.
Definition at line 119 of file defaultJunctionTreeStrategy.cpp.
|
finalvirtual |
assigns the triangulation to the junction tree strategy
| the | triangulation whose resulting cliques will be used to construct the junction tree |
Implements gum::JunctionTreeStrategy.
Definition at line 122 of file defaultJunctionTreeStrategy.cpp.
References clear(), and gum::JunctionTreeStrategy::triangulation_.
|
private |
a boolean indicating whether the junction tree has been constructed
Definition at line 149 of file defaultJunctionTreeStrategy.h.
Referenced by DefaultJunctionTreeStrategy(), DefaultJunctionTreeStrategy(), _computeJunctionTree_(), clear(), createdClique(), createdCliques(), and junctionTree().
|
private |
the junction tree computed by the algorithm
Definition at line 152 of file defaultJunctionTreeStrategy.h.
Referenced by DefaultJunctionTreeStrategy(), DefaultJunctionTreeStrategy(), _computeJunctionTree_(), clear(), and junctionTree().
|
private |
indicates which clique of the junction tree was created by the elimination of a given node (the key of the table)
Definition at line 156 of file defaultJunctionTreeStrategy.h.
Referenced by DefaultJunctionTreeStrategy(), DefaultJunctionTreeStrategy(), _computeJunctionTree_(), clear(), createdClique(), and createdCliques().
|
protectedinherited |
the triangulation to which the junction tree is associated
Definition at line 136 of file junctionTreeStrategy.h.
Referenced by JunctionTreeStrategy(), JunctionTreeStrategy(), gum::DefaultJunctionTreeStrategy::_computeJunctionTree_(), gum::DefaultJunctionTreeStrategy::copyFactory(), moveTriangulation(), and gum::DefaultJunctionTreeStrategy::setTriangulation().