Generated on Sat May 25 2013 18:00:33 for Gecode by doxygen 1.8.3.1
branch.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Guido Tack <tack@gecode.org>
5  * Christian Schulte <schulte@gecode.org>
6  *
7  * Contributing authors:
8  * Gabor Szokoli <szokoli@gecode.org>
9  *
10  * Copyright:
11  * Guido Tack, 2004
12  * Christian Schulte, 2004
13  * Gabor Szokoli, 2004
14  *
15  * Last modified:
16  * $Date: 2013-02-25 17:13:22 +0100 (Mon, 25 Feb 2013) $ by $Author: schulte $
17  * $Revision: 13397 $
18  *
19  * This file is part of Gecode, the generic constraint
20  * development environment:
21  * http://www.gecode.org
22  *
23  * Permission is hereby granted, free of charge, to any person obtaining
24  * a copy of this software and associated documentation files (the
25  * "Software"), to deal in the Software without restriction, including
26  * without limitation the rights to use, copy, modify, merge, publish,
27  * distribute, sublicense, and/or sell copies of the Software, and to
28  * permit persons to whom the Software is furnished to do so, subject to
29  * the following conditions:
30  *
31  * The above copyright notice and this permission notice shall be
32  * included in all copies or substantial portions of the Software.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41  *
42  */
43 
44 #ifndef __GECODE_SET_BRANCH_HH__
45 #define __GECODE_SET_BRANCH_HH__
46 
47 #include <gecode/set.hh>
48 
54 namespace Gecode { namespace Set { namespace Branch {
55 
74  class MeritMin : public MeritBase<SetView,int> {
75  public:
77  MeritMin(Space& home, const VarBranch& vb);
79  MeritMin(Space& home, bool shared, MeritMin& m);
81  int operator ()(const Space& home, SetView x, int i);
82  };
83 
90  class MeritMax : public MeritBase<SetView,int> {
91  public:
93  MeritMax(Space& home, const VarBranch& vb);
95  MeritMax(Space& home, bool shared, MeritMax& m);
97  int operator ()(const Space& home, SetView x, int i);
98  };
99 
106  class MeritSize : public MeritBase<SetView,unsigned int> {
107  public:
109  MeritSize(Space& home, const VarBranch& vb);
111  MeritSize(Space& home, bool shared, MeritSize& m);
113  unsigned int operator ()(const Space& home, SetView x, int i);
114  };
115 
122  class MeritDegreeSize : public MeritBase<SetView,double> {
123  public:
125  MeritDegreeSize(Space& home, const VarBranch& vb);
127  MeritDegreeSize(Space& home, bool shared, MeritDegreeSize& m);
129  double operator ()(const Space& home, SetView x, int i);
130  };
131 
138  class MeritAFCSize : public MeritBase<SetView,double> {
139  protected:
142  public:
144  MeritAFCSize(Space& home, const VarBranch& vb);
146  MeritAFCSize(Space& home, bool shared, MeritAFCSize& m);
148  double operator ()(const Space& home, SetView x, int i);
150  bool notice(void) const;
152  void dispose(Space& home);
153  };
154 
161  class MeritActivitySize : public MeritBase<SetView,double> {
162  protected:
165  public:
167  MeritActivitySize(Space& home, const VarBranch& vb);
171  double operator ()(const Space& home, SetView x, int i);
173  bool notice(void) const;
175  void dispose(Space& home);
176  };
177 
178 }}}
179 
181 
182 namespace Gecode { namespace Set { namespace Branch {
183 
186  ViewSel<SetView>* viewsel(Space& home, const SetVarBranch& svb);
187 
188 }}}
189 
190 namespace Gecode { namespace Set { namespace Branch {
191 
210  class ValSelMin : public ValSel<SetView,int> {
211  public:
213  ValSelMin(Space& home, const ValBranch& vb);
215  ValSelMin(Space& home, bool shared, ValSelMin& vs);
217  int val(const Space& home, SetView x, int i);
218  };
219 
226  class ValSelMax : public ValSel<SetView,int> {
227  public:
229  ValSelMax(Space& home, const ValBranch& vb);
231  ValSelMax(Space& home, bool shared, ValSelMax& vs);
233  int val(const Space& home, SetView x, int i);
234  };
235 
242  class ValSelMed : public ValSel<SetView,int> {
243  public:
245  ValSelMed(Space& home, const ValBranch& vb);
247  ValSelMed(Space& home, bool shared, ValSelMed& vs);
249  int val(const Space& home, SetView x, int i);
250  };
251 
258  class ValSelRnd : public ValSel<SetView,int> {
259  protected:
262  public:
264  ValSelRnd(Space& home, const ValBranch& vb);
266  ValSelRnd(Space& home, bool shared, ValSelRnd& vs);
268  int val(const Space& home, SetView x, int i);
270  bool notice(void) const;
272  void dispose(Space& home);
273  };
274 
275 }}}
276 
278 
279 namespace Gecode { namespace Set { namespace Branch {
280 
299  class ValCommitInc : public ValCommit<SetView,int> {
300  public:
302  ValCommitInc(Space& home, const ValBranch& vb);
304  ValCommitInc(Space& home, bool shared, ValCommitInc& vc);
306  ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
307  };
308 
315  class ValCommitExc : public ValCommit<SetView,int> {
316  public:
318  ValCommitExc(Space& home, const ValBranch& vb);
320  ValCommitExc(Space& home, bool shared, ValCommitExc& vc);
322  ModEvent commit(Space& home, unsigned int a, SetView x, int i, int n);
323  };
324 
325 }}}
326 
328 
329 namespace Gecode { namespace Set { namespace Branch {
330 
333  ValSelCommitBase<SetView,int>*
334  valselcommit(Space& home, const SetValBranch& svb);
335 
338  ValSelCommitBase<SetView,int>*
339  valselcommit(Space& home, const SetAssign& ia);
340 
341 }}}
342 
343 #endif
344 
345 // STATISTICS: set-branch
346