![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Class that performs incremental triangulations. More...
#include <incrementalTriangulation.h>
Public Member Functions | |
Constructors / Destructors | |
IncrementalTriangulation (const UnconstrainedTriangulation &triang_algo, const UndiGraph *theGraph, const NodeProperty< Size > *modal) | |
constructor More... | |
IncrementalTriangulation (const UnconstrainedTriangulation &triangAlgo) | |
default constructor: initialize the triangulation with en empty graph More... | |
IncrementalTriangulation (const IncrementalTriangulation &from) | |
copy operator More... | |
~IncrementalTriangulation () | |
destructor More... | |
Accessors / Modifiers | |
void | updateTriangulation () |
updates the triangulated graph using the modif list More... | |
void | addNode (const NodeId node, Size modal) |
adds a new node to the graph More... | |
void | eraseNode (const NodeId node) |
removes a node from the graph (the join tree may need a triangulation update) More... | |
void | addEdge (const NodeId X, const NodeId Y) |
adds a new edge to the graph (the join tree may need a triangulation update) More... | |
void | eraseEdge (const Edge &edge) |
removes an edge from the graph (the join tree may need a retriangulation) 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 number of a given node in the elimination order (0 = first node eliminated) More... | |
const UndiGraph & | triangulatedGraph () |
returns the triangulated graph More... | |
const UndiGraph & | graph () const |
returns the current graph (that which is incrementally triangulated) More... | |
const CliqueGraph & | eliminationTree () |
returns the elimination tree of a compatible ordering More... | |
const CliqueGraph & | junctionTree () |
returns a junction tree corresponding to the current graph More... | |
NodeId | createdJunctionTreeClique (const NodeId id) |
returns the Id of the clique 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 the junction tree of the 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 () |
sets the graph to the empty graph More... | |
void | setGraph (const UndiGraph *theGraph, const NodeProperty< Size > *domain_sizes) |
changes the current graph More... | |
const UnconstrainedTriangulation & | triangulationAlgo () const |
returns the triangulation algorithm (useful for fine tuning it) More... | |
Operators | |
IncrementalTriangulation & | operator= (const IncrementalTriangulation &from) |
copy operator More... | |
virtual IncrementalTriangulation * | newFactory () const final |
virtual clone constructor More... | |
virtual IncrementalTriangulation * | copyFactory () const final |
virtual copy constructor 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 NodeProperty< Size > * | domain_sizes_ {nullptr} |
the domain sizes of the variables/nodes of the graph More... | |
Friends | |
class | gum_tests::IncrementalTriangulationTestSuite |
to enable testunits to use check More... | |
Class that performs incremental triangulations.
Definition at line 50 of file incrementalTriangulation.h.
gum::IncrementalTriangulation::IncrementalTriangulation | ( | const UnconstrainedTriangulation & | triang_algo, |
const UndiGraph * | theGraph, | ||
const NodeProperty< Size > * | modal | ||
) |
gum::IncrementalTriangulation::IncrementalTriangulation | ( | const UnconstrainedTriangulation & | triangAlgo | ) |
default constructor: initialize the triangulation with en empty graph
gum::IncrementalTriangulation::IncrementalTriangulation | ( | const IncrementalTriangulation & | from | ) |
copy operator
gum::IncrementalTriangulation::~IncrementalTriangulation | ( | ) |
destructor
|
private |
checks that the incremental triangulation works properly
|
private |
a collect algorithm to compute elimination orderings
|
private |
a collect algorithm to compute, for each node, one container JT's clique
|
private |
used for computing the junction tree of the maximal prime subgraphs
|
private |
mark the mps affected by the insertion of a new edge
|
private |
mark the mps affected by the deletion of a given edge
|
private |
adds a new node to T_mpd, the graph and the clique graph
|
private |
remove a given node from the T_mpd structure
|
private |
set-up the connected subgraph that needs be retriangulated
|
private |
update the junction tree
|
private |
update the max prime subgraph
adds a new edge to the graph (the join tree may need a triangulation update)
adds a new node to the graph
|
virtual |
sets the graph to the empty graph
Implements gum::Triangulation.
|
finalvirtual |
virtual copy constructor
Implements gum::Triangulation.
returns the Id of the clique created by the elimination of a given node during the triangulation process
Implements gum::Triangulation.
|
virtual |
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
|
virtual |
returns an elimination ordering compatible with the triangulated graph
Implements gum::Triangulation.
returns the number of a given node in the elimination order (0 = first node eliminated)
Implements gum::Triangulation.
|
inlinevirtual |
returns the elimination tree of a compatible ordering
Implements gum::Triangulation.
Definition at line 118 of file incrementalTriangulation.h.
void gum::IncrementalTriangulation::eraseEdge | ( | const Edge & | edge | ) |
removes an edge from the graph (the join tree may need a retriangulation)
void gum::IncrementalTriangulation::eraseNode | ( | const NodeId | node | ) |
removes a node from the graph (the join tree may need a triangulation update)
|
inlinevirtual |
returns the fill-ins added by the triangulation algorithm
Implements gum::Triangulation.
Definition at line 102 of file incrementalTriangulation.h.
const UndiGraph& gum::IncrementalTriangulation::graph | ( | ) | const |
returns the current graph (that which is incrementally triangulated)
|
virtual |
returns a junction tree corresponding to the current graph
Implements gum::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().
|
virtual |
returns the junction tree of the maximal prime subgraphs
Implements gum::Triangulation.
|
finalvirtual |
virtual clone constructor
Implements gum::Triangulation.
IncrementalTriangulation& gum::IncrementalTriangulation::operator= | ( | const IncrementalTriangulation & | from | ) |
copy operator
|
virtual |
changes the current graph
Implements gum::Triangulation.
|
inlinevirtual |
returns the triangulated graph
Implements gum::Triangulation.
Definition at line 112 of file incrementalTriangulation.h.
const UnconstrainedTriangulation& gum::IncrementalTriangulation::triangulationAlgo | ( | ) | const |
returns the triangulation algorithm (useful for fine tuning it)
void gum::IncrementalTriangulation::updateTriangulation | ( | ) |
updates the triangulated graph using the modif list
|
friend |
to enable testunits to use check
Definition at line 263 of file incrementalTriangulation.h.
|
private |
indicate for each MPS its set of cliques in the junction tree
Definition at line 184 of file incrementalTriangulation.h.
|
private |
For each node, a clique that contains it.
Definition at line 211 of file incrementalTriangulation.h.
|
private |
the domain sizes of the nodes
Definition at line 172 of file incrementalTriangulation.h.
|
private |
the current elimination ordering
Definition at line 202 of file incrementalTriangulation.h.
|
private |
the graph that needs be triangulated
Definition at line 169 of file incrementalTriangulation.h.
|
private |
the junction tree computed so far
Definition at line 175 of file incrementalTriangulation.h.
|
private |
the set of MPS affected by a new triangulation
Definition at line 190 of file incrementalTriangulation.h.
|
private |
indicate for each clique the MPS it belongs to
Definition at line 187 of file incrementalTriangulation.h.
|
private |
for each node in graph, store the MPS containing the node
Definition at line 181 of file incrementalTriangulation.h.
|
private |
a Boolean indicating whether we should compute the createdJTCliques
Definition at line 208 of file incrementalTriangulation.h.
|
private |
a Boolean indicating wether we should update the elimination order
Definition at line 199 of file incrementalTriangulation.h.
|
private |
a Boolean indicating whether the triangulation need be updated
Definition at line 196 of file incrementalTriangulation.h.
|
private |
the elimination order (access by NodeId)
Definition at line 205 of file incrementalTriangulation.h.
|
private |
the maximal prime subgraph tree
Definition at line 178 of file incrementalTriangulation.h.
|
private |
the triangulation algorithm that will be used incremantally
Definition at line 193 of file incrementalTriangulation.h.
|
protectedinherited |
the domain sizes of the variables/nodes of the graph
Definition at line 150 of file triangulation.h.