aGrUM  0.14.2
structuralConstraintTabuList.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 
41  // put dummy elements into the list (this avoids having tests to do
42  // afterwards)
44  ++i) {
45  _TabuList__changes.insert(
46  ArcAddition(std::numeric_limits< NodeId >::max() - i,
47  std::numeric_limits< NodeId >::max()),
48  i);
49  }
50 
51  GUM_CONSTRUCTOR(StructuralConstraintTabuList);
52  }
53 
56  const DiGraph& graph) :
58  // put dummy elements into the list (this avoids having tests to do
59  // afterwards)
61  ++i) {
62  _TabuList__changes.insert(
63  ArcAddition(std::numeric_limits< NodeId >::max() - i,
64  std::numeric_limits< NodeId >::max()),
65  i);
66  }
67 
68  GUM_CONSTRUCTOR(StructuralConstraintTabuList);
69  }
70 
73  const StructuralConstraintTabuList& from) :
76  GUM_CONS_CPY(StructuralConstraintTabuList);
77  }
78 
84  GUM_CONS_MOV(StructuralConstraintTabuList);
85  }
86 
89  GUM_DESTRUCTOR(StructuralConstraintTabuList);
90  }
91 
95  if (this != &from) {
98  }
99  return *this;
100  }
101 
105  if (this != &from) {
106  _TabuList__changes = std::move(from._TabuList__changes);
107  _TabuList__offset = std::move(from._TabuList__offset);
108  }
109  return *this;
110  }
111 
112  } /* namespace learning */
113 
114 } /* namespace gum */
the class imposing a N-sized tabu list as a structural constraints for learning algorithms ...
The class for notifying learning algorithms of new arc additionsThis class is convenient to know at c...
Definition: graphChange.h:147
#define GUM_STRUCTURAL_CONSTRAINT_TABU_LIST_DEFAULT_SIZE
STL namespace.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
NodeId _TabuList__offset
the index of the oldest element
StructuralConstraintTabuList & operator=(const StructuralConstraintTabuList &from)
copy operator
Base class for all oriented graphs.
Definition: diGraph.h:108
Bijection< GraphChange, NodeId > _TabuList__changes
the tabu list
The class imposing a N-sized tabu list as a structural constraints for learning algorithms.
the class imposing a N-sized tabu list as a structural constraints for learning algorithms ...
Size NodeId
Type for node ids.
Definition: graphElements.h:97