aGrUM  0.16.0
triangulation.h
Go to the documentation of this file.
1 
28 #ifndef GUM_TRIANGULATION_H
29 #define GUM_TRIANGULATION_H
30 
31 #include <vector>
32 
33 #include <agrum/agrum.h>
34 #include <agrum/core/sequence.h>
36 #include <vector>
37 
38 namespace gum {
39 
40 
47  class Triangulation {
48  public:
49  // ############################################################################
51  // ############################################################################
53 
60  virtual Triangulation* newFactory() const = 0;
61 
63 
66  virtual Triangulation* copyFactory() const = 0;
67 
69  virtual ~Triangulation();
70 
72 
73 
74  // ############################################################################
76  // ############################################################################
78 
80 
88  virtual void setGraph(const UndiGraph* graph,
89  const NodeProperty< Size >* domsizes) = 0;
90 
92  virtual const EdgeSet& fillIns() = 0;
93 
95  virtual const std::vector< NodeId >& eliminationOrder() = 0;
96 
99  virtual Idx eliminationOrder(const NodeId) = 0;
100 
102  virtual const UndiGraph& triangulatedGraph() = 0;
103 
105  virtual const CliqueGraph& eliminationTree() = 0;
106 
108  virtual const CliqueGraph& junctionTree() = 0;
109 
111 
117  double maxLog10CliqueDomainSize();
118 
121  virtual NodeId createdJunctionTreeClique(const NodeId id) = 0;
122 
126 
128 
134  virtual const CliqueGraph& maxPrimeSubgraphTree() = 0;
135 
138  virtual NodeId createdMaxPrimeSubgraph(const NodeId id) = 0;
139 
141  virtual void clear() = 0;
142 
145  const NodeProperty< Size >* domainSizes() const;
146 
148 
149 
150  protected:
153 
154 
156  Triangulation();
157 
159 
161  Triangulation(const NodeProperty< Size >* domsizes);
162 
165 
168 
169 
170  private:
173  };
174 
175 } /* namespace gum */
176 
177 
178 #ifndef GUM_NO_INLINE
180 #endif // GUM_NO_INLINE
181 
182 
183 #endif /* GUM_TRIANGULATION_H */
virtual void clear()=0
reinitialize the graph to be triangulated to an empty graph
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
double maxLog10CliqueDomainSize()
returns the max of log10DomainSize of the cliques in the junction tree.
virtual const CliqueGraph & eliminationTree()=0
returns the elimination tree of a compatible ordering
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
The class for generic Hash Tables.
Definition: hashTable.h:679
const NodeProperty< Size > * _domain_sizes
the domain sizes of the variables/nodes of the graph
virtual const NodeProperty< NodeId > & createdJunctionTreeCliques()=0
returns the Ids of the cliques of the junction tree created by the elimination of the nodes ...
virtual NodeId createdJunctionTreeClique(const NodeId id)=0
returns the Id of the clique created by the elimination of a given node during the triangulation proc...
virtual const EdgeSet & fillIns()=0
returns the fill-ins added by the triangulation algorithm
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 tr...
virtual const CliqueGraph & maxPrimeSubgraphTree()=0
returns a junction tree of maximal prime subgraphs
Basic graph of cliques.
Definition: cliqueGraph.h:58
Triangulation()
default constructor
virtual ~Triangulation()
destructor
const NodeProperty< Size > * domainSizes() const
returns the domain sizes of the variables of the graph to be triangulated
Triangulation & operator=(const Triangulation &)
prevent copy operator
Base class for undirected graphs.
Definition: undiGraph.h:109
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual Triangulation * newFactory() const =0
returns a fresh triangulation of the same type as the current object but with an empty graph ...
Size Idx
Type for indexes.
Definition: types.h:53
virtual const UndiGraph & triangulatedGraph()=0
returns the triangulated graph
virtual Triangulation * copyFactory() const =0
virtual copy constructor
Interface for all the triangulation methods.
Definition: triangulation.h:47
virtual const CliqueGraph & junctionTree()=0
returns a compatible junction tree
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual const std::vector< NodeId > & eliminationOrder()=0
returns an elimination ordering compatible with the triangulated graph
Size NodeId
Type for node ids.
Definition: graphElements.h:98
virtual void setGraph(const UndiGraph *graph, const NodeProperty< Size > *domsizes)=0
initialize the triangulation data structures for a new graph