Generated on Sat Nov 9 2013 19:18:26 for Gecode by doxygen 1.8.4
var.hpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  *
6  * Copyright:
7  * Christian Schulte, 2012
8  *
9  * Last modified:
10  * $Date: 2013-02-19 13:26:08 +0100 (Tue, 19 Feb 2013) $ by $Author: schulte $
11  * $Revision: 13313 $
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 namespace Gecode {
39 
42  : VarBranch(NULL), s(SEL_NONE) {}
43 
46  : VarBranch(t), s(s0) {}
47 
50  : VarBranch(r), s(SEL_RND) {}
51 
54  : VarBranch(d,t), s(s0) {}
55 
58  : VarBranch(a,t), s(s0) {}
59 
62  : VarBranch(a,t), s(s0) {}
63 
66  : VarBranch(mf,t), s(s0) {}
67 
69  SetVarBranch::select(void) const {
70  return s;
71  }
72 
73  forceinline void
75  switch (select()) {
76  case SEL_AFC_MIN: case SEL_AFC_MAX:
78  if (!_afc.initialized())
79  _afc = SetAFC(home,x,decay());
80  break;
83  if (!_act.initialized())
84  _act = SetActivity(home,x,decay());
85  break;
86  default: ;
87  }
88  }
89 
90  inline SetVarBranch
91  SET_VAR_NONE(void) {
93  }
94 
95  inline SetVarBranch
97  return SetVarBranch(r);
98  }
99 
100  inline SetVarBranch
103  function_cast<VoidFunction>(bm),tbl);
104  }
105 
106  inline SetVarBranch
109  function_cast<VoidFunction>(bm),tbl);
110  }
111 
112  inline SetVarBranch
115  }
116 
117  inline SetVarBranch
120  }
121 
122  inline SetVarBranch
125  }
126 
127  inline SetVarBranch
130  }
131 
132  inline SetVarBranch
135  }
136 
137  inline SetVarBranch
140  }
141 
142  inline SetVarBranch
145  }
146 
147  inline SetVarBranch
150  }
151 
152  inline SetVarBranch
155  }
156 
157  inline SetVarBranch
160  }
161 
162  inline SetVarBranch
165  }
166 
167  inline SetVarBranch
170  }
171 
172  inline SetVarBranch
175  }
176 
177  inline SetVarBranch
180  }
181 
182  inline SetVarBranch
185  }
186 
187  inline SetVarBranch
190  }
191 
192  inline SetVarBranch
195  }
196 
197  inline SetVarBranch
200  }
201 
202  inline SetVarBranch
205  }
206 
207  inline SetVarBranch
210  }
211 
212  inline SetVarBranch
215  }
216 
217  inline SetVarBranch
220  }
221 
222  inline SetVarBranch
225  }
226 
227  inline SetVarBranch
230  }
231 
232  inline SetVarBranch
235  }
236 
237  inline SetVarBranch
240  }
241 
242 }
243 
244 // STATISTICS: set-branch