107 new_strategy->triangulation_ = tr;
111 new_strategy->setTriangulation(tr);
165 "No triangulation has been assigned to "
166 "the DefaultJunctionTreeStrategy")
180 const std::vector< NodeId >& elim_order =
triangulation_->eliminationOrder();
182 auto size = elim_order.size();
183 std::vector< NodeId > substitution(size);
184 std::iota(substitution.begin(), substitution.end(), 0);
193 for (
auto i = size; i >= 1; --i) {
201 if ((C_i > C_jj) && !mark[
Edge(C_jj, C_i)]
217 substitution[C_i] = C_j;
224 for (std::size_t i = 0; i < size; ++i)
225 substitution[i] = substitution[substitution[i]];
An algorithm producing a junction given the elimination tree produced by a triangulation algorithm.
virtual const NodeProperty< NodeId > & createdCliques() final
returns, for each node, the clique of the junction tree which was created by its deletion
bool _has_junction_tree_
a boolean indicating whether the junction tree has been constructed
virtual ~DefaultJunctionTreeStrategy()
destructor
virtual DefaultJunctionTreeStrategy * newFactory() const final
create a clone not assigned to any triangulation algorithm
DefaultJunctionTreeStrategy()
default constructor
virtual DefaultJunctionTreeStrategy * copyFactory(StaticTriangulation *triangulation=nullptr) const final
virtual copy constructor
NodeProperty< NodeId > _node_2_junction_clique_
indicates which clique of the junction tree was created by the elimination of a given node (the key o...
void _computeJunctionTree_()
computes a junction tree from an elimination tree
CliqueGraph _junction_tree_
the junction tree computed by the algorithm
virtual void setTriangulation(StaticTriangulation *triangulation) final
assigns the triangulation to the junction tree strategy
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 t...
virtual bool requiresFillIns() const final
indicates whether the junction tree strategy needs fill-ins to work properly
virtual void clear() final
resets the current junction tree strategy data structures
virtual const CliqueGraph & junctionTree() final
returns the junction tree computed
The base class for all undirected edges.
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
JunctionTreeStrategy()
default constructor
StaticTriangulation * triangulation_
the triangulation to which the junction tree is associated
base class for all non-incremental triangulation methods
const UndiGraph * originalGraph() const
returns the graph to be triangulated
Exception : a looked-for element could not be found.
An algorithms producing a junction given the elimination tree produced by the triangulation algorithm...
#define GUM_ERROR(type, msg)
Size NodeId
Type for node ids.
HashTable< Edge, VAL > EdgeProperty
Property on graph elements.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
gum is the global namespace for all aGrUM entities
base class for all non-incremental triangulations.