Generated on Tue Jul 18 2017 18:41:42 for Gecode by doxygen 1.8.13
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: 2017-02-28 08:29:39 +0100 (Tue, 28 Feb 2017) $ by $Author: schulte $
13  * $Revision: 15527 $
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<Var>& 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<Var>& 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<Var>& 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<Var>& 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<Var>& 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 MeritActionSize : public MeritBase<FloatView,double> {
158  protected:
161  public:
163  MeritActionSize(Space& home, const VarBranch<Var>& vb);
165  MeritActionSize(Space& home, bool shared, MeritActionSize& m);
167  double operator ()(const Space& home, FloatView x, int i);
169  bool notice(void) const;
171  void dispose(Space& home);
172  };
173 
180  class MeritCHBSize : public MeritBase<FloatView,double> {
181  protected:
184  public:
186  MeritCHBSize(Space& home, const VarBranch<Var>& vb);
188  MeritCHBSize(Space& home, bool shared, MeritCHBSize& m);
190  double operator ()(const Space& home, FloatView x, int i);
192  bool notice(void) const;
194  void dispose(Space& home);
195  };
196 
197 }}}
198 
200 
201 namespace Gecode { namespace Float { namespace Branch {
202 
205  ViewSel<FloatView>* viewsel(Space& home, const FloatVarBranch& fvb);
206 
207 }}}
208 
209 namespace Gecode { namespace Float { namespace Branch {
210 
229  class ValSelLq : public ValSel<FloatView,FloatNumBranch> {
230  public:
232  ValSelLq(Space& home, const ValBranch<Var>& vb);
234  ValSelLq(Space& home, bool shared, ValSelLq& vs);
236  FloatNumBranch val(const Space& home, FloatView x, int i);
237  };
238 
245  class ValSelGq : public ValSel<FloatView,FloatNumBranch> {
246  public:
248  ValSelGq(Space& home, const ValBranch<Var>& vb);
250  ValSelGq(Space& home, bool shared, ValSelGq& vs);
252  FloatNumBranch val(const Space& home, FloatView x, int i);
253  };
254 
261  class ValSelRnd : public ValSel<FloatView,FloatNumBranch> {
262  protected:
265  public:
267  ValSelRnd(Space& home, const ValBranch<Var>& vb);
269  ValSelRnd(Space& home, bool shared, ValSelRnd& vs);
271  FloatNumBranch val(const Space& home, FloatView x, int i);
273  bool notice(void) const;
275  void dispose(Space& home);
276  };
277 
278 }}}
279 
281 
282 namespace Gecode { namespace Float { namespace Branch {
283 
302  class ValCommitLqGq : public ValCommit<FloatView,FloatVal> {
303  public:
305  ValCommitLqGq(Space& home, const ValBranch<Var>& vb);
307  ValCommitLqGq(Space& home, bool shared, ValCommitLqGq& vc);
309  ModEvent commit(Space& home, unsigned int a, FloatView x, int i,
310  FloatNumBranch n);
312  NGL* ngl(Space& home, unsigned int a, FloatView x, FloatNumBranch n) const;
314  void print(const Space& home, unsigned int a, FloatView x, int i,
315  FloatNumBranch n,
316  std::ostream& o) const;
317  };
318 
319 }}}
320 
322 
323 namespace Gecode { namespace Float { namespace Branch {
324 
328  valselcommit(Space& home, const FloatValBranch& svb);
329 
333  valselcommit(Space& home, const FloatAssign& ia);
334 
335 }}}
336 
337 #endif
338 
339 // STATISTICS: float-branch
#define GECODE_FLOAT_EXPORT
Definition: float.hh:72
Value selection class for random value of view.
Definition: branch.hh:261
CHB chb
CHB information.
Definition: branch.hh:183
Which values to select for branching first.
Definition: float.hh:1757
Rnd r
The used random number generator.
Definition: branch.hh:264
Merit class for AFC over size.
Definition: branch.hh:134
Value commit class for less or equal or greater or equal.
Definition: branch.hh:302
Abstract class for view selection.
MeritMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:46
int ModEvent
Type for modification events.
Definition: core.hpp:142
Base-class for merit class.
Which variable to select for branching.
Definition: float.hh:1605
Computation spaces.
Definition: core.hpp:1748
Merit class for maximum of float view.
Definition: branch.hh:86
Base class for value selection and commit.
Base class for value commit.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
AFC afc
AFC information.
Definition: branch.hh:137
Value selection class for values smaller than median of view.
Definition: branch.hh:229
Gecode::IntArgs i(4, 1, 2, 3, 4)
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:44
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
double operator()(const Space &home, FloatView x, int i)
Return minimum as merit for view x at position i.
Definition: merit.hpp:52
Value description class for branching.
Definition: float.hh:1408
Merit class for CHB Q-score over size.
Definition: branch.hh:180
Class for CHB management.
Definition: chb.hpp:50
ViewSel< FloatView > * viewsel(Space &home, const FloatVarBranch &fvb)
Return view selectors for float views.
Definition: view-sel.cpp:43
Float view for float variables.
Definition: view.hpp:56
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Value selection class for values smaller than median of view.
Definition: branch.hh:245
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
Definition: print.hpp:67
Value branching information.
Definition: branch-val.hpp:45
Variable branching information.
Definition: branch-var.hpp:59
Which values to select for assignment.
Definition: float.hh:1811
Post propagator for SetVar x
Definition: set.hh:784
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
Definition: view.hpp:702
Merit class for degree over size.
Definition: branch.hh:118
Gecode toplevel namespace
Class for action management.
Definition: action.hpp:46
void dispose(Space &home)
Delete view merit class.
Random number generator.
Definition: rnd.hpp:46
Action action
Action information.
Definition: branch.hh:160
Merit class for mimimum.
Definition: branch.hh:70
Merit class for action over size.
Definition: branch.hh:157
ValSelCommitBase< FloatView, FloatNumBranch > * valselcommit(Space &home, const FloatValBranch &fvb)
Return value and commit for float views.
Merit class for size of float view.
Definition: branch.hh:102
Base class for value selection.
No-good literal recorded during search.
Definition: core.hpp:1342