aGrUM  0.14.2
structuralConstraintIndegree.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
28 
30 #ifdef GUM_NO_INLINE
32 #endif /* GUM_NO_INLINE */
33 
34 namespace gum {
35 
36  namespace learning {
37 
40  GUM_CONSTRUCTOR(StructuralConstraintIndegree);
41  }
42 
45  Size max_indegree) :
47  _Indegree__max_indegree(max_indegree) {
48  for (NodeId i = 0; i < nb_nodes; ++i) {
49  _Indegree__max_parents.insert(i, max_indegree);
50  }
51  GUM_CONSTRUCTOR(StructuralConstraintIndegree);
52  }
53 
56  const DiGraph& graph, Size max_indegree) :
58  _Indegree__max_indegree(max_indegree) {
59  for (const auto id : graph) {
60  _Indegree__max_parents.insert(id, max_indegree);
61  }
62  GUM_CONSTRUCTOR(StructuralConstraintIndegree);
63  }
64 
67  const StructuralConstraintIndegree& from) :
71  GUM_CONS_CPY(StructuralConstraintIndegree);
72  }
73 
77  StructuralConstraintDiGraph(std::move(from)),
80  GUM_CONS_MOV(StructuralConstraintIndegree);
81  }
82 
85  GUM_DESTRUCTOR(StructuralConstraintIndegree);
86  }
87 
91  if (this != &from) {
95  }
96 
97  return *this;
98  }
99 
103  if (this != &from) {
105  _Indegree__max_parents = std::move(from._Indegree__max_parents);
106  _Indegree__max_indegree = std::move(from._Indegree__max_indegree);
107  }
108 
109  return *this;
110  }
111 
112  } /* namespace learning */
113 
114 } /* namespace gum */
the class for structural constraints limiting the number of parents of nodes in a directed graph ...
STL namespace.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
the class for structural constraints limiting the number of parents of nodes in a directed graph ...
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:108
the class for structural constraints limiting the number of parents of nodes in a directed graph ...
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:45
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:97