aGrUM  0.16.0
structuralConstraintIndegree.cpp
Go to the documentation of this file.
1 
31 
33 #ifdef GUM_NO_INLINE
35 #endif /* GUM_NO_INLINE */
36 
37 namespace gum {
38 
39  namespace learning {
40 
43  GUM_CONSTRUCTOR(StructuralConstraintIndegree);
44  }
45 
48  Size max_indegree) :
50  _Indegree__max_indegree(max_indegree) {
51  for (NodeId i = 0; i < nb_nodes; ++i) {
52  _Indegree__max_parents.insert(i, max_indegree);
53  }
54  GUM_CONSTRUCTOR(StructuralConstraintIndegree);
55  }
56 
59  const DiGraph& graph, Size max_indegree) :
61  _Indegree__max_indegree(max_indegree) {
62  for (const auto id : graph) {
63  _Indegree__max_parents.insert(id, max_indegree);
64  }
65  GUM_CONSTRUCTOR(StructuralConstraintIndegree);
66  }
67 
70  const StructuralConstraintIndegree& from) :
74  GUM_CONS_CPY(StructuralConstraintIndegree);
75  }
76 
80  StructuralConstraintDiGraph(std::move(from)),
83  GUM_CONS_MOV(StructuralConstraintIndegree);
84  }
85 
88  GUM_DESTRUCTOR(StructuralConstraintIndegree);
89  }
90 
94  if (this != &from) {
98  }
99 
100  return *this;
101  }
102 
106  if (this != &from) {
108  _Indegree__max_parents = std::move(from._Indegree__max_parents);
109  _Indegree__max_indegree = std::move(from._Indegree__max_indegree);
110  }
111 
112  return *this;
113  }
114 
115  } /* namespace learning */
116 
117 } /* namespace gum */
the class for structural constraints limiting the number of parents of nodes in a directed graph ...
STL namespace.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
StructuralConstraintDiGraph & operator=(const StructuralConstraintDiGraph &from)
copy operator
Size _Indegree__max_indegree
a default max indegree to assign for nodes without specified indegree
Base class for all oriented graphs.
Definition: diGraph.h:111
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
NodeProperty< Size > _Indegree__max_parents
the max number of parents per node
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
StructuralConstraintIndegree & operator=(const StructuralConstraintIndegree &from)
copy operator
The base class for structural constraints used by learning algorithms that learn a directed graph str...
Size NodeId
Type for node ids.
Definition: graphElements.h:98