aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
unconstrainedTriangulation.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 /** @file
23  * @brief base class for graph triangulations without constraints on nodes
24  * elimination ordering.
25  *
26  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
27  */
28 #ifndef GUM_UNCONSTRAINED_TRIANGULATION_H
29 #define GUM_UNCONSTRAINED_TRIANGULATION_H
30 
31 #include <agrum/tools/graphs/algorithms/triangulations/eliminationStrategies/unconstrainedEliminationSequenceStrategy.h>
32 #include <agrum/tools/graphs/algorithms/triangulations/staticTriangulation.h>
33 
34 namespace gum {
35 
36 
37  /** @class UnconstrainedTriangulation
38  * @brief Interface for all triangulation methods without constraints on
39  * node elimination orderings
40  *
41  * \ingroup graph_group
42  *
43  */
45  public:
46  // ############################################################################
47  /// @name Accessors / Modifiers
48  // ############################################################################
49  /// @{
50 
51  /** @brief returns a fresh triangulation (over an empty graph) of the same
52  * type as the current object
53  *
54  * note that we return a pointer as it enables subclasses to return
55  * pointers to their types, not Triangulation pointers. See item 25 of the
56  * more effective C++.*/
57  virtual UnconstrainedTriangulation* newFactory() const = 0;
58 
59  /// virtual copy constructor
60  /** note that we return a pointer as it enables subclasses to return
61  * pointers to their types, not Triangulation pointers. See item 25 of the
62  * more effective C++. */
63  virtual UnconstrainedTriangulation* copyFactory() const = 0;
64 
65  /// destructor
66  virtual ~UnconstrainedTriangulation();
67 
68  /// @}
69 
70 
71  protected:
72  // ############################################################################
73  /// @name Constructors / Destructors
74  // ############################################################################
75  /// @{
76 
77  /// default constructor
78  /** @param elimSeq the elimination sequence used to triangulate the graph
79  * @param JTStrategy the junction tree strategy used to create junction
80  * trees
81  * @param minimality a Boolean indicating whether we should enforce that
82  * the triangulation is minimal w.r.t. inclusion */
83  UnconstrainedTriangulation(const UnconstrainedEliminationSequenceStrategy& elimSeq,
84  const JunctionTreeStrategy& JTStrategy,
85  bool minimality = false);
86 
87  /// constructor with a given graph
88  /** @param graph the graph to be triangulated, i.e., the nodes of which will
89  * be eliminated
90  * @param dom the domain sizes of the nodes to be eliminated
91  * @param elimSeq the elimination sequence used to triangulate the graph
92  * @param JTStrategy the junction tree strategy used to create junction
93  * trees
94  * @param minimality a Boolean indicating whether we should enforce that
95  * the triangulation is minimal w.r.t. inclusion
96  * @warning note that, by aGrUM's rule, the graph and the modalities are not
97  * copied but only referenced by the elimination sequence algorithm. */
98  UnconstrainedTriangulation(const UndiGraph* graph,
99  const NodeProperty< Size >* dom,
100  const UnconstrainedEliminationSequenceStrategy& elimSeq,
101  const JunctionTreeStrategy& JTStrategy,
102  bool minimality = false);
103 
104  /// forbid copy constructor except in newfactory
106 
107  /// forbid move constructor except in children's constructors
109 
110  /// @}
111 
112 
113  private:
114  /// forbid copy operator
116  };
117 
118 } /* namespace gum */
119 
120 #endif /* GUM_UNCONSTRAINED_TRIANGULATION_H */
UnconstrainedTriangulation(const UndiGraph *graph, const NodeProperty< Size > *dom, const UnconstrainedEliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
constructor with a given graph
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643
UnconstrainedTriangulation & operator=(const UnconstrainedTriangulation &)
forbid copy operator
virtual UnconstrainedTriangulation * copyFactory() const =0
virtual copy constructor
Interface for all triangulation methods without constraints on node elimination orderings.
UnconstrainedTriangulation(const UnconstrainedEliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
default constructor
UnconstrainedTriangulation(const UnconstrainedTriangulation &)
forbid copy constructor except in newfactory
virtual UnconstrainedTriangulation * newFactory() const =0
returns a fresh triangulation (over an empty graph) of the same type as the current object ...
UnconstrainedTriangulation(UnconstrainedTriangulation &&)
forbid move constructor except in children&#39;s constructors