aGrUM  0.14.2
structuralConstraintDAG.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  ***************************************************************************/
26 
28 #ifdef GUM_NO_INLINE
30 #endif /* GUM_NO_INLINE */
31 
32 namespace gum {
33 
34  namespace learning {
35 
38  GUM_CONSTRUCTOR(StructuralConstraintDAG);
39  }
40 
43  StructuralConstraintDiGraph(nb_nodes) {
45 
46  DAG g;
47  for (NodeId i = 0; i < nb_nodes; ++i) {
48  g.addNodeWithId(i);
49  }
51 
52  GUM_CONSTRUCTOR(StructuralConstraintDAG);
53  }
54 
59 
60  GUM_CONSTRUCTOR(StructuralConstraintDAG);
61  }
62 
65  const StructuralConstraintDAG& from) :
68  GUM_CONS_CPY(StructuralConstraintDAG);
69  }
70 
73  StructuralConstraintDAG&& from) :
74  StructuralConstraintDiGraph(std::move(from)),
76  GUM_CONS_MOV(StructuralConstraintDAG);
77  }
78 
81  GUM_DESTRUCTOR(StructuralConstraintDAG);
82  }
83 
87  if (this != &from) {
90  }
91  return *this;
92  }
93 
97  if (this != &from) {
99  _DAG__cycle_detector = std::move(from._DAG__cycle_detector);
100  }
101  return *this;
102  }
103 
104  } /* namespace learning */
105 
106 } /* namespace gum */
virtual void addNodeWithId(const NodeId id)
try to insert a node with the given id
the base class for structural constraints imposed by DAGs
void setGraph(Size nb_nodes)
sets a new empty graph from which we will perform checkings
the base class for structural constraints imposed by DAGs
STL namespace.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
StructuralConstraintDiGraph & operator=(const StructuralConstraintDiGraph &from)
copy operator
void setDAG(const DAG &dag)
sets the initial DAG from which changes shall be applied
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:45
StructuralConstraintDAG & operator=(const StructuralConstraintDAG &from)
copy operator
Base class for dag.
Definition: DAG.h:99
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
DAGCycleDetector _DAG__cycle_detector
the cycle detector used to check quickly graph modifications
The base class for structural constraints imposed by DAGs.