![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
class for graph triangulations for which we enforce a given partial ordering on the nodes eliminations, that is, the set of all the nodes is divided into several subsets. More...
#include <partialOrderedTriangulation.h>
Public Member Functions | |
Constructors / Destructors | |
PartialOrderedTriangulation (const PartialOrderedEliminationSequenceStrategy &elimSeq=DefaultPartialOrderedEliminationSequenceStrategy(), const JunctionTreeStrategy &JTStrategy=DefaultJunctionTreeStrategy(), bool minimality=false) | |
default constructor More... | |
PartialOrderedTriangulation (const UndiGraph *graph, const NodeProperty< Size > *domsizes, const List< NodeSet > *partial_order, const PartialOrderedEliminationSequenceStrategy &elimSeq=DefaultPartialOrderedEliminationSequenceStrategy(), const JunctionTreeStrategy &JTStrategy=DefaultJunctionTreeStrategy(), bool minimality=false) | |
constructor with a given graph More... | |
PartialOrderedTriangulation (const PartialOrderedTriangulation &from) | |
copy constructor More... | |
PartialOrderedTriangulation (PartialOrderedTriangulation &&from) | |
move constructor More... | |
virtual PartialOrderedTriangulation * | newFactory () const |
returns a fresh triangulation (over an empty graph) of the same type as the current object More... | |
virtual PartialOrderedTriangulation * | copyFactory () const final |
virtual copy constructor More... | |
virtual | ~PartialOrderedTriangulation () |
destructor More... | |
Accessors / Modifiers | |
virtual void | setGraph (const UndiGraph *graph, const NodeProperty< Size > *domsizes) final |
initialize the triangulation data structures for a new graph More... | |
virtual void | setPartialOrder (const List< NodeSet > *partial_order) final |
sets the elimination sequence's partial order (only a reference is stored) More... | |
Accessors / Modifiers | |
const EdgeSet & | fillIns () |
returns the fill-ins added by the triangulation algorithm More... | |
const std::vector< NodeId > & | eliminationOrder () |
returns an elimination ordering compatible with the triangulated graph More... | |
Idx | eliminationOrder (const NodeId) |
returns the index of a given node in the elimination order (0 = first node eliminated) More... | |
const NodeProperty< NodeId > & | reverseEliminationOrder () |
returns a table indicating, for each node, at which step it was deleted by the triangulation process More... | |
const UndiGraph & | triangulatedGraph () |
returns the triangulated graph More... | |
const CliqueGraph & | eliminationTree () |
returns the elimination tree of a compatible ordering More... | |
const CliqueGraph & | junctionTree () |
returns a compatible junction tree More... | |
NodeId | createdJunctionTreeClique (const NodeId id) |
returns the Id of the clique of the junction tree created by the elimination of a given node during the triangulation process More... | |
const NodeProperty< NodeId > & | createdJunctionTreeCliques () |
returns the Ids of the cliques of the junction tree created by the elimination of the nodes More... | |
const CliqueGraph & | maxPrimeSubgraphTree () |
returns a junction tree of maximal prime subgraphs More... | |
NodeId | createdMaxPrimeSubgraph (const NodeId id) |
returns the Id of the maximal prime subgraph created by the elimination of a given node during the triangulation process More... | |
void | clear () |
reinitialize the graph to be triangulated to an empty graph More... | |
void | setMinimalRequirement (bool) |
sets/unset the minimality requirement More... | |
virtual bool | isMinimalityRequired () const final |
indicates wether minimality is required More... | |
void | setFillIns (bool) |
sets/unsets the record of the fill-ins in the standard triangulation procedure More... | |
const UndiGraph * | originalGraph () const |
returns the graph to be triangulated More... | |
EliminationSequenceStrategy & | eliminationSequenceStrategy () const |
returns the elimination sequence strategy used by the triangulation More... | |
JunctionTreeStrategy & | junctionTreeStrategy () const |
returns the junction tree strategy used by the triangulation More... | |
Accessors / Modifiers | |
double | maxLog10CliqueDomainSize () |
returns the max of log10DomainSize of the cliques in the junction tree. More... | |
const NodeProperty< Size > * | domainSizes () const |
returns the domain sizes of the variables of the graph to be triangulated More... | |
Protected Attributes | |
const List< NodeSet > * | _partial_order_ {nullptr} |
the partial ordering to apply to eliminate nodes More... | |
EliminationSequenceStrategy * | elimination_sequence_strategy_ {nullptr} |
the elimination sequence strategy used by the triangulation More... | |
JunctionTreeStrategy * | junction_tree_strategy_ {nullptr} |
the junction tree strategy used by the triangulation More... | |
const NodeProperty< Size > * | domain_sizes_ {nullptr} |
the domain sizes of the variables/nodes of the graph More... | |
Protected Member Functions | |
virtual void | initTriangulation_ (UndiGraph &graph) final |
the function called to initialize the triangulation process More... | |
class for graph triangulations for which we enforce a given partial ordering on the nodes eliminations, that is, the set of all the nodes is divided into several subsets.
Within each subset, any ordering can be chosen. But all the nodes of the first subset must be eliminated before the nodes of the second, which must be eliminated before those of the third subset, and so on.
Definition at line 53 of file partialOrderedTriangulation.h.
gum::PartialOrderedTriangulation::PartialOrderedTriangulation | ( | const PartialOrderedEliminationSequenceStrategy & | elimSeq = DefaultPartialOrderedEliminationSequenceStrategy() , |
const JunctionTreeStrategy & | JTStrategy = DefaultJunctionTreeStrategy() , |
||
bool | minimality = false |
||
) |
default constructor
elimSeq | the elimination sequence used to triangulate the graph |
JTStrategy | the junction tree strategy used to create junction trees |
minimality | a Boolean indicating whether we should enforce that the triangulation is minimal w.r.t. inclusion |
Definition at line 36 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::PartialOrderedTriangulation::PartialOrderedTriangulation | ( | const UndiGraph * | graph, |
const NodeProperty< Size > * | domsizes, | ||
const List< NodeSet > * | partial_order, | ||
const PartialOrderedEliminationSequenceStrategy & | elimSeq = DefaultPartialOrderedEliminationSequenceStrategy() , |
||
const JunctionTreeStrategy & | JTStrategy = DefaultJunctionTreeStrategy() , |
||
bool | minimality = false |
||
) |
constructor with a given graph
graph | the graph to be triangulated, i.e., the nodes of which will be eliminated |
domsizes | the domain sizes of the nodes to be eliminated |
partial_order | the list of the subsets constituting the partial ordering |
elimSeq | the elimination sequence used to triangulate the graph |
JTStrategy | the junction tree strategy used to create junction trees |
minimality | a Boolean indicating whether we should enforce that the triangulation is minimal w.r.t. inclusion |
Definition at line 46 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::PartialOrderedTriangulation::PartialOrderedTriangulation | ( | const PartialOrderedTriangulation & | from | ) |
copy constructor
Definition at line 63 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::PartialOrderedTriangulation::PartialOrderedTriangulation | ( | PartialOrderedTriangulation && | from | ) |
move constructor
Definition at line 72 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
virtual |
destructor
Definition at line 92 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
reinitialize the graph to be triangulated to an empty graph
Implements gum::Triangulation.
Definition at line 154 of file staticTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
virtual copy constructor
Implements gum::StaticTriangulation.
Definition at line 87 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
returns the Id of the clique of the junction tree created by the elimination of a given node during the triangulation process
Implements gum::Triangulation.
|
virtualinherited |
returns the Ids of the cliques of the junction tree created by the elimination of the nodes
Implements gum::Triangulation.
returns the Id of the maximal prime subgraph created by the elimination of a given node during the triangulation process
Implements gum::Triangulation.
|
inherited |
returns the domain sizes of the variables of the graph to be triangulated
|
virtualinherited |
returns an elimination ordering compatible with the triangulated graph
Implements gum::Triangulation.
returns the index of a given node in the elimination order (0 = first node eliminated)
Implements gum::Triangulation.
|
inherited |
returns the elimination sequence strategy used by the triangulation
|
virtualinherited |
returns the elimination tree of a compatible ordering
Implements gum::Triangulation.
|
virtualinherited |
returns the fill-ins added by the triangulation algorithm
Implements gum::Triangulation.
Definition at line 653 of file staticTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
finalprotectedvirtual |
the function called to initialize the triangulation process
This function is called when the triangulation process starts and is used to initialize the elimination sequence strategy. Actually, the graph that is modified by the triangulation algorithm is a copy of the original graph, and this copy need be known by the elimination sequence strategy. initTriangulation_ is used to transmit this knowledge to the elimination sequence (through method setGraph of the elimination sequence class).
graph | the very graph that is triangulated (this is a copy of original_graph_) |
Reimplemented from gum::StaticTriangulation.
Definition at line 113 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
indicates wether minimality is required
|
virtualinherited |
returns a compatible junction tree
Implements gum::Triangulation.
|
inherited |
returns the junction tree strategy used by the triangulation
|
inherited |
returns the max of log10DomainSize of the cliques in the junction tree.
This is usefull for instance to estimate the complexity (both in space and in time) of the inference that will use the junction tree.
This method is not 'const' since it can be called before building any junction tree and hence it needs to build it...
Definition at line 64 of file triangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
returns a junction tree of maximal prime subgraphs
Implements gum::Triangulation.
|
virtual |
returns a fresh triangulation (over an empty graph) of the same type as the current object
virtual copy constructor
note that we return a pointer as it enables subclasses to return pointers to their types, not Triangulation pointers. See item 25 of the more effective C++.
Implements gum::StaticTriangulation.
Definition at line 79 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
private |
forbid copy operator
|
inherited |
returns the graph to be triangulated
|
inherited |
returns a table indicating, for each node, at which step it was deleted by the triangulation process
|
inherited |
sets/unsets the record of the fill-ins in the standard triangulation procedure
|
finalvirtual |
initialize the triangulation data structures for a new graph
graph | the graph to be triangulated, i.e., the nodes of which will be eliminated |
domsizes | the domain sizes of the nodes to be eliminated |
sequence | the order in which the nodes should be eliminated |
Reimplemented from gum::StaticTriangulation.
Definition at line 98 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
sets/unset the minimality requirement
|
finalvirtual |
sets the elimination sequence's partial order (only a reference is stored)
sets the sequence of elimination
The elimination sequence is kept outside this class for efficiency reasons.
Definition at line 106 of file partialOrderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
returns the triangulated graph
Implements gum::Triangulation.
Definition at line 466 of file staticTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
the partial ordering to apply to eliminate nodes
Definition at line 159 of file partialOrderedTriangulation.h.
|
protectedinherited |
the domain sizes of the variables/nodes of the graph
Definition at line 150 of file triangulation.h.
|
protectedinherited |
the elimination sequence strategy used by the triangulation
Definition at line 229 of file staticTriangulation.h.
|
protectedinherited |
the junction tree strategy used by the triangulation
Definition at line 232 of file staticTriangulation.h.