48 #ifndef __GECODE_INT_HH__
49 #define __GECODE_INT_HH__
64 #if !defined(GECODE_STATIC_LIBS) && \
65 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
67 #ifdef GECODE_BUILD_INT
68 #define GECODE_INT_EXPORT __declspec( dllexport )
70 #define GECODE_INT_EXPORT __declspec( dllimport )
75 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
76 #define GECODE_INT_EXPORT __attribute__ ((visibility("default")))
78 #define GECODE_INT_EXPORT
84 #ifndef GECODE_BUILD_INT
85 #define GECODE_LIBRARY_NAME "Int"
102 namespace Gecode {
namespace Int {
113 const int max = INT_MAX - 1;
119 const long long int llmax = LLONG_MAX - 1;
127 bool valid(
long long int n);
129 void check(
int n,
const char*
l);
131 void check(
long long int n,
const char*
l);
135 void positive(
long long int n,
const char*
l);
162 template<
class I>
class IntSetInit;
238 int min(
int i)
const;
240 int max(
int i)
const;
242 unsigned int width(
int i)
const;
247 bool in(
int n)
const;
250 unsigned int size(
void)
const;
252 unsigned int width(
void)
const;
274 const IntSet::Range* i;
276 const IntSet::Range* e;
303 unsigned int width(
void)
const;
329 template<
class Char,
class Traits>
330 std::basic_ostream<Char,Traits>&
331 operator <<(std::basic_ostream<Char,Traits>& os,
const IntSet& s);
422 unsigned int size(
void)
const;
424 unsigned int width(
void)
const;
433 bool range(
void)
const;
436 bool in(
int n)
const;
444 template<
class Char,
class Traits>
445 std::basic_ostream<Char,Traits>&
446 operator <<(std::basic_ostream<Char,Traits>& os,
const IntVar&
x);
544 unsigned int size(
void)
const;
546 unsigned int width(
void)
const;
555 bool range(
void)
const;
558 bool in(
int n)
const;
563 bool zero(
void)
const;
566 bool one(
void)
const;
568 bool none(
void)
const;
576 template<
class Char,
class Traits>
577 std::basic_ostream<Char,Traits>&
578 operator <<(std::basic_ostream<Char,Traits>& os,
const BoolVar&
x);
618 IntArgs(
const std::vector<int>& x);
620 template<
class InputIterator>
621 IntArgs(InputIterator first, InputIterator last);
631 static IntArgs
create(
int n,
int start,
int inc=1);
651 template<
class InputIterator>
706 template<
class InputIterator>
1555 channel(Home home,
const BoolVarArgs&
x, IntVar y,
int o=0,
1577 sorted(Home home,
const IntVarArgs&
x,
const IntVarArgs& y,
1592 sorted(Home home,
const IntVarArgs&
x,
const IntVarArgs& y,
1593 const IntVarArgs& z,
1624 count(Home home,
const IntVarArgs&
x,
const IntSet& y,
IntRelType irt,
int m,
1644 count(Home home,
const IntVarArgs&
x,
const IntArgs& y,
IntRelType irt,
int m,
1658 count(Home home,
const IntVarArgs&
x,
const IntSet& y,
IntRelType irt, IntVar z,
1678 count(Home home,
const IntVarArgs&
x,
const IntArgs& y,
IntRelType irt, IntVar z,
1695 count(Home home,
const IntVarArgs&
x,
const IntVarArgs&
c,
1732 count(Home home,
const IntVarArgs&
x,
1733 const IntVarArgs&
c,
const IntArgs&
v,
1753 count(Home home,
const IntVarArgs&
x,
1774 count(Home home,
const IntVarArgs&
x,
1775 const IntSet&
c,
const IntArgs&
v,
1838 sequence(Home home,
const IntVarArgs&
x,
const IntSet& s,
1856 sequence(Home home,
const BoolVarArgs&
x,
const IntSet& s,
1895 Transition(
int i_state0,
int symbol0,
int o_state0);
1935 int val(
void)
const;
2090 int arity(
void)
const;
2096 int min(
void)
const;
2098 int max(
void)
const;
2157 min(Home home, IntVar x0, IntVar x1, IntVar x2,
2167 min(Home home,
const IntVarArgs&
x, IntVar y,
2175 max(Home home, IntVar x0, IntVar x1, IntVar x2,
2185 max(Home home,
const IntVarArgs&
x, IntVar y,
2219 abs(Home home, IntVar x0, IntVar x1,
2228 mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2236 divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2244 div(Home home, IntVar x0, IntVar x1, IntVar x2,
2252 mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2261 sqr(Home home, IntVar x0, IntVar x1,
2270 sqrt(Home home, IntVar x0, IntVar x1,
2282 pow(Home home, IntVar x0,
int n, IntVar x1,
2294 nroot(Home home, IntVar x0,
int n, IntVar x1,
2331 linear(Home home,
const IntVarArgs&
x,
2338 linear(Home home,
const IntVarArgs&
x,
2345 linear(Home home,
const IntVarArgs&
x,
2352 linear(Home home,
const IntVarArgs&
x,
2362 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2372 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2382 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2392 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2425 linear(Home home,
const BoolVarArgs&
x,
2432 linear(Home home,
const BoolVarArgs&
x,
2439 linear(Home home,
const BoolVarArgs&
x,
2446 linear(Home home,
const BoolVarArgs&
x,
2456 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2466 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2476 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2486 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2519 const IntVarArgs&
l,
2520 const IntVarArgs&
b,
const IntArgs& s,
2562 const IntVarArgs&
l,
const IntVarArgs&
b,
2563 const IntArgs& s,
const IntArgs&
c,
2587 const IntVarArgs&
x,
const IntArgs& w,
2588 const IntVarArgs& y,
const IntArgs& h,
2605 const IntVarArgs&
x,
const IntArgs& w,
2606 const IntVarArgs& y,
const IntArgs& h,
2607 const BoolVarArgs& o,
2627 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2628 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2649 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2650 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2651 const BoolVarArgs& o,
2705 const IntVarArgs& s,
const IntVarArgs&
p,
2706 const IntVarArgs& e,
const IntVarArgs&
u,
2707 const IntArgs&
c,
bool at_most,
2715 const IntVarArgs& s,
const IntVarArgs&
p,
2716 const IntVarArgs& e,
const IntVarArgs&
u,
2717 const IntArgs&
c,
bool at_most,
2725 const IntVarArgs& s,
const IntArgs&
p,
2726 const IntVarArgs& e,
const IntVarArgs&
u,
2727 const IntArgs&
c,
bool at_most,
2735 const IntVarArgs& s,
const IntArgs&
p,
2736 const IntVarArgs& e,
const IntVarArgs&
u,
2737 const IntArgs&
c,
bool at_most,
2745 const IntVarArgs& s,
const IntVarArgs&
p,
2746 const IntVarArgs& e,
const IntArgs&
u,
2747 const IntArgs&
c,
bool at_most,
2755 const IntVarArgs& s,
const IntVarArgs&
p,
2756 const IntVarArgs& e,
const IntArgs&
u,
2757 const IntArgs&
c,
bool at_most,
2765 const IntVarArgs& s,
const IntArgs&
p,
2766 const IntVarArgs& e,
const IntArgs&
u,
2767 const IntArgs&
c,
bool at_most,
2775 const IntVarArgs& s,
const IntArgs&
p,
2776 const IntVarArgs& e,
const IntArgs&
u,
2777 const IntArgs&
c,
bool at_most,
2799 unary(Home home,
const IntVarArgs& s,
const IntArgs&
p,
2823 unary(Home home,
const IntVarArgs& s,
const IntArgs&
p,
2890 const IntVarArgs& flex,
const IntArgs& fix,
2913 unary(Home home,
const IntVarArgs& s,
const IntVarArgs&
p,
2938 unary(Home home,
const IntVarArgs& s,
const IntVarArgs&
p,
2977 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
2987 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
3028 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
3036 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
3064 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs&
p,
3071 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs&
p,
3101 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs&
p,
3108 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs&
p,
3140 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs&
p,
3147 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs&
p,
3181 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs&
p,
3182 const IntVarArgs& e,
const IntArgs&
u,
const BoolVarArgs& m,
3189 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs&
p,
3190 const IntVarArgs& e,
const IntArgs&
u,
const BoolVarArgs& m,
3215 circuit(Home home,
const IntVarArgs&
x,
3233 circuit(Home home,
int offset,
const IntVarArgs&
x,
3259 const IntVarArgs&
x,
const IntVarArgs& y, IntVar z,
3285 const IntArgs&
c,
int offset,
3286 const IntVarArgs&
x,
const IntVarArgs& y, IntVar z,
3309 const IntVarArgs&
x, IntVar z,
3333 const IntArgs&
c,
int offset,
3334 const IntVarArgs&
x, IntVar z,
3352 path(Home home,
const IntVarArgs&
x, IntVar s, IntVar e,
3372 path(Home home,
int offset,
const IntVarArgs&
x, IntVar s, IntVar e,
3399 const IntVarArgs&
x, IntVar s, IntVar e,
const IntVarArgs& y, IntVar z,
3427 const IntArgs&
c,
int offset,
3428 const IntVarArgs&
x, IntVar s, IntVar e,
const IntVarArgs& y, IntVar z,
3453 const IntVarArgs&
x, IntVar s, IntVar e, IntVar z,
3479 const IntArgs&
c,
int offset,
3480 const IntVarArgs&
x, IntVar s, IntVar e, IntVar z,
3496 wait(Home home, IntVar
x,
void (*
c)(Space& home),
3500 wait(Home home, BoolVar x,
void (*
c)(Space& home),
3504 wait(Home home,
const IntVarArgs& x,
void (*
c)(Space& home),
3508 wait(Home home,
const BoolVarArgs& x,
void (*
c)(Space& home),
3512 when(Home home, BoolVar x,
3513 void (*
t)(Space& home),
void (*e)(Space& home)= NULL,
3543 unshare(Home home, IntVarArgs& x,
3547 unshare(Home home, BoolVarArgs& x,
4145 branch(Home home,
const IntVarArgs& x,
4146 IntVarBranch vars, IntValBranch vals,
4155 branch(Home home,
const IntVarArgs& x,
4156 TieBreak<IntVarBranch> vars, IntValBranch vals,
4165 branch(Home home, IntVar x, IntValBranch vals,
4173 branch(Home home,
const BoolVarArgs& x,
4174 IntVarBranch vars, IntValBranch vals,
4183 branch(Home home,
const BoolVarArgs& x,
4184 TieBreak<IntVarBranch> vars, IntValBranch vals,
4193 branch(Home home, BoolVar x, IntValBranch vals,
4202 assign(Home home,
const IntVarArgs& x, IntAssign vals,
4211 assign(Home home, IntVar x, IntAssign vals,
4219 assign(Home home,
const BoolVarArgs& x, IntAssign vals,
4228 assign(Home home, BoolVar x, IntAssign vals,
4238 template<
class Char,
class Traits>
4239 std::basic_ostream<Char,Traits>&
4240 operator <<(std::basic_ostream<Char,Traits>& os,
const DFA&
d);
4245 template<
class Char,
class Traits>
4246 std::basic_ostream<Char,Traits>&
4247 operator <<(std::basic_ostream<Char,Traits>& os,
const TupleSet& ts);
4254 namespace Int {
namespace LDSB {
4255 class SymmetryObject;
4268 void increment(
void);
4270 void decrement(
void);
4310 const IntArgs& indices);
4357 branch(Home home,
const IntVarArgs& x,
4358 IntVarBranch vars, IntValBranch vals,
4359 const Symmetries& syms,
4373 branch(Home home,
const IntVarArgs& x,
4374 TieBreak<IntVarBranch> vars, IntValBranch vals,
4375 const Symmetries& syms,
4389 branch(Home home,
const BoolVarArgs& x,
4390 IntVarBranch vars, IntValBranch vals,
4391 const Symmetries& syms,
4405 branch(Home home,
const BoolVarArgs& x,
4406 TieBreak<IntVarBranch> vars, IntValBranch vals,
4407 const Symmetries& syms,
Value iterator for integer variables.
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
static IntArgs create(int n, int start, int inc=1)
Allocate array with n elements such that for all .
IntVar(void)
Default constructor.
With smallest max-regret.
Transitions(const DFA &d)
Initialize to all transitions of DFA d.
int med(void) const
Return median of domain (greatest element not greater than the median)
IntValBranch INT_VAL_RANGE_MIN(void)
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
IntVarArgs(const VarArray< IntVar > &a)
Initialize from variable array a (copy elements)
void cumulative(Home home, Cap c, const TaskTypeArgs &t, const IntVarArgs &s, const IntArgs &p, const IntArgs &u, IntConLevel icl)
IntValBranch(Select s=SEL_MIN)
Initialize with selection strategy s.
Variables as interfaces to variable implementations.
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
bool(* BoolBranchFilter)(const Space &home, BoolVar x, int i)
Branch filter function type for Boolean variables.
IntVarArray(void)
Default constructor (array of size 0)
IntAFC(void)
Construct as not yet initialized.
IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Select s
Which variable to select.
IntConLevel
Consistency levels for integer propagators.
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Select all values starting from smallest.
int min(void) const
Minimum domain element.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatNum c)
Post propagator for .
void finalize(void)
Finalize tuple set.
TaskType
Type of task for scheduling constraints.
int med(void) const
Return median of domain (greatest element not greater than the median)
Inverse implication for reification.
ReifyMode mode(void) const
Return reification mode.
BoolVarArray(void)
Default constructor (array of size 0)
With smallest degree divided by domain size.
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntConLevel icl)
Post propagator for .
int max(void) const
Return maximum of domain.
Range iterator for integer sets.
BoolVarArgs(const VarArray< BoolVar > &a)
Initialize from variable array a (copy elements)
Iterator for DFA symbols.
int final_fst(void) const
Return the number of the first final state.
IntSetValues(void)
Default constructor.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
BoolVar var(void) const
Return Boolean control variable.
int o_state(void) const
Return out-state of current transition.
Reify(void)
Default constructor without proper initialization.
bool in(int n) const
Return whether n is included in the set.
Select values greater than mean of smallest and largest value.
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
int final_lst(void) const
Return the number of the last final state.
void operator++(void)
Move iterator to next range (if possible)
Argument array for primtive types.
int min(void) const
Return minimum of entire set.
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
BoolOpType
Operation types for Booleans.
bool zero(void) const
Test whether domain is zero.
Which values to select for branching first.
int arity(void) const
Arity of tuple set.
BoolVarArgs(const BoolVarArgs &a)
Initialize from variable argument array a (copy elements)
Symbols(const DFA &d)
Initialize to symbols of DFA d.
int(* BoolBranchVal)(const Space &home, BoolVar x, int i)
Branch value function type for Boolean variables.
Which variable to select for branching.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int excess
Excess storage.
Value propagation or consistency (naive)
IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl)
Select variable with largest max-regret.
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Select all values starting from largest.
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
void init(const IntSet &s)
Initialize with values for s.
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.
unsigned int size(void) const
Return size (cardinality) of domain.
With smallest min-regret.
Select select(void) const
Return selection strategy.
bool operator()(void) const
Test whether iterator still at a symbol.
IntAssign(Select s=SEL_MIN)
Initialize with selection strategy s.
void operator++(void)
Move iterator to next transition.
int * Tuple
Type of a tuple.
BoolVarArgs(const std::vector< BoolVar > &a)
Initialize from vector a.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Collection of symmetries.
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl)
Select variable with smallest max-regret.
Implementation of a symmetry at the modelling level.
Select value according to user-defined functions.
IntValBranch INT_VAL_RANGE_MAX(void)
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
void nonnegative(int n, const char *l)
Check whether n is in range and nonnegative, otherwise throw out of limits with information l...
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value)
IntVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
bool operator()(void) const
Test whether iterator is still at a range or done.
Select values not greater than mean of smallest and largest value.
Select select(void) const
Return selection strategy.
bool range(void) const
Test whether domain is a range.
void(* BoolVarValPrint)(const Space &home, const BrancherHandle &bh, unsigned int a, BoolVar x, int i, const int &n, std::ostream &o)
Function type for printing branching alternatives for Boolean variables.
IntVarArgs(const std::vector< IntVar > &a)
Initialize from vector a.
void path(Home home, int offset, const IntVarArgs &x, IntVar s, IntVar e, IntConLevel icl)
Post propagator such that x forms a Hamiltonian path.
IntVarBranch INT_VAR_ACTIVITY_MAX(double d, BranchTbl tbl)
Select variable with highest activity with decay factor d.
Select s
Which value to select.
bool(* IntBranchFilter)(const Space &home, IntVar x, int i)
Branch filter function type for integer variables.
ArgArray< IntSet > IntSetArgs
Passing set arguments.
const int max
Largest allowed integer value.
unsigned int width(void) const
Return width of set (distance between maximum and minimum)
int tuples(void) const
Number of tuples.
Select select(void) const
Return selection strategy.
Select s
Which value to select.
void init(const IntSet &s)
Initialize with ranges for set s.
const int min
Smallest allowed integer value.
double(* IntBranchMerit)(const Space &home, IntVar x, int i)
Branch merit function type for integer variables.
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl)
Select variable with largest min-regret.
IntVarArgs(int n)
Allocate array with n elements.
void argmin(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntConLevel)
Post propagator for .
IntVarBranch(void)
Initialize with strategy SEL_NONE.
int(* IntBranchVal)(const Space &home, IntVar x, int i)
Branch value function type for integer variables.
int val(void) const
Return assigned value.
Range iterator for integer variables
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
bool overflow_mul(int n, int m)
Check whether multiplying n and m would overflow.
With largest accumulated failure count.
Select
Which value selection.
Reify imp(BoolVar x)
Use implication for reification.
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntConLevel)
Post propagator for .
void argmax(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntConLevel)
Post propagator for .
Gecode::FloatVal c(-8, 8)
void when(Home home, BoolVar x, void(*t)(Space &home), void(*e)(Space &home), IntConLevel)
Execute t (then) when x is assigned one, and e (else) otherwise.
Select value nearest to a given value, use smaller one in case of ties.
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Deterministic finite automaton (DFA)
int p
Number of positive literals for node type.
Select greatest value not greater than the median.
IntVarBranch INT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Class for AFC (accumulated failure count) management.
unsigned int n_symbols(void) const
Return the number of symbols.
int n
Number of negative literals for node type.
BoolVar(void)
Default constructor.
Select
Which variable selection.
IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Argument array for non-primitive types.
IntVarArgs(void)
Allocate empty array.
const long long int llmin
Smallest allowed long long integer value.
IntArgs(void)
Allocate empty array.
IntVarBranch INT_VAR_ACTIVITY_MIN(double d, BranchTbl tbl)
Select variable with lowest activity with decay factor d.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value)
Tuple ** last
Initial last structure.
Prefer speed over memory consumption.
A reference-counted pointer to a SymmetryObject.
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
IntRelType
Relation types for integers.
IntVarValues(void)
Default constructor.
int ranges(void) const
Return number of ranges of the specification.
SymmetryHandle ValueSequenceSymmetry(const IntArgs &vs, int ss)
Value sequences in v of size ss are interchangeable.
int i_state(void) const
Return in-state of current transition.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
With smallest accumulated failure count.
void(* IntBranchCommit)(Space &home, unsigned int a, IntVar x, int i, int n)
Branch commit function type for integer variables.
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
unsigned int size(void) const
Return size (cardinality) of domain.
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, int n, IntConLevel)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
void(* BoolBranchCommit)(Space &home, unsigned int a, BoolVar x, int i, int n)
Branch commit function type for Boolean variables.
bool one(void) const
Test whether domain is one.
Recording AFC information for integer and Boolean variables.
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Specification of a DFA transition.
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
With largest domain size.
Value iterator from range iterator.
unsigned int max_degree(void) const
Return maximal degree (in-degree and out-degree) of any state.
Reification specification.
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.
IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
void unshare(Home home, IntVarArgs &x, IntConLevel icl)
Replace multiple variable occurences in x by fresh variables.
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)
IntVarBranch INT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
IntVarBranch INT_VAR_ACTIVITY_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest activity divided by domain size with decay factor d. ...
IntSharedArray values(void) const
Return shared array of values.
int min(void) const
Return smallest value of range.
Tuple ** tuples
Tuples index.
bool overflow_add(int n, int m)
Check whether adding n and m would overflow.
IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Tuple operator[](int i) const
Get tuple i.
void precede(Home home, const IntVarArgs &x, int s, int t, IntConLevel)
Post propagator that s precedes t in x.
void init(const IntVar &x)
Initialize with ranges for integer variable x.
int min
Minimum and maximum in domain-values.
Integer set initialization.
int max(void) const
Return maximum of domain.
bool in(int n) const
Test whether n is contained in domain.
void(* VoidFunction)(void)
Base type for any function pointer.
int o_state
output state Default constructor
Select
Which value selection.
Tuple * nullpointer
Pointer to NULL-pointer.
With smallest domain size.
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, IntConLevel cl)
Post propagators for the cumulatives constraint.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntConLevel)
Post domain consistent propagator for .
Select value near to a given value, decrement values first.
IntActivity(void)
Construct as not yet initialized.
ExtensionalPropKind
Extensional propagation kind.
Reify eqv(BoolVar x)
Use equivalence for reification.
int n
Number of variables (size)
IntVarArgs(const IntVarArgs &a)
Initialize from variable argument array a (copy elements)
IntValBranch INT_VAL_NEAR_MIN(IntSharedArray n)
Try value nearest to a given value for a variable, in case of ties use the smaller value...
bool operator()(void) const
Test whether iterator still at a transition.
Recording activities for integer and Boolean variables.
Passing integer variables.
unsigned int size(void) const
Return size (cardinality) of set.
With largest degree divided by domain size.
SharedArray< int > IntSharedArray
Arrays of integers that can be shared among several element constraints.
void divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3, IntConLevel)
Post propagator for .
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, const IntVarArgs &z, IntConLevel)
Post propagator that y is x sorted in increasing order.
void ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z, IntConLevel icl)
Post propagator for if-then-else constraint.
Passing integer arguments.
BoolVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Passing Boolean variables.
static const IntSet empty
Empty set.
double(* BoolBranchMerit)(const Space &home, BoolVar x, int i)
Branch merit function type for Boolean variables.
Tuple * tuple_data
Tuple index data.
int max(void) const
Maximum domain element.
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...
IntSet(void)
Initialize as empty set.
Select value nearest to a given value, use larger one in case of ties.
Boolean integer variables.
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
union Gecode::@518::NNF::@57 u
Union depending on nodetype t.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Class represeting a set of tuples.
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
TupleSet(void)
Construct empty tuple set.
void extensional(Home home, const IntVarArgs &x, DFA dfa, IntConLevel)
Post domain consistent propagator for extensional constraint described by a DFA.
IntValBranch INT_VAL_MAX(void)
Select largest value.
Integer view for integer variables.
const int infinity
Infinity for integers.
bool finalized(void) const
Is tuple set finalized.
void init(const IntVar &x)
Initialize with values x.
BoolVarArgs(int n)
Allocate array with n elements.
Value branching information.
int n_transitions(void) const
Return the number of transitions.
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value)
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Random (uniform, for tie breaking)
Variable branching information.
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c.
BrancherHandle assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
bool overflow_sub(int n, int m)
Check whether subtracting m from n would overflow.
void expand(Home home, const IntVarArgs &x)
Expand decay factor into AFC or activity.
Node * x
Pointer to corresponding Boolean expression node.
int max(void) const
Return largest value of range.
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntConLevel)
Post propagator for .
IntActivity & operator=(const IntActivity &a)
Assignment operator.
DFA(void)
Initialize for DFA accepting the empty word.
With largest activity divided by domain size.
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
IntSharedArray n
Array of values for near strategies.
IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Select value according to user-defined functions.
int symbol(void) const
Return symbol of current transition.
void(* IntVarValPrint)(const Space &home, const BrancherHandle &bh, unsigned int a, IntVar x, int i, const int &n, std::ostream &o)
Function type for printing branching alternatives for integer variables.
Which values to select for assignment.
int val(void) const
Return current symbol.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
SymmetryHandle values_reflect(int lower, int upper)
The values from lower to upper (inclusive) can be reflected.
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...
The default consistency for a constraint.
IntValBranch INT_VAL_NEAR_MAX(IntSharedArray n)
Try value nearest to a given value for a variable, in case of ties use the larger value...
bool valid(int n)
Return whether n is in range.
Value iterator for integer sets.
int val(void) const
Return assigned value.
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
IntVarBranch INT_VAR_ACTIVITY_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest activity divided by domain size with decay factor d.
Iterator for DFA transitions (sorted by symbols)
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
PrimArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
int n_states(void) const
Return the number of states.
void distinct(Home home, const IntVarArgs &x, IntConLevel icl)
Post propagator for for all .
void operator++(void)
Move iterator to next symbol.
BoolVarArgs(void)
Allocate empty array.
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
IntVarRanges(void)
Default constructor.
IntAFC & operator=(const IntAFC &a)
Assignment operator.
const long long int llmax
Largest allowed long long integer value.
Select value near to a given value, increment values first.
IntValBranch INT_VAL_NEAR_INC(IntSharedArray n)
Try value larger than a given value for a variable first.
Traits of arrays in Gecode.
void binpacking(Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntConLevel)
Post propagator for bin packing.
Bounds propagation or consistency.
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
int size
Number of Tuples.
Prefer little memory over speed.
void nooverlap(Home home, const IntVarArgs &x, const IntArgs &w, const IntVarArgs &y, const IntArgs &h, IntConLevel)
Post propagator for rectangle packing.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
Argument array for variables.
bool none(void) const
Test whether domain is neither zero nor one.
IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
void wait(Home home, FloatVar x, void(*c)(Space &home))
Execute c when x becomes assigned.
int min(void) const
Return minimum of domain.
Implication for reification.
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...
#define GECODE_VTABLE_EXPORT
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
BoolVar x
The Boolean control variable.
int min(void) const
Return minimum of domain.
bool in(int n) const
Test whether n is contained in domain.
BrancherHandle 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.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
With largest accumulated failure count divided by domain size.
Class for activity management.
#define GECODE_INT_EXPORT
int symbol_min(void) const
Return smallest symbol in DFA.
const long long int llinfinity
Infinity for long long integers.
int max(void) const
Return maximum of entire set.
void add(const IntArgs &tuple)
Add tuple to tuple set.
IntSetRanges(void)
Default constructor.
int symbol_max(void) const
Return largest symbol in DFA.
void circuit(Home home, int offset, const IntVarArgs &x, IntConLevel icl)
Post propagator such that x forms a circuit.
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
With smallest activity divided by domain size.
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
bool range(void) const
Test whether domain is a range.
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value)
ReifyMode
Mode for reification.
void init(Home, const IntVarArgs &x, double d=1.0)
Initialize for integer variables x with decay factor d.
With smallest accumulated failure count divided by domain size.
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntConLevel)
Post propagator for .
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...
Select greatest value not greater than the median.
void member(Home home, const IntVarArgs &x, IntVar y, IntConLevel)
Post domain consistent propagator for .
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
IntValBranch INT_VAL_NEAR_DEC(IntSharedArray n)
Try value smaller than a given value for a variable first.
Domain propagation or consistency.
TupleSetI * implementation(void)
Get implementation.
void init(Home home, const IntVarArgs &x, double d=1.0, IntBranchMerit bm=NULL)
Initialize for integer variables x with decay factor d.
IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntConLevel icl)
Post propagators for scheduling tasks on unary resources.
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl)
Select variable with smallest min-regret.
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Equivalence for reification (default)
Reify pmi(BoolVar x)
Use reverse implication for reification.
Boolean view for Boolean variables.
Rnd r
Random number generator.
double(* BranchTbl)(const Space &home, double w, double b)
Tie-break limit function.