aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
structuralConstraintSliceOrder.cpp
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 the structural constraint imposing a partial order over nodes
24  *
25  * In DBNs, it is forbidden to add arcs from nodes at time slice t to nodes at
26  * time slice s, where s < t. This class allows for taking this kind of
27  *constraint
28  * into account by imposing a partial order over the nodes: arcs (X,Y) can then
29  * only be added if X <= Y in the partial order.
30  * @warning: there may exist free variables, that is variables whose order
31  * w.r.t. the other variables is unspecified. In this case, arcs adjacent
32  * to them can be constructed. The partial order is specified by assigning
33  * numbers to nodes (through a NodeProperty). Nodes without number (i.e., that
34  * do not belong to the property) are free.
35  *
36  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
37  */
38 
39 #include <agrum/BN/learning/constraints/structuralConstraintSliceOrder.h>
40 
41 /// include the inlined functions if necessary
42 #ifdef GUM_NO_INLINE
43 # include <agrum/BN/learning/constraints/structuralConstraintSliceOrder_inl.h>
44 #endif /* GUM_NO_INLINE */
45 
46 namespace gum {
47 
48  namespace learning {
49 
50  /// default constructor
53  }
54 
55  /// constructor starting with an empty graph with a given number of nodes
57  const NodeProperty< NodeId >& order) {
58  for (auto iter = order.cbegin(); iter != order.cend(); ++iter) {
60  }
62 
64  }
65 
66  /// constructor starting with a given graph
68  const DiGraph& graph,
69  const NodeProperty< NodeId >& order) :
73  }
74 
75  /// copy constructor
81  }
82 
83  /// move constructor
89  }
90 
91  /// destructor
94  }
95 
96  /// copy operator
99  if (this != &from) {
102  }
103  return *this;
104  }
105 
106  /// move operator
109  if (this != &from) {
112  }
113  return *this;
114  }
115 
116  } /* namespace learning */
117 
118 } /* namespace gum */
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)