aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
staticTriangulation_inl.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 Inline implementations for computing default triangulations of graphs
24  *
25  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
26  */
27 
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 
30 
31 namespace gum {
32 
33 
34  /// returns an elimination ordering compatible with the triangulated graph
35  INLINE
38 
39  return elim_order__;
40  }
41 
42 
43  /** @brief returns the index of a given node in the elimination order
44  * (0 = first node eliminated) */
45  INLINE
48 
49  return reverse_elim_order__[id];
50  }
51 
52 
53  /** @brief returns the number of a given node in the elimination order
54  * (0 = first node eliminated) */
55  INLINE
58 
59  return reverse_elim_order__;
60  }
61 
62 
63  /// returns the elimination tree of a compatible ordering
64  INLINE
67 
68  return elim_tree__;
69  }
70 
71 
72  /// returns a compatible junction tree
73  INLINE
75  // checks if junctionTree already exists
76  if (!has_junction_tree__) {
78  has_junction_tree__ = true;
79  }
80 
81  return *junction_tree__;
82  }
83 
84 
85  /// returns a junction tree of maximal prime subgraphs
86  INLINE
89 
91  }
92 
93 
94  /** @brief returns the Id of the maximal prime subgraph created by the
95  * elimination of a given node during the triangulation process */
96  INLINE
99 
101  }
102 
103 
104  /** @brief returns the Id of the clique created by the
105  * elimination of a given node during the triangulation process */
106  INLINE
109  }
110 
111 
112  /** @brief returns the Ids of the cliques of the junction tree created by the
113  * elimination of the nodes */
114  INLINE
117  }
118 
119 
120  /// sets/unset the fill-ins storage in the standard triangulation procedure
121  INLINE
122  void StaticTriangulation::setFillIns(bool b) {
125  }
126 
127 
128  /// returns the graph to be triangulated
129  INLINE
131  return original_graph__;
132  }
133 
134 
135  /// returns the elimination sequence strategy used by the triangulation
139  }
140 
141 
142  /// returns the junction tree strategy used by the triangulation
144  return *junction_tree_strategy_;
145  }
146 
147 
148  /// indicates wether minimality is required
150  return minimality_required__;
151  }
152 
153 
154 } /* namespace gum */
155 
156 
157 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:669