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  IntVarBranch::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 = IntAFC(home,x,decay());
80  break;
83  if (!_act.initialized())
84  _act = IntActivity(home,x,decay());
85  break;
86  default: ;
87  }
88  }
89 
90  forceinline void
92  switch (select()) {
93  case SEL_AFC_MIN: case SEL_AFC_MAX:
95  if (!_afc.initialized())
96  _afc = IntAFC(home,x,decay());
97  break;
100  if (!_act.initialized())
101  _act = IntActivity(home,x,decay());
102  break;
103  default: ;
104  }
105  }
106 
107  inline IntVarBranch
108  INT_VAR_NONE(void) {
110  }
111 
112  inline IntVarBranch
114  return IntVarBranch(r);
115  }
116 
117  inline IntVarBranch
120  function_cast<VoidFunction>(bm),tbl);
121  }
122 
123  inline IntVarBranch
126  function_cast<VoidFunction>(bm),tbl);
127  }
128 
129  inline IntVarBranch
132  function_cast<VoidFunction>(bm),tbl);
133  }
134 
135  inline IntVarBranch
138  function_cast<VoidFunction>(bm),tbl);
139  }
140 
141  inline IntVarBranch
144  }
145 
146  inline IntVarBranch
149  }
150 
151  inline IntVarBranch
154  }
155 
156  inline IntVarBranch
159  }
160 
161  inline IntVarBranch
164  }
165 
166  inline IntVarBranch
169  }
170 
171  inline IntVarBranch
174  }
175 
176  inline IntVarBranch
179  }
180 
181  inline IntVarBranch
184  }
185 
186  inline IntVarBranch
189  }
190 
191  inline IntVarBranch
194  }
195 
196  inline IntVarBranch
199  }
200 
201  inline IntVarBranch
204  }
205 
206  inline IntVarBranch
209  }
210 
211  inline IntVarBranch
214  }
215 
216  inline IntVarBranch
219  }
220 
221  inline IntVarBranch
224  }
225 
226  inline IntVarBranch
229  }
230 
231  inline IntVarBranch
234  }
235 
236  inline IntVarBranch
239  }
240 
241  inline IntVarBranch
244  }
245 
246  inline IntVarBranch
249  }
250 
251  inline IntVarBranch
254  }
255 
256  inline IntVarBranch
259  }
260 
261  inline IntVarBranch
264  }
265 
266  inline IntVarBranch
269  }
270 
271  inline IntVarBranch
274  }
275 
276  inline IntVarBranch
279  }
280 
281  inline IntVarBranch
284  }
285 
286  inline IntVarBranch
289  }
290 
291 }
292 
293 // STATISTICS: int-branch