48 #ifndef __GECODE_INT_HH__ 49 #define __GECODE_INT_HH__ 67 #if !defined(GECODE_STATIC_LIBS) && \ 68 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER)) 70 #ifdef GECODE_BUILD_INT 71 #define GECODE_INT_EXPORT __declspec( dllexport ) 73 #define GECODE_INT_EXPORT __declspec( dllimport ) 78 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY 79 #define GECODE_INT_EXPORT __attribute__ ((visibility("default"))) 81 #define GECODE_INT_EXPORT 87 #ifndef GECODE_BUILD_INT 88 #define GECODE_LIBRARY_NAME "Int" 105 namespace Gecode {
namespace Int {
116 const int max = INT_MAX - 1;
122 const long long int llmax = LLONG_MAX - 1;
130 bool valid(
long long int n);
132 void check(
int n,
const char*
l);
134 void check(
long long int n,
const char*
l);
138 void positive(
long long int n,
const char*
l);
165 template<
class I>
class IntSetInit;
241 int min(
int i)
const;
243 int max(
int i)
const;
245 unsigned int width(
int i)
const;
250 bool in(
int n)
const;
253 unsigned int size(
void)
const;
255 unsigned int width(
void)
const;
277 const IntSet::Range* i;
279 const IntSet::Range* e;
306 unsigned int width(
void)
const;
332 template<
class Char,
class Traits>
333 std::basic_ostream<Char,Traits>&
425 unsigned int size(
void)
const;
427 unsigned int width(
void)
const;
436 bool range(
void)
const;
439 bool in(
int n)
const;
447 template<
class Char,
class Traits>
448 std::basic_ostream<Char,Traits>&
547 unsigned int size(
void)
const;
549 unsigned int width(
void)
const;
558 bool range(
void)
const;
561 bool in(
int n)
const;
566 bool zero(
void)
const;
569 bool one(
void)
const;
571 bool none(
void)
const;
579 template<
class Char,
class Traits>
580 std::basic_ostream<Char,Traits>&
623 template<
class InputIterator>
624 IntArgs(InputIterator first, InputIterator last);
654 template<
class InputIterator>
709 template<
class InputIterator>
1730 sorted(Home home,
const IntVarArgs&
x,
const IntVarArgs&
y,
1745 sorted(Home home,
const IntVarArgs&
x,
const IntVarArgs&
y,
1746 const IntVarArgs&
z,
1848 count(Home home,
const IntVarArgs&
x,
const IntVarArgs&
c,
1885 count(Home home,
const IntVarArgs&
x,
1886 const IntVarArgs&
c,
const IntArgs&
v,
1906 count(Home home,
const IntVarArgs&
x,
1927 count(Home home,
const IntVarArgs&
x,
1928 const IntSet&
c,
const IntArgs&
v,
1991 sequence(Home home,
const IntVarArgs&
x,
const IntSet& s,
2009 sequence(Home home,
const BoolVarArgs&
x,
const IntSet& s,
2048 Transition(
int i_state0,
int symbol0,
int o_state0);
2088 int val(
void)
const;
2229 int arity(
void)
const;
2235 int min(
void)
const;
2237 int max(
void)
const;
2300 min(Home home, IntVar x0, IntVar x1, IntVar x2,
2310 min(Home home,
const IntVarArgs&
x, IntVar
y,
2318 max(Home home, IntVar x0, IntVar x1, IntVar x2,
2328 max(Home home,
const IntVarArgs&
x, IntVar
y,
2353 argmin(Home home,
const IntVarArgs&
x,
int o, IntVar
y,
bool tiebreak=
true,
2377 argmax(Home home,
const IntVarArgs&
x,
int o, IntVar
y,
bool tiebreak=
true,
2386 abs(Home home, IntVar x0, IntVar x1,
2395 mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2403 divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2411 div(Home home, IntVar x0, IntVar x1, IntVar x2,
2419 mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2428 sqr(Home home, IntVar x0, IntVar x1,
2437 sqrt(Home home, IntVar x0, IntVar x1,
2449 pow(Home home, IntVar x0,
int n, IntVar x1,
2461 nroot(Home home, IntVar x0,
int n, IntVar x1,
2502 linear(Home home,
const IntVarArgs&
x,
2509 linear(Home home,
const IntVarArgs&
x,
2516 linear(Home home,
const IntVarArgs&
x,
2523 linear(Home home,
const IntVarArgs&
x,
2533 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2543 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2553 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2563 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2596 linear(Home home,
const BoolVarArgs&
x,
2603 linear(Home home,
const BoolVarArgs&
x,
2610 linear(Home home,
const BoolVarArgs&
x,
2617 linear(Home home,
const BoolVarArgs&
x,
2627 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2637 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2647 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2657 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2690 const IntVarArgs&
l,
2691 const IntVarArgs&
b,
const IntArgs& s,
2733 const IntVarArgs&
l,
const IntVarArgs&
b,
2734 const IntArgs& s,
const IntArgs&
c,
2758 const IntVarArgs&
x,
const IntArgs& w,
2759 const IntVarArgs&
y,
const IntArgs& h,
2776 const IntVarArgs&
x,
const IntArgs& w,
2777 const IntVarArgs&
y,
const IntArgs& h,
2778 const BoolVarArgs& o,
2798 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2799 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2820 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2821 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2822 const BoolVarArgs& o,
2876 const IntVarArgs& s,
const IntVarArgs&
p,
2877 const IntVarArgs& e,
const IntVarArgs&
u,
2878 const IntArgs&
c,
bool at_most,
2886 const IntVarArgs& s,
const IntVarArgs&
p,
2887 const IntVarArgs& e,
const IntVarArgs&
u,
2888 const IntArgs&
c,
bool at_most,
2896 const IntVarArgs& s,
const IntArgs&
p,
2897 const IntVarArgs& e,
const IntVarArgs&
u,
2898 const IntArgs&
c,
bool at_most,
2906 const IntVarArgs& s,
const IntArgs&
p,
2907 const IntVarArgs& e,
const IntVarArgs&
u,
2908 const IntArgs&
c,
bool at_most,
2916 const IntVarArgs& s,
const IntVarArgs&
p,
2917 const IntVarArgs& e,
const IntArgs&
u,
2918 const IntArgs&
c,
bool at_most,
2926 const IntVarArgs& s,
const IntVarArgs&
p,
2927 const IntVarArgs& e,
const IntArgs&
u,
2928 const IntArgs&
c,
bool at_most,
2936 const IntVarArgs& s,
const IntArgs&
p,
2937 const IntVarArgs& e,
const IntArgs&
u,
2938 const IntArgs&
c,
bool at_most,
2946 const IntVarArgs& s,
const IntArgs&
p,
2947 const IntVarArgs& e,
const IntArgs&
u,
2948 const IntArgs&
c,
bool at_most,
2978 unary(Home home,
const IntVarArgs& s,
const IntArgs&
p,
3010 unary(Home home,
const IntVarArgs& s,
const IntArgs&
p,
3093 const IntVarArgs& flex,
const IntArgs& fix,
3123 unary(Home home,
const IntVarArgs& s,
const IntVarArgs&
p,
3155 unary(Home home,
const IntVarArgs& s,
const IntVarArgs&
p,
3204 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
3214 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
3263 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
3271 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
3307 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs&
p,
3314 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs&
p,
3352 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs&
p,
3359 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs&
p,
3399 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs&
p,
3406 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs&
p,
3448 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs&
p,
3449 const IntVarArgs& e,
const IntArgs&
u,
const BoolVarArgs& m,
3456 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs&
p,
3457 const IntVarArgs& e,
const IntArgs&
u,
const BoolVarArgs& m,
3482 circuit(Home home,
const IntVarArgs&
x,
3500 circuit(Home home,
int offset,
const IntVarArgs&
x,
3526 const IntVarArgs&
x,
const IntVarArgs&
y, IntVar
z,
3552 const IntArgs&
c,
int offset,
3553 const IntVarArgs&
x,
const IntVarArgs&
y, IntVar
z,
3576 const IntVarArgs&
x, IntVar
z,
3600 const IntArgs&
c,
int offset,
3601 const IntVarArgs&
x, IntVar
z,
3619 path(Home home,
const IntVarArgs&
x, IntVar s, IntVar e,
3639 path(Home home,
int offset,
const IntVarArgs&
x, IntVar s, IntVar e,
3666 const IntVarArgs&
x, IntVar s, IntVar e,
const IntVarArgs&
y, IntVar
z,
3694 const IntArgs&
c,
int offset,
3695 const IntVarArgs&
x, IntVar s, IntVar e,
const IntVarArgs&
y, IntVar
z,
3720 const IntVarArgs&
x, IntVar s, IntVar e, IntVar
z,
3746 const IntArgs&
c,
int offset,
3747 const IntVarArgs&
x, IntVar s, IntVar e, IntVar
z,
3763 wait(Home home, IntVar
x, std::function<
void(Space& home)>
c,
3767 wait(Home home, BoolVar
x, std::function<
void(Space& home)>
c,
3771 wait(Home home,
const IntVarArgs&
x, std::function<
void(Space& home)>
c,
3775 wait(Home home,
const BoolVarArgs&
x,
3776 std::function<
void(Space& home)>
c,
3780 when(Home home, BoolVar
x,
3781 std::function<
void(Space& home)>
t,
3782 std::function<
void(Space& home)> e,
3786 when(Home home, BoolVar
x,
3787 std::function<
void(Space& home)>
t,
3842 typedef std::function<bool(
const Space& home, IntVar
x,
int i)>
3864 typedef std::function<double(
const Space& home,
IntVar x,
int i)>
3875 typedef std::function<double(
const Space& home,
BoolVar x,
int i)>
3888 typedef std::function<int(
const Space& home,
IntVar x,
int i)>
3914 typedef std::function<void(
Space& home,
unsigned int a,
3928 typedef std::function<void(
Space& home,
unsigned int a,
4197 typedef std::function<void(
const Space &home,
const Brancher&
b,
4199 IntVar
x,
int i,
const int&
n,
4719 branch(Home home,
const IntVarArgs&
x,
4720 IntVarBranch vars, IntValBranch vals,
4729 branch(Home home,
const IntVarArgs&
x,
4730 TieBreak<IntVarBranch> vars, IntValBranch vals,
4739 branch(Home home, IntVar
x, IntValBranch vals,
4747 branch(Home home,
const BoolVarArgs&
x,
4748 BoolVarBranch vars, BoolValBranch vals,
4757 branch(Home home,
const BoolVarArgs&
x,
4758 TieBreak<BoolVarBranch> vars, BoolValBranch vals,
4767 branch(Home home, BoolVar
x, BoolValBranch vals,
4776 assign(Home home,
const IntVarArgs&
x, IntAssign vals,
4785 assign(Home home, IntVar
x, IntAssign vals,
4793 assign(Home home,
const BoolVarArgs&
x, BoolAssign vals,
4802 assign(Home home, BoolVar
x, BoolAssign vals,
4812 template<
class Char,
class Traits>
4813 std::basic_ostream<Char,Traits>&
4814 operator <<(std::basic_ostream<Char,Traits>& os,
const DFA&
d);
4819 template<
class Char,
class Traits>
4820 std::basic_ostream<Char,Traits>&
4821 operator <<(std::basic_ostream<Char,Traits>& os,
const TupleSet& ts);
4828 namespace Int {
namespace LDSB {
4829 class SymmetryObject;
4842 void increment(
void);
4844 void decrement(
void);
4884 const IntArgs& indices);
4931 branch(Home home,
const IntVarArgs&
x,
4932 IntVarBranch vars, IntValBranch vals,
4933 const Symmetries& syms,
4948 branch(Home home,
const IntVarArgs&
x,
4949 TieBreak<IntVarBranch> vars, IntValBranch vals,
4950 const Symmetries& syms,
4965 branch(Home home,
const BoolVarArgs&
x,
4966 BoolVarBranch vars, BoolValBranch vals,
4967 const Symmetries& syms,
4982 branch(Home home,
const BoolVarArgs&
x,
4983 TieBreak<BoolVarBranch> vars, BoolValBranch vals,
4984 const Symmetries& syms,
5013 relax(Home home,
const IntVarArgs&
x,
const IntVarArgs& sx,
5038 relax(Home home,
const BoolVarArgs&
x,
const BoolVarArgs& sx,
5060 Int::ViewRanges<Int::IntView> > {
5098 int min(
void)
const;
5101 int max(
void)
const;
5103 unsigned int width(
void)
const;
Value iterator for integer variables.
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
std::function< void(Space &home, unsigned int a, IntVar x, int i, int n)> IntBranchCommit
Branch commit function type for integer variables.
std::function< double(const Space &home, BoolVar x, int i)> BoolBranchMerit
Branch merit function type for Boolean variables.
With smallest accumulated failure count.
Select select(void) const
Return selection strategy.
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
int min(void) const
Return minimum of domain.
static IntArgs create(int n, int start, int inc=1)
Allocate array with n elements such that for all .
bool range(void) const
Test whether domain is a range.
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
IntVar(void)
Default constructor.
Int::ViewRanges< Int::IntView > rn
Iterator over the new values.
Transitions(const DFA &d)
Initialize to all transitions of DFA d.
IntValBranch INT_VAL_RANGE_MIN(void)
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
int i_state(void) const
Return in-state of current transition.
Select value according to user-defined functions.
IntVarArgs(const VarArray< IntVar > &a)
Initialize from variable array a (copy elements)
Duplicate of a Boolean view.
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
void operator++(void)
Move iterator to next range (if possible)
IntValBranch(Select s=SEL_MIN)
Initialize with selection strategy s.
Variables as interfaces to variable implementations.
Tuple operator[](int i) const
Get tuple i.
Tracer that process view trace information.
IntVarBranch INT_VAR_CHB_SIZE_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score divided by domain size.
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
IntVarArray(void)
Default constructor (array of size 0)
IntAFC(void)
Construct as not yet initialized.
Select s
Which variable to select.
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int final_fst(void) const
Return the number of the first final state.
BoolVarBranch BOOL_VAR_NONE(void)
Select first unassigned variable.
int max(void) const
Return maximum of entire set.
void finalize(void)
Finalize tuple set.
TaskType
Type of task for scheduling constraints.
Inverse implication for reification.
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, const IntVarArgs &z, IntPropLevel)
Post propagator that y is x sorted in increasing order.
BoolVarArray(void)
Default constructor (array of size 0)
BoolVarBranch BOOL_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value)
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
Select s
Which value to select.
Range iterator for integer sets.
BoolAssign BOOL_ASSIGN_MIN(void)
Select smallest value.
BoolVarArgs(const VarArray< BoolVar > &a)
Initialize from variable array a (copy elements)
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
Iterator for DFA symbols.
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
IntSetValues(void)
Default constructor.
Which values to select for branching first.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Iter::Ranges::RangeList ro
Iterator over the old values.
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
ReifyMode mode(void) const
Return reification mode.
void init(Home home, const BoolVarArgs &x, double d=1.0)
Initialize for Boolean variables x with decay factor d.
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Reify(void)
Default constructor without proper initialization.
IntTraceDelta(Int::IntTraceView o, Int::IntView n, const Delta &d)
Initialize with old trace view o, new view n, and delta d.
void operator++(void)
Move iterator to next range (if possible)
Standard Boolean variable tracer.
int arity(void) const
Arity of tuple set.
Select
Which value selection.
bool in(int n) const
Test whether n is contained in domain.
Argument array for primtive types.
BoolOpType
Operation types for Booleans.
With smallest accumulated failure count.
Which values to select for branching first.
unsigned int size(void) const
Return size (cardinality) of domain.
BoolVarArgs(const BoolVarArgs &a)
Initialize from variable argument array a (copy elements)
IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Symbols(const DFA &d)
Initialize to symbols of DFA d.
Which integer variable to select for branching.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int excess
Excess storage.
With largest accumulated failure count.
void init(Home home, const IntVarArgs &x, IntBranchMerit bm=nullptr)
Initialize for integer variables x.
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
Select s
Which value to select.
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
void init(const IntSet &s)
Initialize with values for s.
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl)
Select variable with smallest min-regret.
IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
BoolVarBranch BOOL_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
BoolCHB(void)
Construct as not yet initialized.
bool normalize(Term< View > *t, int &n, Term< View > *&t_p, int &n_p, Term< View > *&t_n, int &n_n, int &g)
Normalize linear integer constraints.
Range iterator for range lists
With largest accumulated failure count divided by domain size.
IntVarBranch INT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
IntAssign(Select s=SEL_MIN)
Initialize with selection strategy s.
void operator++(void)
Move iterator to next transition.
int * Tuple
Type of a tuple.
void member(Home home, const IntVarArgs &x, IntVar y, IntPropLevel)
Post domain consistent propagator for .
BoolVarArgs(const std::vector< BoolVar > &a)
Initialize from vector a.
void path(Home home, int offset, const IntVarArgs &x, IntVar s, IntVar e, IntPropLevel ipl)
Post propagator such that x forms a Hamiltonian path.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Collection of symmetries.
Which values to select for assignment.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Implementation of a symmetry at the modelling level.
IntValBranch INT_VAL_RANGE_MAX(void)
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
IntVarBranch INT_VAR_CHB_SIZE_MIN(IntCHB c, BranchTbl tbl)
Select variable with smallest CHB Q-score divided by domain size.
void nonnegative(int n, const char *l)
Check whether n is in range and nonnegative, otherwise throw out of limits with information l.
IntVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value)
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
int max(void) const
Maximum domain element.
void circuit(Home home, int offset, const IntVarArgs &x, IntPropLevel ipl)
Post propagator such that x forms a circuit.
void argmin(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
bool operator()(void) const
Test whether iterator is still at a range or done.
int med(void) const
Return median of domain (greatest element not greater than the median)
BoolVarBranch BOOL_VAR_MERIT_MIN(BoolBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
IntVarArgs(const std::vector< IntVar > &a)
Initialize from vector a.
BoolAssign BOOL_ASSIGN_MAX(void)
Select largest value.
Select s
Which value to select.
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl)
Select variable with largest min-regret.
bool finalized(void) const
Is tuple set finalized.
void binpacking(Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntPropLevel)
Post propagator for bin packing.
ArgArray< IntSet > IntSetArgs
Passing set arguments.
const int max
Largest allowed integer value.
With largest accumulated failure count.
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Standard integer variable tracer.
Select s
Which value to select.
bool operator()(void) const
Test whether iterator still at a transition.
void init(const IntSet &s)
Initialize with ranges for set s.
ViewTracer< Int::IntView > IntTracer
Tracer for integer variables.
bool one(void) const
Test whether domain is one.
void init(Home home, const BoolVarArgs &x, BoolBranchMerit bm=nullptr)
Initialize for Boolean variables x.
const int min
Smallest allowed integer value.
IntVarArgs(int n)
Allocate array with n elements.
ViewTraceRecorder< Int::IntView > IntTraceRecorder
Trace recorder for integer variables.
IntVarBranch(void)
Initialize with strategy SEL_NONE.
Range iterator for integer variables
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Random (uniform, for tie breaking)
bool overflow_mul(int n, int m)
Check whether multiplying n and m would overflow.
IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Select s
Which variable to select.
Reify imp(BoolVar x)
Use implication for reification.
unsigned int size(void) const
Return size (cardinality) of domain.
int tuples(void) const
Number of tuples.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Deterministic finite automaton (DFA)
int p
Number of positive literals for node type.
IntVarBranch INT_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
With smallest max-regret.
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
IntVarBranch INT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Class for AFC (accumulated failure count) management.
IntRelType neg(IntRelType irt)
Return negated relation type of irt.
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
int n
Number of negative literals for node type.
BoolVar(void)
Default constructor.
Argument array for non-primitive types.
void unshare(Home home, IntVarArgs &x, IntPropLevel ipl)
Replace multiple variable occurences in x by fresh variables.
IntVarArgs(void)
Allocate empty array.
const long long int llmin
Smallest allowed long long integer value.
IntArgs(void)
Allocate empty array.
Select all values starting from largest.
Tuple ** last
Initial last structure.
With smallest min-regret.
A reference-counted pointer to a SymmetryObject.
BoolAction & operator=(const BoolAction &a)
Assignment operator.
void divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3, IntPropLevel)
Post propagator for .
std::function< int(const Space &home, IntVar x, int i)> IntBranchVal
Branch value function type for integer variables.
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel)
Post propagator for .
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
With largest action divided by domain size.
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value)
Select
Which value selection.
IntRelType
Relation types for integers.
IntVarValues(void)
Default constructor.
IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
SymmetryHandle ValueSequenceSymmetry(const IntArgs &vs, int ss)
Value sequences in v of size ss are interchangeable.
Select greatest value not greater than the median.
BoolVarBranch BOOL_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void init(Home home, const BoolVarArgs &x, double d=1.0, BoolBranchMerit bm=nullptr)
Initialize for Boolean variables x with decay factor d.
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
Simple propagation levels.
IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
void extensional(Home home, const IntVarArgs &x, DFA dfa, IntPropLevel)
Post domain consistent propagator for extensional constraint described by a DFA.
int val(void) const
Return assigned value.
bool range(void) const
Test whether domain is a range.
Select select(void) const
Return selection strategy.
Recording AFC information for integer variables.
bool operator()(void) const
Test whether iterator is still at a range or done.
Select select(void) const
Return selection strategy.
BoolVarBranch BOOL_VAR_CHB_MAX(BoolCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
unsigned int size(void) const
Return size (cardinality) of set.
int n_transitions(void) const
Return the number of transitions.
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Specification of a DFA transition.
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Use basic propagation algorithm.
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
int symbol_max(void) const
Return largest symbol in DFA.
Value iterator from range iterator.
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Class for CHB management.
Reification specification.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
SymmetryHandle ValueSymmetry(const IntArgs &vs)
Values in v are interchangeable.
IntValBranch INT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
unsigned int domsize
Domain size.
Range iterator for ranges of integer variable implementation.
IntVarBranch INT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
With largest domain size.
BoolAction(void)
Construct as not yet initialized.
Duplicate of an integer view.
Tuple ** tuples
Tuples index.
Recording AFC information for Boolean variables.
bool overflow_add(int n, int m)
Check whether adding n and m would overflow.
void argmax(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
Recording actions for Boolean variables.
void init(const IntVar &x)
Initialize with ranges for integer variable x.
BoolAFC(void)
Construct as not yet initialized.
int min
Minimum and maximum in domain-values.
BoolAssign BOOL_ASSIGN_RND(Rnd r)
Select random value.
Integer set initialization.
BoolAssign BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c.
IntValBranch INT_VAL(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Which Boolean variable to select for branching.
IntAction & operator=(const IntAction &a)
Assignment operator.
IntCHB & operator=(const IntCHB &chb)
Assignment operator.
int o_state
output state Default constructor
Tuple * nullpointer
Pointer to nullptr-pointer.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
IntVarBranch INT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
Use advanced propagation algorithm.
std::ostream & os
Output stream to use.
With largest CHB Q-score divided by domain size.
static StdIntTracer def
Default tracer (printing to std::cerr)
Recording CHB for integer variables.
Reify eqv(BoolVar x)
Use equivalence for reification.
int n
Number of variables (size)
With largest degree divided by domain size.
IntVarArgs(const IntVarArgs &a)
Initialize from variable argument array a (copy elements)
IntPropLevel sm(IntPropLevel ipl)
Extract speed or memory from propagation level.
Select value according to user-defined functions.
Passing integer variables.
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
SharedArray< int > IntSharedArray
Arrays of integers that can be shared among several element constraints.
unsigned int width(void) const
Return width of set (distance between maximum and minimum)
ViewTracer< Int::BoolView > BoolTracer
Tracer for Boolean variables.
Passing integer arguments.
BoolVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Passing Boolean variables.
Select values greater than mean of smallest and largest value.
static const IntSet empty
Empty set.
Tuple * tuple_data
Tuple index data.
With smallest CHB Q-score divided by domain size.
std::function< int(const Space &home, BoolVar x, int i)> BoolBranchVal
Branch value function type for Boolean variables.
IntSet(void)
Initialize as empty set.
void nooverlap(Home home, const IntVarArgs &x, const IntArgs &w, const IntVarArgs &y, const IntArgs &h, IntPropLevel)
Post propagator for rectangle packing.
Boolean integer variables.
Prefer to save memory Options: basic versus advanced propagation.
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.
Post propagator for SetVar SetOpType SetVar SetRelType r
Propagator for recording view trace information.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Class represeting a set of tuples.
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
int max(void) const
Return maximum of domain.
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
With smallest degree divided by domain size.
TupleSet(void)
Construct empty tuple set.
IntValBranch INT_VAL_MAX(void)
Select largest value.
IntVarBranch INT_VAR_CHB_MIN(IntCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
IntPropLevel
Propagation levels for integer propagators.
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Integer view for integer variables.
const int infinity
Infinity for integers.
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
int min(void) const
Return smallest value of range.
Post propagator for SetVar SetOpType SetVar y
void init(const IntVar &x)
Initialize with values x.
BoolVarArgs(int n)
Allocate array with n elements.
Value branching information.
BoolVarBranch BOOL_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
int min(void) const
Minimum domain element.
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Variable branching information.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
std::function< bool(const Space &home, BoolVar x, int i)> BoolBranchFilter
Branch filter function type for Boolean variables.
bool overflow_sub(int n, int m)
Check whether subtracting m from n would overflow.
void expand(Home home, const IntVarArgs &x)
Expand AFC, action, and CHB.
Select values not greater than mean of smallest and largest value.
BoolVarBranch BOOL_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Generic domain change information to be supplied to advisors.
int min(void) const
Return minimum of entire set.
DFA(void)
Initialize for DFA accepting the empty word.
With highest CHB Q-score.
unsigned int max_degree(void) const
Return maximal degree (in-degree and out-degree) of any state.
int min(void) const
Return minimum of domain.
IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
Select
Which value selection.
Rnd r
Random number generator.
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel)
Post propagator that s precedes t in x.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
IntVarBranch INT_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
BoolAFC & operator=(const BoolAFC &a)
Assignment operator.
BoolVarBranch BOOL_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
IntVarBranch INT_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count divided by domain size with decay factor d.
Which values to select for assignment.
bool zero(void) const
Test whether domain is zero.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Trace delta information for integer variables.
SymmetryHandle values_reflect(int lower, int upper)
The values from lower to upper (inclusive) can be reflected.
IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl)
Select variable with smallest max-regret.
Domain propagation Preferences: prefer speed or memory.
int min(void) const
Return smallest value of range.
BoolValBranch(Select s=SEL_MIN)
Initialize with selection strategy s.
Select
Which variable selection.
bool valid(int n)
Return whether n is in range.
Value iterator for integer sets.
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
BoolVar var(void) const
Return Boolean control variable.
With smallest action divided by domain size.
IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest action divided by domain size with decay factor d.
IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Select select(void) const
Return selection strategy.
Iterator for DFA transitions (sorted by symbols)
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Select value according to user-defined functions.
PrimArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl)
Select variable with largest max-regret.
Random (uniform, for tie breaking)
Select
Which variable selection.
With smallest domain size.
Post propagator for SetVar x
Archive & operator<<(Archive &e, FloatNumBranch nl)
void operator++(void)
Move iterator to next symbol.
BoolAssign(Select s=SEL_MIN)
Initialize with selection strategy s.
std::ostream & os
Output stream to use.
Select
Which value selection.
BoolVarBranch BOOL_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
std::function< void(const Space &home, const Brancher &b, unsigned int a, BoolVar x, int i, const int &n, std::ostream &o)> BoolVarValPrint
Function type for printing branching alternatives for Boolean variables.
bool operator()(void) const
Test whether iterator still at a symbol.
int ranges(void) const
Return number of ranges of the specification.
IntVarBranch INT_VAR_CHB_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
Recording CHB for Boolean variables.
BoolVarArgs(void)
Allocate empty array.
Select greatest value not greater than the median.
static StdBoolTracer def
Default tracer (printing to std::cerr)
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
int n_states(void) const
Return the number of states.
ViewTraceRecorder< Int::BoolView > BoolTraceRecorder
Trace recorder for Boolean variables.
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
IntVarRanges(void)
Default constructor.
Select select(void) const
Return selection strategy.
IntAFC & operator=(const IntAFC &a)
Assignment operator.
const long long int llmax
Largest allowed long long integer value.
int max(void) const
Return largest value of range.
Traits of arrays in Gecode.
int val(void) const
Return current symbol.
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
int size
Number of Tuples.
BoolValBranch BOOL_VAL(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Gecode toplevel namespace
Argument array for variables.
int med(void) const
Return median of domain (greatest element not greater than the median)
int symbol_min(void) const
Return smallest symbol in DFA.
Implication for reification.
void expand(Home home, const BoolVarArgs &x)
Expand decay factor into AFC or action.
Class for action management.
IntCHB(void)
Construct as not yet initialized.
BoolVarBranch BOOL_VAR_CHB_MIN(BoolCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
#define GECODE_VTABLE_EXPORT
Range iterator for computing set difference.
BoolVar x
The Boolean control variable.
BoolVarBranch BOOL_VAR_MERIT_MAX(BoolBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
bool in(int n) const
Return whether n is included in the set.
BoolCHB & operator=(const BoolCHB &chb)
Assignment operator.
BoolTraceDelta(Int::BoolTraceView o, Int::BoolView n, const Delta &d)
Initialize with old trace view o, new view n, and delta d.
int final_lst(void) const
Return the number of the last final state.
#define GECODE_INT_EXPORT
const long long int llinfinity
Infinity for long long integers.
void add(const IntArgs &tuple)
Add tuple to tuple set.
void init(Home home, const IntVarArgs &x, double d=1.0)
Initialize for integer variables x with decay factor d.
void cumulative(Home home, int c, const TaskTypeArgs &t, const IntVarArgs &s, const IntArgs &p, const IntArgs &u, IntPropLevel ipl)
Post propagators for scheduling tasks on cumulative resources.
IntSetRanges(void)
Default constructor.
void init(Home home, const IntVarArgs &x, double d=1.0, IntBranchMerit bm=nullptr)
Initialize for integer variables x with decay factor d.
IntAction(void)
Construct as not yet initialized.
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Home class for posting propagators
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value)
unsigned int n_symbols(void) const
Return the number of symbols.
std::function< double(const Space &home, IntVar x, int i)> IntBranchMerit
Branch merit function type for integer variables.
ReifyMode
Mode for reification.
Select value according to user-defined functions.
bool none(void) const
Test whether domain is neither zero nor one.
ReifyMode rm
The reification mode.
void positive(int n, const char *l)
Check whether n is in range and strictly positive, otherwise throw out of limits with information l.
int symbol(void) const
Return symbol of current transition.
bool in(int n) const
Test whether n is contained in domain.
Trace delta information for Boolean variables.
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntPropLevel ipl)
Post propagators for scheduling tasks on unary resources.
TupleSetI * implementation(void)
Get implementation.
int max(void) const
Return maximum of domain.
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Recording actions for integer variables.
int delta
Delta information.
Select select(void) const
Return selection strategy.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
void when(Home home, BoolVar x, std::function< void(Space &home)> t, std::function< void(Space &home)> e, IntPropLevel)
Execute t (then) when x is assigned one, and e (else) otherwise.
std::function< void(Space &home, unsigned int a, BoolVar x, int i, int n)> BoolBranchCommit
Branch commit function type for Boolean variables.
int o_state(void) const
Return out-state of current transition.
IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest action divided by domain size with decay factor d.
Select all values starting from smallest.
int max(void) const
Return largest value of range.
With smallest accumulated failure count divided by domain size.
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, int n, IntPropLevel)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
Equivalence for reification (default)
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.
BoolVarBranch(void)
Initialize with strategy SEL_NONE.
int val(void) const
Return assigned value.
Reify pmi(BoolVar x)
Use reverse implication for reification.
Boolean view for Boolean variables.
void cumulatives(Home home, const IntVarArgs &m, const IntVarArgs &s, const IntVarArgs &p, const IntVarArgs &e, const IntVarArgs &u, const IntArgs &c, bool at_most, IntPropLevel cl)
Post propagators for the cumulatives constraint.