![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Interface for all the triangulation methods. More...
#include <triangulation.h>
Public Member Functions | |
Constructors / Destructors | |
| virtual Triangulation * | newFactory () const =0 |
| returns a fresh triangulation of the same type as the current object but with an empty graph | |
| virtual Triangulation * | copyFactory () const =0 |
| virtual copy constructor | |
| virtual | ~Triangulation () |
| destructor | |
Accessors / Modifiers | |
| virtual void | setGraph (const UndiGraph *graph, const NodeProperty< Size > *domsizes)=0 |
| initialize the triangulation data structures for a new graph | |
| virtual const EdgeSet & | fillIns ()=0 |
| returns the fill-ins added by the triangulation algorithm | |
| virtual const std::vector< NodeId > & | eliminationOrder ()=0 |
| returns an elimination ordering compatible with the triangulated graph | |
| virtual Idx | eliminationOrder (const NodeId)=0 |
| returns the index of a given node in the elimination order (0 = first node eliminated) | |
| virtual const UndiGraph & | triangulatedGraph ()=0 |
| returns the triangulated graph | |
| virtual const CliqueGraph & | eliminationTree ()=0 |
| returns the elimination tree of a compatible ordering | |
| virtual const CliqueGraph & | junctionTree ()=0 |
| returns a compatible junction tree | |
| double | maxLog10CliqueDomainSize () |
| returns the max of log10DomainSize of the cliques in the junction tree. | |
| virtual NodeId | createdJunctionTreeClique (const NodeId id)=0 |
| returns the Id of the clique created by the elimination of a given node during the triangulation process | |
| virtual const NodeProperty< NodeId > & | createdJunctionTreeCliques ()=0 |
| returns the Ids of the cliques of the junction tree created by the elimination of the nodes | |
| virtual const CliqueGraph & | maxPrimeSubgraphTree ()=0 |
| returns a junction tree of maximal prime subgraphs | |
| virtual NodeId | createdMaxPrimeSubgraph (const NodeId id)=0 |
| returns the Id of the maximal prime subgraph created by the elimination of a given node during the triangulation process | |
| virtual void | clear ()=0 |
| reinitialize the graph to be triangulated to an empty graph | |
| const NodeProperty< Size > * | domainSizes () const |
| returns the domain sizes of the variables of the graph to be triangulated | |
Protected Member Functions | |
| Triangulation () | |
| default constructor | |
| Triangulation (const NodeProperty< Size > *domsizes) | |
| constructor with a domain size specified | |
| Triangulation (const Triangulation &) | |
| prevent copy constructor except when using newFactory | |
| Triangulation (Triangulation &&) | |
| prevent move constructor except when used by children | |
Protected Attributes | |
| const NodeProperty< Size > * | domain_sizes_ {nullptr} |
| the domain sizes of the variables/nodes of the graph | |
Private Member Functions | |
| Triangulation & | operator= (const Triangulation &) |
| prevent copy operator | |
Interface for all the triangulation methods.
Definition at line 66 of file triangulation.h.
|
virtual |
destructor
Definition at line 71 of file triangulation.cpp.
References Triangulation().
|
protected |
default constructor
Definition at line 61 of file triangulation.cpp.
References Triangulation().
Referenced by gum::StaticTriangulation::StaticTriangulation(), gum::StaticTriangulation::StaticTriangulation(), gum::StaticTriangulation::StaticTriangulation(), Triangulation(), Triangulation(), Triangulation(), Triangulation(), ~Triangulation(), copyFactory(), newFactory(), and operator=().
|
protected |
constructor with a domain size specified
Definition at line 66 of file triangulation.cpp.
References Triangulation(), and domain_sizes_.
|
protected |
prevent copy constructor except when using newFactory
Definition at line 76 of file triangulation.cpp.
References Triangulation(), and domain_sizes_.
|
protected |
prevent move constructor except when used by children
Definition at line 81 of file triangulation.cpp.
References Triangulation(), and domain_sizes_.
|
pure virtual |
reinitialize the graph to be triangulated to an empty graph
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
|
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++.
Implemented in gum::DefaultTriangulation, gum::IncrementalTriangulation, gum::OrderedTriangulation, gum::PartialOrderedTriangulation, gum::StaticTriangulation, and gum::UnconstrainedTriangulation.
References Triangulation().
returns the Id of the clique created by the elimination of a given node during the triangulation process
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
|
pure virtual |
returns the Ids of the cliques of the junction tree created by the elimination of the nodes
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
returns the Id of the maximal prime subgraph created by the elimination of a given node during the triangulation process
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
| const NodeProperty< Size > * gum::Triangulation::domainSizes | ( | ) | const |
returns the domain sizes of the variables of the graph to be triangulated
|
pure virtual |
returns an elimination ordering compatible with the triangulated graph
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
returns the index of a given node in the elimination order (0 = first node eliminated)
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
|
pure virtual |
returns the elimination tree of a compatible ordering
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
|
pure virtual |
returns the fill-ins added by the triangulation algorithm
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
|
pure virtual |
returns a compatible junction tree
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
Referenced by maxLog10CliqueDomainSize().
| double gum::Triangulation::maxLog10CliqueDomainSize | ( | ) |
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 86 of file triangulation.cpp.
References gum::CliqueGraph::clique(), domain_sizes_, and junctionTree().
Referenced by gum::MaxInducedWidthMCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_checkConditions_().
|
pure virtual |
returns a junction tree of maximal prime subgraphs
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
|
pure virtual |
returns a fresh triangulation of the same type as the current object but with an empty graph
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++.
Implemented in gum::DefaultTriangulation, gum::IncrementalTriangulation, gum::OrderedTriangulation, gum::PartialOrderedTriangulation, gum::StaticTriangulation, and gum::UnconstrainedTriangulation.
References Triangulation().
|
private |
|
pure virtual |
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 |
Implemented in gum::IncrementalTriangulation, gum::OrderedTriangulation, gum::PartialOrderedTriangulation, and gum::StaticTriangulation.
|
pure virtual |
returns the triangulated graph
Implemented in gum::IncrementalTriangulation, and gum::StaticTriangulation.
|
protected |
the domain sizes of the variables/nodes of the graph
Definition at line 170 of file triangulation.h.
Referenced by Triangulation(), Triangulation(), Triangulation(), gum::OrderedTriangulation::initTriangulation_(), gum::PartialOrderedTriangulation::initTriangulation_(), gum::StaticTriangulation::initTriangulation_(), maxLog10CliqueDomainSize(), and gum::StaticTriangulation::setGraph().