aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
unconstrainedEliminationSequenceStrategy.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright 2005-2020 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 all elimination sequence algorithms that require only
24  * the graph to be triangulated and the nodes' domain sizes to produce the node
25  * elimination ordering.
26  *
27  * In many cases, the graph to be triangulated and the nodes domain sizes are
28  * the only information needed to compute an elimination ordering. For instance,
29  * this is only what is needed for computing junction trees for Bayesian
30  * networks or GAI networks. For such cases, the elimination sequence algorithms
31  * derived from UnconstrainedEliminationSequenceStrategy are appropriate. There
32  * are however other cases in which additional informations must be passed to
33  * the elimination sequence algorithm to produce a correct elimination ordering.
34  * For instance, computing a strong junction tree for an influence diagram
35  * requires the knowledge of a partial ordering on the nodes to be eliminated.
36  * For such cases, classes derived from UnconstrainedEliminationSequenceStrategy
37  * are not appropriate and those should be derived from other elimination
38  * sequence
39  * factories, for from instance PartialOrderedEliminationSequenceStrategy.
40  *
41  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
42  */
43 
44 #ifndef GUM_UNCONSTRAINED_ELIMINATION_SEQUENCE_STRATEGY_H
45 #define GUM_UNCONSTRAINED_ELIMINATION_SEQUENCE_STRATEGY_H
46 
47 #include <agrum/tools/graphs/algorithms/triangulations/eliminationStrategies/eliminationSequenceStrategy.h>
48 
49 namespace gum {
50 
51  /** @class UnconstrainedEliminationSequenceStrategy
52  * @brief The base class for all elimination sequence algorithms that require
53  * only the graph to be triangulated and the nodes' domain sizes to produce
54  * the node elimination ordering.
55  *
56  * \ingroup graph_group
57  *
58  */
61  public:
62  // ############################################################################
63  /// @name Constructors / Destructors
64  // ############################################################################
65  /// @{
66 
67  /// destructor
69 
70  /** @brief creates a new elimination sequence of the same type as the
71  * current object, but this sequence contains only an empty graph
72  * @warning you must deallocate by yourself the object returned
73  * @return an empty clone of the current object with the same type */
75 
76  /// virtual copy constructor
78 
79  /// @}
80 
81 
82  protected:
83  // ############################################################################
84  /// @name Constructors / Destructors
85  // ############################################################################
86  /// @{
87 
88  /// default constructor
90 
91  /// constructor for an a priori non empty graph
92  /** @param graph the graph to be triangulated, i.e., the nodes of which will
93  * be eliminated
94  * @param dom_sizes the domain sizes of the nodes to be eliminated
95  * @warning Note that we allow dom_sizes to be defined over nodes/variables
96  * that do not belong to graph. These sizes will simply be ignored. However,
97  * it is compulsory that all the nodes of graph belong to dom_sizes
98  * @warning the graph is altered during the triangulation.
99  * @warning note that, by aGrUM's rule, the graph and the domain sizes are
100  * not copied but only referenced by the elimination sequence algorithm. */
102  UndiGraph* graph,
103  const NodeProperty< Size >* dom_sizes);
104 
105  /// copy constructor
108 
109  /// move constructor
112 
113  /// @}
114  };
115 
116 } /* namespace gum */
117 
118 #endif /* GUM_UNCONSTRAINED_ELIMINATION_SEQUENCE_STRATEGY_H */
UnconstrainedEliminationSequenceStrategy(UnconstrainedEliminationSequenceStrategy &&)
move constructor
UnconstrainedEliminationSequenceStrategy(const UnconstrainedEliminationSequenceStrategy &)
copy constructor
UnconstrainedEliminationSequenceStrategy(UndiGraph *graph, const NodeProperty< Size > *dom_sizes)
constructor for an a priori non empty graph
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:669
virtual UnconstrainedEliminationSequenceStrategy * newFactory() const =0
creates a new elimination sequence of the same type as the current object, but this sequence contains...
The base class for all elimination sequence algorithms that require only the graph to be triangulated...
virtual UnconstrainedEliminationSequenceStrategy * copyFactory() const =0
virtual copy constructor