107 new_strategy->triangulation_ = tr;
111 new_strategy->setTriangulation(tr);
165 "No triangulation has been assigned to "
166 "the DefaultJunctionTreeStrategy")
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]];
void eraseNode(const NodeId node) override
removes a given clique from the clique graph
void addEdge(NodeId first, NodeId second) override
inserts a new edge between two cliques
void eraseEdge(const Edge &edge) override
removes an edge (and its separator) from the clique graph
void clear() override
removes all the cliques and separators from the graph (as well as their adjacent edges)
const NodeSet & clique(const NodeId idClique) const
returns the set of nodes included into a given clique
An algorithm producing a junction given the elimination tree produced by a triangulation algorithm.
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
~DefaultJunctionTreeStrategy() override
destructor
DefaultJunctionTreeStrategy * newFactory() const final
create a clone not assigned to any triangulation algorithm
DefaultJunctionTreeStrategy()
default constructor
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
void setTriangulation(StaticTriangulation *triangulation) final
assigns the triangulation to the junction tree strategy
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...
bool requiresFillIns() const final
indicates whether the junction tree strategy needs fill-ins to work properly
void clear() final
resets the current junction tree strategy data structures
const CliqueGraph & junctionTree() final
returns the junction tree computed
EdgeProperty< VAL > edgesProperty(VAL(*f)(const Edge &), Size size=0) const
a method to create a hashMap of VAL from a set of edges (using for every edge, say x,...
const NodeSet & neighbours(NodeId id) const
returns the set of node neighbours to a given node
Edge(NodeId aN1, NodeId aN2)
constructs a new edge (aN1,aN2)
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
Size size() const noexcept
Returns the number of elements in the set.
base class for all non-incremental triangulation methods
const UndiGraph * originalGraph() const
returns the graph to be triangulated
const std::vector< NodeId > & eliminationOrder() override
returns an elimination ordering compatible with the triangulated graph
const CliqueGraph & eliminationTree() override
returns the elimination tree of a compatible ordering
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.