![]() |
aGrUM
0.16.0
|
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 More... | |
DefaultJunctionTreeStrategy (const DefaultJunctionTreeStrategy &from) | |
copy constructor More... | |
DefaultJunctionTreeStrategy (DefaultJunctionTreeStrategy &&from) | |
move constructor More... | |
virtual | ~DefaultJunctionTreeStrategy () |
destructor More... | |
virtual DefaultJunctionTreeStrategy * | newFactory () const final |
create a clone not assigned to any triangulation algorithm More... | |
virtual DefaultJunctionTreeStrategy * | copyFactory (StaticTriangulation *triangulation=nullptr) const final |
virtual copy constructor More... | |
Accessors / Modifiers | |
virtual bool | requiresFillIns () const final |
indicates whether the junction tree strategy needs fill-ins to work properly More... | |
virtual const CliqueGraph & | junctionTree () final |
returns the junction tree computed More... | |
virtual void | setTriangulation (StaticTriangulation *triangulation) final |
assigns the triangulation to the junction tree strategy More... | |
virtual const NodeProperty< NodeId > & | createdCliques () final |
returns, for each node, the clique of the junction tree which was created by its deletion More... | |
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 More... | |
virtual void | clear () final |
resets the current junction tree strategy data structures More... | |
Accessors / Modifiers | |
virtual void | moveTriangulation (StaticTriangulation *triangulation) |
assigns a new triangulation to the junction tree strategy during a move construction More... | |
Protected Attributes | |
StaticTriangulation * | _triangulation {nullptr} |
the triangulation to which the junction tree is associated More... | |
An algorithm producing a junction given the elimination tree produced by a triangulation algorithm.
Definition at line 44 of file defaultJunctionTreeStrategy.h.
gum::DefaultJunctionTreeStrategy::DefaultJunctionTreeStrategy | ( | ) |
default constructor
Definition at line 39 of file defaultJunctionTreeStrategy.cpp.
Referenced by copyFactory(), and newFactory().
gum::DefaultJunctionTreeStrategy::DefaultJunctionTreeStrategy | ( | const DefaultJunctionTreeStrategy & | from | ) |
copy constructor
Definition at line 45 of file defaultJunctionTreeStrategy.cpp.
gum::DefaultJunctionTreeStrategy::DefaultJunctionTreeStrategy | ( | DefaultJunctionTreeStrategy && | from | ) |
move constructor
Definition at line 56 of file defaultJunctionTreeStrategy.cpp.
|
virtual |
destructor
Definition at line 67 of file defaultJunctionTreeStrategy.cpp.
|
private |
computes a junction tree from an elimination tree
Definition at line 147 of file defaultJunctionTreeStrategy.cpp.
References __has_junction_tree, __junction_tree, __node_2_junction_clique, gum::JunctionTreeStrategy::_triangulation, gum::CliqueGraph::addEdge(), gum::CliqueGraph::clique(), gum::EdgeGraphPart::edgesProperty(), gum::StaticTriangulation::eliminationOrder(), gum::StaticTriangulation::eliminationTree(), gum::CliqueGraph::eraseEdge(), gum::CliqueGraph::eraseNode(), GUM_ERROR, gum::HashTable< Key, Val, Alloc >::insert(), gum::EdgeGraphPart::neighbours(), and gum::Set< Key, Alloc >::size().
Referenced by createdClique(), createdCliques(), and junctionTree().
|
finalvirtual |
resets the current junction tree strategy data structures
Implements gum::JunctionTreeStrategy.
Definition at line 140 of file defaultJunctionTreeStrategy.cpp.
References __has_junction_tree, __junction_tree, __node_2_junction_clique, and gum::CliqueGraph::clear().
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 79 of file defaultJunctionTreeStrategy.cpp.
References gum::JunctionTreeStrategy::_triangulation, DefaultJunctionTreeStrategy(), and gum::StaticTriangulation::originalGraph().
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 124 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 115 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 132 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 63 of file junctionTreeStrategy.cpp.
References gum::JunctionTreeStrategy::_triangulation.
Referenced by gum::StaticTriangulation::StaticTriangulation().
|
finalvirtual |
create a clone not assigned to any triangulation algorithm
Implements gum::JunctionTreeStrategy.
Definition at line 73 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 106 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 109 of file defaultJunctionTreeStrategy.cpp.
References gum::JunctionTreeStrategy::_triangulation, and clear().
|
private |
a boolean indicating whether the junction tree has been constructed
Definition at line 130 of file defaultJunctionTreeStrategy.h.
Referenced by __computeJunctionTree(), clear(), createdClique(), createdCliques(), and junctionTree().
|
private |
the junction tree computed by the algorithm
Definition at line 133 of file defaultJunctionTreeStrategy.h.
Referenced by __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 137 of file defaultJunctionTreeStrategy.h.
Referenced by __computeJunctionTree(), clear(), createdClique(), and createdCliques().
|
protectedinherited |
the triangulation to which the junction tree is associated
Definition at line 118 of file junctionTreeStrategy.h.
Referenced by __computeJunctionTree(), copyFactory(), gum::JunctionTreeStrategy::moveTriangulation(), and setTriangulation().