Generated on Tue Oct 22 2013 00:49:00 for Gecode by doxygen 1.8.4
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  * Christian Schulte <schulte@gecode.org>
5  * Vincent Barichard <Vincent.Barichard@univ-angers.fr>
6  *
7  * Copyright:
8  * Christian Schulte, 2012
9  * Vincent Barichard, 2012
10  *
11  * Last modified:
12  * $Date: 2013-07-04 17:03:13 +0200 (Thu, 04 Jul 2013) $ by $Author: schulte $
13  * $Revision: 13801 $
14  *
15  * This file is part of Gecode, the generic constraint
16  * development environment:
17  * http://www.gecode.org
18  *
19  * Permission is hereby granted, free of charge, to any person obtaining
20  * a copy of this software and associated documentation files (the
21  * "Software"), to deal in the Software without restriction, including
22  * without limitation the rights to use, copy, modify, merge, publish,
23  * distribute, sublicense, and/or sell copies of the Software, and to
24  * permit persons to whom the Software is furnished to do so, subject to
25  * the following conditions:
26  *
27  * The above copyright notice and this permission notice shall be
28  * included in all copies or substantial portions of the Software.
29  *
30  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37  *
38  */
39 
40 #ifndef __GECODE_FLOAT_BRANCH_HH__
41 #define __GECODE_FLOAT_BRANCH_HH__
42 
43 #include <gecode/float.hh>
44 
50 namespace Gecode { namespace Float { namespace Branch {
51 
70  class MeritMin : public MeritBase<FloatView,double> {
71  public:
73  MeritMin(Space& home, const VarBranch& vb);
75  MeritMin(Space& home, bool shared, MeritMin& m);
77  double operator ()(const Space& home, FloatView x, int i);
78  };
79 
86  class MeritMax : public MeritBase<FloatView,double> {
87  public:
89  MeritMax(Space& home, const VarBranch& vb);
91  MeritMax(Space& home, bool shared, MeritMax& m);
93  double operator ()(const Space& home, FloatView x, int i);
94  };
95 
102  class MeritSize : public MeritBase<FloatView,double> {
103  public:
105  MeritSize(Space& home, const VarBranch& vb);
107  MeritSize(Space& home, bool shared, MeritSize& m);
109  double operator ()(const Space& home, FloatView x, int i);
110  };
111 
118  class MeritDegreeSize : public MeritBase<FloatView,double> {
119  public:
121  MeritDegreeSize(Space& home, const VarBranch& vb);
123  MeritDegreeSize(Space& home, bool shared, MeritDegreeSize& m);
125  double operator ()(const Space& home, FloatView x, int i);
126  };
127 
134  class MeritAFCSize : public MeritBase<FloatView,double> {
135  protected:
138  public:
140  MeritAFCSize(Space& home, const VarBranch& vb);
142  MeritAFCSize(Space& home, bool shared, MeritAFCSize& m);
144  double operator ()(const Space& home, FloatView x, int i);
146  bool notice(void) const;
148  void dispose(Space& home);
149  };
150 
157  class MeritActivitySize : public MeritBase<FloatView,double> {
158  protected:
161  public:
163  MeritActivitySize(Space& home, const VarBranch& vb);
167  double operator ()(const Space& home, FloatView x, int i);
169  bool notice(void) const;
171  void dispose(Space& home);
172  };
173 
174 }}}
175 
177 
178 namespace Gecode { namespace Float { namespace Branch {
179 
182  ViewSel<FloatView>* viewsel(Space& home, const FloatVarBranch& fvb);
183 
184 }}}
185 
186 namespace Gecode { namespace Float { namespace Branch {
187 
206  class ValSelLq : public ValSel<FloatView,FloatNumBranch> {
207  public:
209  ValSelLq(Space& home, const ValBranch& vb);
211  ValSelLq(Space& home, bool shared, ValSelLq& vs);
213  FloatNumBranch val(const Space& home, FloatView x, int i);
214  };
215 
222  class ValSelGq : public ValSel<FloatView,FloatNumBranch> {
223  public:
225  ValSelGq(Space& home, const ValBranch& vb);
227  ValSelGq(Space& home, bool shared, ValSelGq& vs);
229  FloatNumBranch val(const Space& home, FloatView x, int i);
230  };
231 
238  class ValSelRnd : public ValSel<FloatView,FloatNumBranch> {
239  protected:
242  public:
244  ValSelRnd(Space& home, const ValBranch& vb);
246  ValSelRnd(Space& home, bool shared, ValSelRnd& vs);
248  FloatNumBranch val(const Space& home, FloatView x, int i);
250  bool notice(void) const;
252  void dispose(Space& home);
253  };
254 
255 }}}
256 
258 
259 namespace Gecode { namespace Float { namespace Branch {
260 
279  class ValCommitLqGq : public ValCommit<FloatView,FloatVal> {
280  public:
282  ValCommitLqGq(Space& home, const ValBranch& vb);
284  ValCommitLqGq(Space& home, bool shared, ValCommitLqGq& vc);
286  ModEvent commit(Space& home, unsigned int a, FloatView x, int i,
287  FloatNumBranch n);
289  NGL* ngl(Space& home, unsigned int a, FloatView x, FloatNumBranch n) const;
291  void print(const Space& home, unsigned int a, FloatView x, int i,
292  FloatNumBranch n,
293  std::ostream& o) const;
294  };
295 
296 }}}
297 
299 
300 namespace Gecode { namespace Float { namespace Branch {
301 
304  ValSelCommitBase<FloatView,FloatNumBranch>*
305  valselcommit(Space& home, const FloatValBranch& svb);
306 
309  ValSelCommitBase<FloatView,FloatNumBranch>*
310  valselcommit(Space& home, const FloatAssign& ia);
311 
312 }}}
313 
314 #endif
315 
316 // STATISTICS: float-branch