aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
unconstrainedEliminationSequenceStrategy.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 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  */
60  public:
61  // ############################################################################
62  /// @name Constructors / Destructors
63  // ############################################################################
64  /// @{
65 
66  /// destructor
68 
69  /** @brief creates a new elimination sequence of the same type as the
70  * current object, but this sequence contains only an empty graph
71  * @warning you must deallocate by yourself the object returned
72  * @return an empty clone of the current object with the same type */
74 
75  /// virtual copy constructor
77 
78  /// @}
79 
80 
81  protected:
82  // ############################################################################
83  /// @name Constructors / Destructors
84  // ############################################################################
85  /// @{
86 
87  /// default constructor
89 
90  /// constructor for an a priori non empty graph
91  /** @param graph the graph to be triangulated, i.e., the nodes of which will
92  * be eliminated
93  * @param dom_sizes the domain sizes of the nodes to be eliminated
94  * @warning Note that we allow dom_sizes to be defined over nodes/variables
95  * that do not belong to graph. These sizes will simply be ignored. However,
96  * it is compulsory that all the nodes of graph belong to dom_sizes
97  * @warning the graph is altered during the triangulation.
98  * @warning note that, by aGrUM's rule, the graph and the domain sizes are
99  * not copied but only referenced by the elimination sequence algorithm. */
101  const NodeProperty< Size >* dom_sizes);
102 
103  /// copy constructor
105 
106  /// move constructor
108 
109  /// @}
110  };
111 
112 } /* namespace gum */
113 
114 #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:643
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