aGrUM  0.14.2
triangulation.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
25 #ifndef GUM_TRIANGULATION_H
26 #define GUM_TRIANGULATION_H
27 
28 #include <vector>
29 
30 #include <agrum/agrum.h>
31 #include <agrum/core/sequence.h>
33 #include <vector>
34 
35 namespace gum {
36 
37 
44  class Triangulation {
45  public:
46  // ############################################################################
48  // ############################################################################
50 
57  virtual Triangulation* newFactory() const = 0;
58 
60 
63  virtual Triangulation* copyFactory() const = 0;
64 
66  virtual ~Triangulation();
67 
69 
70 
71  // ############################################################################
73  // ############################################################################
75 
77 
85  virtual void setGraph(const UndiGraph* graph,
86  const NodeProperty< Size >* domsizes) = 0;
87 
89  virtual const EdgeSet& fillIns() = 0;
90 
92  virtual const std::vector< NodeId >& eliminationOrder() = 0;
93 
96  virtual Idx eliminationOrder(const NodeId) = 0;
97 
99  virtual const UndiGraph& triangulatedGraph() = 0;
100 
102  virtual const CliqueGraph& eliminationTree() = 0;
103 
105  virtual const CliqueGraph& junctionTree() = 0;
106 
108 
114  double maxLog10CliqueDomainSize();
115 
118  virtual NodeId createdJunctionTreeClique(const NodeId id) = 0;
119 
123 
125 
131  virtual const CliqueGraph& maxPrimeSubgraphTree() = 0;
132 
135  virtual NodeId createdMaxPrimeSubgraph(const NodeId id) = 0;
136 
138  virtual void clear() = 0;
139 
142  const NodeProperty< Size >* domainSizes() const;
143 
145 
146 
147  protected:
150 
151 
153  Triangulation();
154 
156 
158  Triangulation(const NodeProperty< Size >* domsizes);
159 
162 
165 
166 
167  private:
170  };
171 
172 } /* namespace gum */
173 
174 
175 #ifndef GUM_NO_INLINE
177 #endif // GUM_NO_INLINE
178 
179 
180 #endif /* GUM_TRIANGULATION_H */
virtual void clear()=0
reinitialize the graph to be triangulated to an empty graph
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
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
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
The class for generic Hash Tables.
Definition: hashTable.h:676
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:55
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:106
Abstract base class for computing triangulations of graphs.
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:50
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:44
virtual const CliqueGraph & junctionTree()=0
returns a compatible junction tree
Basic class for all graphs of cliques (join trees, etc)
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:97
virtual void setGraph(const UndiGraph *graph, const NodeProperty< Size > *domsizes)=0
initialize the triangulation data structures for a new graph