![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Interface for all triangulation methods without constraints on node elimination orderings. More...
#include <unconstrainedTriangulation.h>
Public Member Functions | |
Accessors / Modifiers | |
virtual UnconstrainedTriangulation * | newFactory () const =0 |
returns a fresh triangulation (over an empty graph) of the same type as the current object More... | |
virtual UnconstrainedTriangulation * | copyFactory () const =0 |
virtual copy constructor More... | |
virtual | ~UnconstrainedTriangulation () |
destructor 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 | |
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 | |
Constructors / Destructors | |
UnconstrainedTriangulation (const UnconstrainedEliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false) | |
default constructor More... | |
UnconstrainedTriangulation (const UndiGraph *graph, const NodeProperty< Size > *dom, const UnconstrainedEliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false) | |
constructor with a given graph More... | |
UnconstrainedTriangulation (const UnconstrainedTriangulation &) | |
forbid copy constructor except in newfactory More... | |
UnconstrainedTriangulation (UnconstrainedTriangulation &&) | |
forbid move constructor except in children's constructors More... | |
Accessors / Modifiers | |
virtual void | setGraph (const UndiGraph *graph, const NodeProperty< Size > *domsizes) |
initialize the triangulation data structures for a new graph More... | |
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... | |
virtual void | initTriangulation_ (UndiGraph &graph) |
the function called to initialize the triangulation process More... | |
Interface for all triangulation methods without constraints on node elimination orderings.
Definition at line 44 of file unconstrainedTriangulation.h.
|
virtual |
destructor
Definition at line 71 of file unconstrainedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
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 unconstrainedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
constructor with a given graph
graph | the graph to be triangulated, i.e., the nodes of which will be eliminated |
dom | the domain sizes of the nodes to be eliminated |
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 unconstrainedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
forbid copy constructor except in newfactory
copy constructor
Definition at line 58 of file unconstrainedTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
forbid move constructor except in children's constructors
move constructor
Definition at line 64 of file unconstrainedTriangulation.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().
|
pure virtual |
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.
Implemented in gum::DefaultTriangulation.
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().
|
protectedvirtualinherited |
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 needs 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 in gum::PartialOrderedTriangulation, and gum::OrderedTriangulation.
Definition at line 707 of file staticTriangulation.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.
|
pure virtual |
returns a fresh triangulation (over an empty graph) of the same type as the current object
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.
Implemented in gum::DefaultTriangulation.
|
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
|
virtualinherited |
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 |
Implements gum::Triangulation.
Reimplemented in gum::PartialOrderedTriangulation, and gum::OrderedTriangulation.
Definition at line 505 of file staticTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
sets/unset the minimality requirement
|
virtualinherited |
returns the triangulated graph
Implements gum::Triangulation.
Definition at line 466 of file staticTriangulation.cpp.
References gum::Set< Key, Alloc >::emplace().
|
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.