![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
class for graph triangulations for which we enforce a given complete ordering on the nodes eliminations. More...
#include <orderedTriangulation.h>
Public Member Functions | |
Constructors / Destructors | |
OrderedTriangulation (const OrderedEliminationSequenceStrategy &elimSeq=OrderedEliminationSequenceStrategy(), const JunctionTreeStrategy &JTStrategy=DefaultJunctionTreeStrategy(), bool minimality=false) | |
default constructor More... | |
OrderedTriangulation (const UndiGraph *graph, const NodeProperty< Size > *domsizes, const std::vector< NodeId > *sequence, const OrderedEliminationSequenceStrategy &elimSeq=OrderedEliminationSequenceStrategy(), const JunctionTreeStrategy &JTStrategy=DefaultJunctionTreeStrategy(), bool minimality=false) | |
constructor with a given graph More... | |
OrderedTriangulation (const OrderedTriangulation &from) | |
copy constructor More... | |
OrderedTriangulation (OrderedTriangulation &&from) | |
move constructor More... | |
virtual OrderedTriangulation * | newFactory () const final |
returns a fresh triangulation over the same graph and of the same type as the current object (using the same sequence, etc.) More... | |
virtual OrderedTriangulation * | copyFactory () const final |
virtual copy constructor More... | |
virtual | ~OrderedTriangulation () |
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 | setOrder (const std::vector< NodeId > *order) final |
sets the sequence of elimination (only the 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 std::vector< NodeId > * | _order_ {nullptr} |
the elimination sequence to apply 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 complete ordering on the nodes eliminations.
Definition at line 47 of file orderedTriangulation.h.
gum::OrderedTriangulation::OrderedTriangulation | ( | const OrderedEliminationSequenceStrategy & | elimSeq = OrderedEliminationSequenceStrategy() , |
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 orderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::OrderedTriangulation::OrderedTriangulation | ( | const UndiGraph * | graph, |
const NodeProperty< Size > * | domsizes, | ||
const std::vector< NodeId > * | sequence, | ||
const OrderedEliminationSequenceStrategy & | elimSeq = OrderedEliminationSequenceStrategy() , |
||
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 |
sequence | the order in which the nodes should be eliminated |
elimSeq | the elimination sequence used to triangulate the graph. Only a reference/pointer to the sequence passed in argument is kept in the current class. |
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 45 of file orderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::OrderedTriangulation::OrderedTriangulation | ( | const OrderedTriangulation & | from | ) |
copy constructor
Definition at line 61 of file orderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::OrderedTriangulation::OrderedTriangulation | ( | OrderedTriangulation && | from | ) |
move constructor
Definition at line 67 of file orderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
virtual |
destructor
Definition at line 86 of file orderedTriangulation.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 81 of file orderedTriangulation.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 107 of file orderedTriangulation.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.
|
finalvirtual |
returns a fresh triangulation over the same graph and of the same type as the current object (using the same sequence, etc.)
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 74 of file orderedTriangulation.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 92 of file orderedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
sets/unset the minimality requirement
|
finalvirtual |
sets the sequence of elimination (only the reference is stored)
sets the sequence of elimination
The elimination sequence is kept outside this class for efficiency reasons.
Definition at line 100 of file orderedTriangulation.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().
|
protected |
the elimination sequence to apply
Definition at line 151 of file orderedTriangulation.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.