aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
staticTriangulation_inl.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 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
130  const UndiGraph* StaticTriangulation::originalGraph() const { return _original_graph_; }
131 
132 
133  /// returns the elimination sequence strategy used by the triangulation
136  }
137 
138 
139  /// returns the junction tree strategy used by the triangulation
141  return *junction_tree_strategy_;
142  }
143 
144 
145  /// indicates wether minimality is required
147 
148 
149 } /* namespace gum */
150 
151 
152 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643