Generated on Tue Jan 28 2020 00:00:00 for Gecode by doxygen 1.8.17
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  *
6  * Copyright:
7  * Christian Schulte, 2012
8  *
9  * Last modified:
10  * $Date: 2017-04-01 20:27:10 +0200 (Sat, 01 Apr 2017) $ by $Author: schulte $
11  * $Revision: 15623 $
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 #ifndef __GECODE_INT_BRANCH_HH__
39 #define __GECODE_INT_BRANCH_HH__
40 
41 #include <gecode/int.hh>
42 
48 namespace Gecode { namespace Int { namespace Branch {
49 
68  template<class View>
69  class MeritMin : public MeritBase<View,int> {
70  public:
71  using typename MeritBase<View,int>::Var;
73  MeritMin(Space& home, const VarBranch<Var>& vb);
75  MeritMin(Space& home, bool shared, MeritMin& m);
77  int operator ()(const Space& home, View x, int i);
78  };
79 
86  template<class View>
87  class MeritMax : public MeritBase<View,int> {
88  public:
89  using typename MeritBase<View,int>::Var;
91  MeritMax(Space& home, const VarBranch<Var>& vb);
93  MeritMax(Space& home, bool shared, MeritMax& m);
95  int operator ()(const Space& home, View x, int i);
96  };
97 
104  template<class View>
105  class MeritSize : public MeritBase<View,unsigned int> {
106  public:
107  using typename MeritBase<View,unsigned int>::Var;
109  MeritSize(Space& home, const VarBranch<Var>& vb);
111  MeritSize(Space& home, bool shared, MeritSize& m);
113  unsigned int operator ()(const Space& home, View x, int i);
114  };
115 
122  template<class View>
123  class MeritDegreeSize : public MeritBase<View,double> {
124  public:
125  using typename MeritBase<View,double>::Var;
127  MeritDegreeSize(Space& home, const VarBranch<Var>& vb);
129  MeritDegreeSize(Space& home, bool shared, MeritDegreeSize& m);
131  double operator ()(const Space& home, View x, int i);
132  };
133 
140  template<class View>
141  class MeritAFCSize : public MeritBase<View,double> {
142  using typename MeritBase<View,double>::Var;
143  protected:
146  public:
148  MeritAFCSize(Space& home, const VarBranch<Var>& vb);
150  MeritAFCSize(Space& home, bool shared, MeritAFCSize& m);
152  double operator ()(const Space& home, View x, int i);
154  bool notice(void) const;
156  void dispose(Space& home);
157  };
158 
165  template<class View>
166  class MeritActionSize : public MeritBase<View,double> {
167  using typename MeritBase<View,double>::Var;
168  protected:
171  public:
173  MeritActionSize(Space& home, const VarBranch<Var>& vb);
175  MeritActionSize(Space& home, bool shared, MeritActionSize& m);
177  double operator ()(const Space& home, View x, int i);
179  bool notice(void) const;
181  void dispose(Space& home);
182  };
183 
190  template<class View>
191  class MeritCHBSize : public MeritBase<View,double> {
192  using typename MeritBase<View,double>::Var;
193  protected:
196  public:
198  MeritCHBSize(Space& home, const VarBranch<Var>& vb);
200  MeritCHBSize(Space& home, bool shared, MeritCHBSize& m);
202  double operator ()(const Space& home, View x, int i);
204  bool notice(void) const;
206  void dispose(Space& home);
207  };
208 
215  template<class View>
216  class MeritRegretMin : public MeritBase<View,unsigned int> {
217  public:
218  using typename MeritBase<View,unsigned int>::Var;
220  MeritRegretMin(Space& home, const VarBranch<Var>& vb);
222  MeritRegretMin(Space& home, bool shared, MeritRegretMin& m);
224  unsigned int operator ()(const Space& home, View x, int i);
225  };
226 
233  template<class View>
234  class MeritRegretMax : public MeritBase<View,unsigned int> {
235  public:
236  using typename MeritBase<View,unsigned int>::Var;
238  MeritRegretMax(Space& home, const VarBranch<Var>& vb);
240  MeritRegretMax(Space& home, bool shared, MeritRegretMax& m);
242  unsigned int operator ()(const Space& home, View x, int i);
243  };
244 
245 }}}
246 
248 
249 namespace Gecode { namespace Int { namespace Branch {
250 
253  ViewSel<IntView>* viewsel(Space& home, const IntVarBranch& ivb);
256  ViewSel<BoolView>* viewsel(Space& home, const BoolVarBranch& bvb);
257 
258 }}}
259 
260 namespace Gecode { namespace Int { namespace Branch {
261 
280  template<class View>
281  class ValSelMin : public ValSel<View,int> {
282  public:
283  using typename ValSel<View,int>::Var;
285  ValSelMin(Space& home, const ValBranch<Var>& vb);
287  ValSelMin(Space& home, bool shared, ValSelMin& vs);
289  int val(const Space& home, View x, int i);
290  };
291 
298  template<class View>
299  class ValSelMax : public ValSel<View,int> {
300  public:
301  using typename ValSel<View,int>::Var;
303  ValSelMax(Space& home, const ValBranch<Var>& vb);
305  ValSelMax(Space& home, bool shared, ValSelMax& vs);
307  int val(const Space& home, View x, int i);
308  };
309 
316  template<class View>
317  class ValSelMed : public ValSel<View,int> {
318  public:
319  using typename ValSel<View,int>::Var;
321  ValSelMed(Space& home, const ValBranch<Var>& vb);
323  ValSelMed(Space& home, bool shared, ValSelMed& vs);
325  int val(const Space& home, View x, int i);
326  };
327 
334  template<class View>
335  class ValSelAvg : public ValSel<View,int> {
336  public:
337  using typename ValSel<View,int>::Var;
339  ValSelAvg(Space& home, const ValBranch<Var>& vb);
341  ValSelAvg(Space& home, bool shared, ValSelAvg& vs);
343  int val(const Space& home, View x, int i);
344  };
345 
352  template<class View>
353  class ValSelRnd : public ValSel<View,int> {
354  using typename ValSel<View,int>::Var;
355  protected:
358  public:
360  ValSelRnd(Space& home, const ValBranch<Var>& vb);
362  ValSelRnd(Space& home, bool shared, ValSelRnd& vs);
364  int val(const Space& home, View x, int i);
366  bool notice(void) const;
368  void dispose(Space& home);
369  };
370 
377  class ValSelRangeMin : public ValSel<IntView,int> {
378  public:
380  ValSelRangeMin(Space& home, const ValBranch<IntVar>& vb);
382  ValSelRangeMin(Space& home, bool shared, ValSelRangeMin& vs);
384  int val(const Space& home, IntView x, int i);
385  };
386 
393  class ValSelRangeMax : public ValSel<IntView,int> {
394  public:
396  ValSelRangeMax(Space& home, const ValBranch<IntVar>& vb);
398  ValSelRangeMax(Space& home, bool shared, ValSelRangeMax& vs);
400  int val(const Space& home, IntView x, int i);
401  };
402 
403 }}}
404 
406 
407 namespace Gecode { namespace Int { namespace Branch {
408 
410  template<class View>
411  class EqNGL : public ViewValNGL<View,int,PC_INT_VAL> {
414  public:
416  EqNGL(Space& home, View x, int n);
418  EqNGL(Space& home, bool share, EqNGL& ngl);
420  virtual NGL::Status status(const Space& home) const;
422  virtual ExecStatus prune(Space& home);
424  virtual NGL* copy(Space& home, bool share);
425  };
426 
428  template<class View>
429  class NqNGL : public ViewValNGL<View,int,PC_INT_DOM> {
432  public:
434  NqNGL(Space& home, View x, int n);
436  NqNGL(Space& home, bool share, NqNGL& ngl);
438  virtual NGL::Status status(const Space& home) const;
440  virtual ExecStatus prune(Space& home);
442  virtual NGL* copy(Space& home, bool share);
443  };
444 
446  template<class View>
447  class LqNGL : public ViewValNGL<View,int,PC_INT_BND> {
450  public:
452  LqNGL(Space& home, View x, int n);
454  LqNGL(Space& home, bool share, LqNGL& ngl);
456  virtual NGL::Status status(const Space& home) const;
458  virtual ExecStatus prune(Space& home);
460  virtual NGL* copy(Space& home, bool share);
461  };
462 
464  template<class View>
465  class GqNGL : public ViewValNGL<View,int,PC_INT_BND> {
468  public:
470  GqNGL(Space& home, View x, int n);
472  GqNGL(Space& home, bool share, GqNGL& ngl);
474  virtual NGL::Status status(const Space& home) const;
476  virtual ExecStatus prune(Space& home);
478  virtual NGL* copy(Space& home, bool share);
479  };
480 
481 }}}
482 
483 #include <gecode/int/branch/ngl.hpp>
484 
485 namespace Gecode { namespace Int { namespace Branch {
486 
505  template<class View>
506  class ValCommitEq : public ValCommit<View,int> {
507  public:
508  using typename ValCommit<View,int>::Var;
510  ValCommitEq(Space& home, const ValBranch<Var>& vb);
512  ValCommitEq(Space& home, bool shared, ValCommitEq& vc);
514  ModEvent commit(Space& home, unsigned int a, View x, int i, int n);
516  NGL* ngl(Space& home, unsigned int a, View x, int n) const;
518  void print(const Space& home, unsigned int a, View x, int i, int n,
519  std::ostream& o) const;
520  };
521 
528  template<class View>
529  class ValCommitLq : public ValCommit<View,int> {
530  public:
531  using typename ValCommit<View,int>::Var;
533  ValCommitLq(Space& home, const ValBranch<Var>& vb);
535  ValCommitLq(Space& home, bool shared, ValCommitLq& vc);
537  ModEvent commit(Space& home, unsigned int a, View x, int i, int n);
539  NGL* ngl(Space& home, unsigned int a, View x, int n) const;
541  void print(const Space& home, unsigned int a, View x, int i, int n,
542  std::ostream& o) const;
543  };
544 
551  template<class View>
552  class ValCommitGq : public ValCommit<View,int> {
553  public:
554  using typename ValCommit<View,int>::Var;
556  ValCommitGq(Space& home, const ValBranch<Var>& vb);
558  ValCommitGq(Space& home, bool shared, ValCommitGq& vc);
560  ModEvent commit(Space& home, unsigned int a, View x, int i, int n);
562  NGL* ngl(Space& home, unsigned int a, View x, int n) const;
564  void print(const Space& home, unsigned int a, View x, int i, int n,
565  std::ostream& o) const;
566  };
567 
574  template<class View>
575  class ValCommitGr : public ValCommit<View,int> {
576  public:
577  using typename ValCommit<View,int>::Var;
579  ValCommitGr(Space& home, const ValBranch<Var>& vb);
581  ValCommitGr(Space& home, bool shared, ValCommitGr& vc);
583  ModEvent commit(Space& home, unsigned int a, View x, int i, int n);
585  NGL* ngl(Space& home, unsigned int a, View x, int n) const;
587  void print(const Space& home, unsigned int a, View x, int i, int n,
588  std::ostream& o) const;
589  };
590 
591 }}}
592 
594 
595 namespace Gecode { namespace Int { namespace Branch {
596 
599  ValSelCommitBase<IntView,int>*
600  valselcommit(Space& home, const IntValBranch& ivb);
601 
604  ValSelCommitBase<BoolView,int>*
605  valselcommit(Space& home, const BoolValBranch& bvb);
606 
609  ValSelCommitBase<IntView,int>*
610  valselcommit(Space& home, const IntAssign& ia);
611 
614  ValSelCommitBase<BoolView,int>*
615  valselcommit(Space& home, const BoolAssign& ba);
616 
617 }}}
618 
619 namespace Gecode { namespace Int { namespace Branch {
620 
625  template<int n, bool min, class Filter, class Print>
626  class ViewValuesBrancher : public ViewBrancher<IntView,Filter,n> {
627  protected:
631  Print p;
637  IntBranchFilter bf,
638  IntVarValPrint vvp);
639  public:
641  virtual const Choice* choice(Space& home);
643  virtual const Choice* choice(const Space& home, Archive& e);
645  virtual ExecStatus commit(Space& home, const Choice& c, unsigned int a);
647  virtual NGL* ngl(Space& home, const Choice& c, unsigned int a) const;
655  virtual void print(const Space& home, const Choice& c, unsigned int a,
656  std::ostream& o) const;
658  virtual Actor* copy(Space& home, bool share);
660  static void post(Home home, ViewArray<IntView>& x,
662  IntBranchFilter bf,
663  IntVarValPrint vvp);
665  virtual size_t dispose(Space& home);
666  };
667 
669  template<int n, bool min>
671  ViewSel<IntView>* vs[n],
672  IntBranchFilter bf,
673  IntVarValPrint vvp);
674 
675 }}}
676 
678 
679 #endif
680 
681 // STATISTICS: int-branch
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Definition: merit.hpp:177
Class for action management.
Definition: action.hpp:46
Post propagator for SetVar x
Definition: set.hh:784
MeritRegretMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:204
virtual NGL * copy(Space &home, bool share)
Create copy.
Definition: ngl.hpp:78
ValSelRnd(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition: val-sel.hpp:98
NqNGL(Space &home, View x, int n)
Constructor for creation.
Definition: ngl.hpp:70
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
Definition: val-commit.hpp:142
MeritMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:58
Value selection class for random value of view.
Definition: branch.hh:353
Merit class for size.
Definition: branch.hh:105
Merit class for CHB over size.
Definition: branch.hh:191
ValSelMed(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition: val-sel.hpp:70
virtual Actor * copy(Space &home, bool share)
Perform cloning.
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
Definition: val-commit.hpp:137
ViewSel< IntView > * viewsel(Space &home, const IntVarBranch &ivb)
Return view selectors for integer views.
Definition: view-sel.cpp:43
MeritCHBSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:160
Value commit class for greater.
Definition: branch.hh:575
Class for CHB management.
Definition: chb.hpp:50
Base class for value selection.
Gecode::IntArgs i(4, 1, 2, 3, 4)
ValCommitLq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition: val-commit.hpp:71
Archive representation
Definition: archive.hpp:45
Value selection class for maximum of view.
Definition: branch.hh:299
ValSelAvg(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition: val-sel.hpp:84
ViewArray< IntView > x
Views to branch on.
Base class for value commit.
Computation spaces.
Definition: core.hpp:1748
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition: ngl.hpp:83
virtual NGL * copy(Space &home, bool share)
Create copy.
Definition: ngl.hpp:136
double operator()(const Space &home, View x, int i)
Return action over size as merit for view x at position i.
Definition: merit.hpp:143
Base-class for both propagators and branchers.
Definition: core.hpp:696
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Definition: val-sel.hpp:120
EqNGL(Space &home, View x, int n)
Constructor for creation.
Definition: ngl.hpp:42
AFC afc
AFC information.
Definition: branch.hh:145
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition: ngl.hpp:121
Value commit class for equality.
Definition: branch.hh:506
Brancher by view and values selection
Definition: branch.hh:626
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition: val-sel.hpp:78
double operator()(const Space &home, View x, int i)
Return degree over size as merit for view x at position i.
Definition: merit.hpp:97
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition: val-sel.hpp:108
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Definition: val-commit.hpp:63
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
Definition: val-commit.hpp:55
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition: ngl.hpp:141
Rnd r
The used random number generator.
Definition: branch.hh:357
MeritSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:73
No-good literal for less or equal.
Definition: branch.hh:447
View View
View type.
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
Definition: val-commit.hpp:50
CHB chb
CHB information.
Definition: branch.hh:195
double operator()(const Space &home, View x, int i)
Return AFC over size as merit for view x at position i.
Definition: merit.hpp:114
Variable branching information.
Definition: branch-var.hpp:59
Gecode toplevel namespace
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition: ngl.hpp:151
Value commit class for greater or equal.
Definition: branch.hh:552
No-good literal for greater or equal.
Definition: branch.hh:465
int operator()(const Space &home, View x, int i)
Return maximum as merit for view x at position i.
Definition: merit.hpp:66
Generic brancher by view selection.
Value selection class for maximum range of integer view.
Definition: branch.hh:393
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition: ipl.hpp:53
MeritActionSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:131
virtual NGL * copy(Space &home, bool share)
Create copy.
Definition: ngl.hpp:50
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Definition: val-commit.hpp:92
ViewSel< IntView > * vs[n]
View selection objects.
void dispose(Space &home)
Delete value selection.
Definition: val-sel.hpp:125
double operator()(const Space &home, View x, int i)
Return size over action as merit for view x at position i.
Definition: merit.hpp:172
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition: ngl.hpp:55
Value selection class for median of view.
Definition: branch.hh:317
int operator()(const Space &home, View x, int i)
Return minimum as merit for view x at position i.
Definition: merit.hpp:51
#define GECODE_INT_EXPORT
Definition: int.hh:81
ValCommitGq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition: val-commit.hpp:100
ValCommitEq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition: val-commit.hpp:42
Home class for posting propagators
Definition: core.hpp:922
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Merit class for AFC over size.
Definition: branch.hh:141
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Base-class for merit class.
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition: ngl.hpp:63
Merit class for minimum regret.
Definition: branch.hh:216
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Definition: merit.hpp:148
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Definition: val-commit.hpp:121
Value branching information.
Definition: branch-val.hpp:45
int n
The stored value.
View View
View type.
MeritRegretMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:189
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
Definition: val-commit.hpp:113
unsigned int operator()(const Space &home, View x, int i)
Return size as merit for view x at position i.
Definition: merit.hpp:81
Random number generator.
Definition: rnd.hpp:46
No-good literal for equality.
Definition: branch.hh:411
View-value no-good literal.
LqNGL(Space &home, View x, int n)
Constructor for creation.
Definition: ngl.hpp:98
virtual size_t dispose(Space &home)
Delete brancher and return its size.
void dispose(Space &home)
Dispose view selection.
Definition: merit.hpp:153
View x
The stored view.
GqNGL(Space &home, View x, int n)
Constructor for creation.
Definition: ngl.hpp:128
virtual const Choice * choice(Space &home)
Return choice.
ValSelMin(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition: val-sel.hpp:42
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition: ngl.hpp:111
Merit class for mimimum of integer views.
Definition: branch.hh:69
Action action
Action information.
Definition: branch.hh:170
int ModEvent
Type for modification events.
Definition: core.hpp:142
Value commit class for less or equal.
Definition: branch.hh:529
Value selection class for average of view.
Definition: branch.hh:335
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Definition: val-commit.hpp:150
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
Definition: val-commit.hpp:108
void dispose(Space &home)
Dispose view selection.
Definition: merit.hpp:182
ValSelMax(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition: val-sel.hpp:56
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:44
int val(const Space &home, IntView x, int i)
Return value of integer view x at position i.
Definition: val-sel.hpp:152
Merit class for maximum regret.
Definition: branch.hh:234
static void post(Home home, ViewArray< IntView > &x, ViewSel< IntView > *vs[n], IntBranchFilter bf, IntVarValPrint vvp)
Post function for creation.
bool shared(const IntSet &, VX)
Definition: view-base.hpp:122
virtual NGL * copy(Space &home, bool share)
Create copy.
Definition: ngl.hpp:106
unsigned int operator()(const Space &home, View x, int i)
Return maximum regret as merit for view x at position i.
Definition: merit.hpp:212
Integer view for integer variables.
Definition: view.hpp:129
MeritMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:43
virtual void print(const Space &home, const Choice &c, unsigned int a, std::ostream &o) const
Print branch for choice c and alternative a.
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
Definition: int.hh:3843
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition: val-sel.hpp:92
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
Definition: val-commit.hpp:79
void postviewvaluesbrancher(Home home, ViewArray< IntView > &x, ViewSel< IntView > *vs[n], IntBranchFilter bf, IntVarValPrint vvp)
Post brancher for view and values.
unsigned int operator()(const Space &home, View x, int i)
Return minimum regret as merit for view x at position i.
Definition: merit.hpp:197
ValSelRangeMax(Space &home, const ValBranch< IntVar > &vb)
Constructor for initialization.
Definition: val-sel.hpp:146
Gecode::FloatVal c(-8, 8)
ViewValuesBrancher(Space &home, bool shared, ViewValuesBrancher &b)
Constructor for cloning b.
No-good literal recorded during search.
Definition: core.hpp:1342
No-good literal for disequality.
Definition: branch.hh:429
virtual NGL * ngl(Space &home, const Choice &c, unsigned int a) const
Create no-good literal for choice c and alternative a.
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
int val(const Space &home, IntView x, int i)
Return value of integer view x at position i.
Definition: val-sel.hpp:136
Status
The status of a no-good literal.
Definition: core.hpp:1348
Choice for performing commit
Definition: core.hpp:1414
ValSelCommitBase< IntView, int > * valselcommit(Space &home, const IntValBranch &ivb)
Return value and commit for integer views.
Print p
Print function.
Definition: branch.hh:631
void dispose(Space &home)
Dispose view selection.
Definition: merit.hpp:124
Value selection class for minimum range of integer view.
Definition: branch.hh:377
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition: val-sel.hpp:50
Merit class for maximum.
Definition: branch.hh:87
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition: val-sel.hpp:64
Value selection class for mimimum of view.
Definition: branch.hh:281
View View
View type.
ValCommitGr(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition: val-commit.hpp:129
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Definition: merit.hpp:119
Merit class for action over size.
Definition: branch.hh:166
MeritDegreeSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:88
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int a)
Perform commit for choice c and alternative a.
std::function< void(const Space &home, const Brancher &b, unsigned int a, IntVar x, int i, const int &n, std::ostream &o)> IntVarValPrint
Function type for printing branching alternatives for integer variables.
Definition: int.hh:4201
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition: ngl.hpp:91
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
Definition: val-commit.hpp:84
ExecStatus
Definition: core.hpp:540
Merit class for degree over size.
Definition: branch.hh:123
MeritAFCSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition: merit.hpp:104
ValSelRangeMin(Space &home, const ValBranch< IntVar > &vb)
Constructor for initialization.
Definition: val-sel.hpp:130