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  FloatVarBranch::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 = FloatAFC(home,x,decay());
80  break;
83  if (!_act.initialized())
84  _act = FloatActivity(home,x,decay());
85  break;
86  default: ;
87  }
88  }
89 
90 
91  inline FloatVarBranch
94  }
95 
96  inline FloatVarBranch
99  function_cast<VoidFunction>(bm),tbl);
100  }
101 
102  inline FloatVarBranch
105  function_cast<VoidFunction>(bm),tbl);
106  }
107 
108  inline FloatVarBranch
110  return FloatVarBranch(r);
111  }
112 
113  inline FloatVarBranch
116  }
117 
118  inline FloatVarBranch
121  }
122 
123  inline FloatVarBranch
126  }
127 
128  inline FloatVarBranch
131  }
132 
133  inline FloatVarBranch
136  }
137 
138  inline FloatVarBranch
141  }
142 
143  inline FloatVarBranch
146  }
147 
148  inline FloatVarBranch
151  }
152 
153  inline FloatVarBranch
156  }
157 
158  inline FloatVarBranch
161  }
162 
163  inline FloatVarBranch
166  }
167 
168  inline FloatVarBranch
171  }
172 
173  inline FloatVarBranch
176  }
177 
178  inline FloatVarBranch
181  }
182 
183  inline FloatVarBranch
186  }
187 
188  inline FloatVarBranch
191  }
192 
193  inline FloatVarBranch
196  }
197 
198  inline FloatVarBranch
201  }
202 
203  inline FloatVarBranch
206  }
207 
208  inline FloatVarBranch
211  }
212 
213  inline FloatVarBranch
216  }
217 
218  inline FloatVarBranch
221  }
222 
223  inline FloatVarBranch
226  }
227 
228  inline FloatVarBranch
231  }
232 
233  inline FloatVarBranch
236  }
237 
238  inline FloatVarBranch
241  }
242 
243 }
244 
245 // STATISTICS: float-branch