46 #ifndef __GECODE_INT_HH__ 47 #define __GECODE_INT_HH__ 62 #if !defined(GECODE_STATIC_LIBS) && \ 63 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER)) 65 #ifdef GECODE_BUILD_INT 66 #define GECODE_INT_EXPORT __declspec( dllexport ) 68 #define GECODE_INT_EXPORT __declspec( dllimport ) 73 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY 74 #define GECODE_INT_EXPORT __attribute__ ((visibility("default"))) 76 #define GECODE_INT_EXPORT 82 #ifndef GECODE_BUILD_INT 83 #define GECODE_LIBRARY_NAME "Int" 100 namespace Gecode {
namespace Int {
111 const int max = INT_MAX - 1;
117 const long long int llmax = LLONG_MAX - 1;
125 bool valid(
long long int n);
127 void check(
int n,
const char*
l);
129 void check(
long long int n,
const char*
l);
133 void positive(
long long int n,
const char*
l);
160 template<
class I>
class IntSetInit;
236 int min(
int i)
const;
238 int max(
int i)
const;
240 unsigned int width(
int i)
const;
245 bool in(
int n)
const;
248 unsigned int size(
void)
const;
250 unsigned int width(
void)
const;
272 const IntSet::Range* i;
274 const IntSet::Range* e;
301 unsigned int width(
void)
const;
327 template<
class Char,
class Traits>
328 std::basic_ostream<Char,Traits>&
420 unsigned int size(
void)
const;
422 unsigned int width(
void)
const;
431 bool range(
void)
const;
434 bool in(
int n)
const;
442 template<
class Char,
class Traits>
443 std::basic_ostream<Char,Traits>&
542 unsigned int size(
void)
const;
544 unsigned int width(
void)
const;
553 bool range(
void)
const;
556 bool in(
int n)
const;
561 bool zero(
void)
const;
564 bool one(
void)
const;
566 bool none(
void)
const;
574 template<
class Char,
class Traits>
575 std::basic_ostream<Char,Traits>&
618 template<
class InputIterator>
619 IntArgs(InputIterator first, InputIterator last);
649 template<
class InputIterator>
704 template<
class InputIterator>
1553 channel(Home home,
const BoolVarArgs&
x, IntVar y,
int o=0,
1575 sorted(Home home,
const IntVarArgs&
x,
const IntVarArgs& y,
1590 sorted(Home home,
const IntVarArgs&
x,
const IntVarArgs& y,
1591 const IntVarArgs& z,
1622 count(Home home,
const IntVarArgs&
x,
const IntSet& y,
IntRelType irt,
int m,
1642 count(Home home,
const IntVarArgs&
x,
const IntArgs& y,
IntRelType irt,
int m,
1656 count(Home home,
const IntVarArgs&
x,
const IntSet& y,
IntRelType irt, IntVar z,
1676 count(Home home,
const IntVarArgs&
x,
const IntArgs& y,
IntRelType irt, IntVar z,
1693 count(Home home,
const IntVarArgs&
x,
const IntVarArgs&
c,
1730 count(Home home,
const IntVarArgs&
x,
1731 const IntVarArgs&
c,
const IntArgs&
v,
1751 count(Home home,
const IntVarArgs&
x,
1772 count(Home home,
const IntVarArgs&
x,
1773 const IntSet&
c,
const IntArgs&
v,
1836 sequence(Home home,
const IntVarArgs&
x,
const IntSet& s,
1854 sequence(Home home,
const BoolVarArgs&
x,
const IntSet& s,
1893 Transition(
int i_state0,
int symbol0,
int o_state0);
1933 int val(
void)
const;
2088 int arity(
void)
const;
2094 int min(
void)
const;
2096 int max(
void)
const;
2155 min(Home home, IntVar x0, IntVar x1, IntVar x2,
2165 min(Home home,
const IntVarArgs&
x, IntVar y,
2173 max(Home home, IntVar x0, IntVar x1, IntVar x2,
2183 max(Home home,
const IntVarArgs&
x, IntVar y,
2192 abs(Home home, IntVar x0, IntVar x1,
2201 mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2209 divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2217 div(Home home, IntVar x0, IntVar x1, IntVar x2,
2225 mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2234 sqr(Home home, IntVar x0, IntVar x1,
2243 sqrt(Home home, IntVar x0, IntVar x1,
2255 pow(Home home, IntVar x0,
int n, IntVar x1,
2267 nroot(Home home, IntVar x0,
int n, IntVar x1,
2304 linear(Home home,
const IntVarArgs&
x,
2311 linear(Home home,
const IntVarArgs&
x,
2318 linear(Home home,
const IntVarArgs&
x,
2325 linear(Home home,
const IntVarArgs&
x,
2335 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2345 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2355 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2365 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2398 linear(Home home,
const BoolVarArgs&
x,
2405 linear(Home home,
const BoolVarArgs&
x,
2412 linear(Home home,
const BoolVarArgs&
x,
2419 linear(Home home,
const BoolVarArgs&
x,
2429 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2439 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2449 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2459 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2492 const IntVarArgs&
l,
2493 const IntVarArgs&
b,
const IntArgs& s,
2515 const IntVarArgs&
x,
const IntArgs& w,
2516 const IntVarArgs& y,
const IntArgs& h,
2533 const IntVarArgs&
x,
const IntArgs& w,
2534 const IntVarArgs& y,
const IntArgs& h,
2535 const BoolVarArgs& o,
2555 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2556 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2577 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2578 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2579 const BoolVarArgs& o,
2633 const IntVarArgs& s,
const IntVarArgs&
p,
2634 const IntVarArgs& e,
const IntVarArgs&
u,
2635 const IntArgs&
c,
bool at_most,
2643 const IntVarArgs& s,
const IntVarArgs&
p,
2644 const IntVarArgs& e,
const IntVarArgs&
u,
2645 const IntArgs&
c,
bool at_most,
2653 const IntVarArgs& s,
const IntArgs&
p,
2654 const IntVarArgs& e,
const IntVarArgs&
u,
2655 const IntArgs&
c,
bool at_most,
2663 const IntVarArgs& s,
const IntArgs&
p,
2664 const IntVarArgs& e,
const IntVarArgs&
u,
2665 const IntArgs&
c,
bool at_most,
2673 const IntVarArgs& s,
const IntVarArgs&
p,
2674 const IntVarArgs& e,
const IntArgs&
u,
2675 const IntArgs&
c,
bool at_most,
2683 const IntVarArgs& s,
const IntVarArgs&
p,
2684 const IntVarArgs& e,
const IntArgs&
u,
2685 const IntArgs&
c,
bool at_most,
2693 const IntVarArgs& s,
const IntArgs&
p,
2694 const IntVarArgs& e,
const IntArgs&
u,
2695 const IntArgs&
c,
bool at_most,
2703 const IntVarArgs& s,
const IntArgs&
p,
2704 const IntVarArgs& e,
const IntArgs&
u,
2705 const IntArgs&
c,
bool at_most,
2727 unary(Home home,
const IntVarArgs& s,
const IntArgs&
p,
2751 unary(Home home,
const IntVarArgs& s,
const IntArgs&
p,
2818 const IntVarArgs& flex,
const IntArgs& fix,
2841 unary(Home home,
const IntVarArgs& s,
const IntVarArgs&
p,
2866 unary(Home home,
const IntVarArgs& s,
const IntVarArgs&
p,
2905 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
2915 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
2956 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
2964 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
2992 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs&
p,
2999 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs&
p,
3029 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs&
p,
3036 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs&
p,
3068 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs&
p,
3075 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs&
p,
3109 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs&
p,
3110 const IntVarArgs& e,
const IntArgs&
u,
const BoolVarArgs& m,
3117 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs&
p,
3118 const IntVarArgs& e,
const IntArgs&
u,
const BoolVarArgs& m,
3143 circuit(Home home,
const IntVarArgs&
x,
3161 circuit(Home home,
int offset,
const IntVarArgs&
x,
3187 const IntVarArgs&
x,
const IntVarArgs& y, IntVar z,
3213 const IntArgs&
c,
int offset,
3214 const IntVarArgs&
x,
const IntVarArgs& y, IntVar z,
3237 const IntVarArgs&
x, IntVar z,
3261 const IntArgs&
c,
int offset,
3262 const IntVarArgs&
x, IntVar z,
3280 path(Home home,
const IntVarArgs&
x, IntVar s, IntVar e,
3300 path(Home home,
int offset,
const IntVarArgs&
x, IntVar s, IntVar e,
3327 const IntVarArgs&
x, IntVar s, IntVar e,
const IntVarArgs& y, IntVar z,
3355 const IntArgs&
c,
int offset,
3356 const IntVarArgs&
x, IntVar s, IntVar e,
const IntVarArgs& y, IntVar z,
3381 const IntVarArgs&
x, IntVar s, IntVar e, IntVar z,
3407 const IntArgs&
c,
int offset,
3408 const IntVarArgs&
x, IntVar s, IntVar e, IntVar z,
3424 wait(Home home, IntVar
x,
void (*
c)(Space& home),
3428 wait(Home home, BoolVar
x,
void (*
c)(Space& home),
3432 wait(Home home,
const IntVarArgs&
x,
void (*
c)(Space& home),
3436 wait(Home home,
const BoolVarArgs&
x,
void (*
c)(Space& home),
3440 when(Home home, BoolVar
x,
3441 void (*
t)(Space& home),
void (*e)(Space& home)= NULL,
4073 branch(Home home,
const IntVarArgs&
x,
4074 IntVarBranch vars, IntValBranch vals,
4083 branch(Home home,
const IntVarArgs&
x,
4084 TieBreak<IntVarBranch> vars, IntValBranch vals,
4093 branch(Home home, IntVar
x, IntValBranch vals,
4101 branch(Home home,
const BoolVarArgs&
x,
4102 IntVarBranch vars, IntValBranch vals,
4111 branch(Home home,
const BoolVarArgs&
x,
4112 TieBreak<IntVarBranch> vars, IntValBranch vals,
4121 branch(Home home, BoolVar
x, IntValBranch vals,
4130 assign(Home home,
const IntVarArgs&
x, IntAssign vals,
4139 assign(Home home, IntVar
x, IntAssign vals,
4147 assign(Home home,
const BoolVarArgs&
x, IntAssign vals,
4156 assign(Home home, BoolVar
x, IntAssign vals,
4166 template<
class Char,
class Traits>
4167 std::basic_ostream<Char,Traits>&
4168 operator <<(std::basic_ostream<Char,Traits>& os,
const DFA&
d);
4173 template<
class Char,
class Traits>
4174 std::basic_ostream<Char,Traits>&
4175 operator <<(std::basic_ostream<Char,Traits>& os,
const TupleSet& ts);
4182 namespace Int {
namespace LDSB {
4183 class SymmetryObject;
4196 void increment(
void);
4198 void decrement(
void);
4238 const IntArgs& indices);
4285 branch(Home home,
const IntVarArgs&
x,
4286 IntVarBranch vars, IntValBranch vals,
4287 const Symmetries& syms,
4301 branch(Home home,
const IntVarArgs&
x,
4302 TieBreak<IntVarBranch> vars, IntValBranch vals,
4303 const Symmetries& syms,
4317 branch(Home home,
const BoolVarArgs&
x,
4318 IntVarBranch vars, IntValBranch vals,
4319 const Symmetries& syms,
4333 branch(Home home,
const BoolVarArgs&
x,
4334 TieBreak<IntVarBranch> vars, IntValBranch vals,
4335 const Symmetries& syms,
Value iterator for integer variables.
With smallest accumulated failure count.
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
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.
IntVar(void)
Default constructor.
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.
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 .
int final_fst(void) const
Return the number of the first final state.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatNum c)
Post propagator for .
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.
BoolVarArray(void)
Default constructor (array of size 0)
With smallest activity divided by domain size.
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntConLevel icl)
Post propagator for .
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value)
Range iterator for integer sets.
BoolVarArgs(const VarArray< BoolVar > &a)
Initialize from variable array a (copy elements)
Iterator for DFA symbols.
IntSetValues(void)
Default constructor.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
ReifyMode mode(void) const
Return reification mode.
Reify(void)
Default constructor without proper initialization.
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
void operator++(void)
Move iterator to next range (if possible)
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.
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)
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.
With largest accumulated failure count.
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\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.
Select value nearest to a given value, use smaller one in case of ties.
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.
With largest accumulated failure count divided by domain size.
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.
struct Gecode::@511::NNF::@54::@55 b
For binary nodes (and, or, eqv)
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.
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.
IntVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
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.
With largest activity divided by domain size.
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)
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 finalized(void) const
Is tuple set finalized.
Select value near to a given value, decrement values first.
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.
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.
bool one(void) const
Test whether domain is one.
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.
IntVarBranch(void)
Initialize with strategy SEL_NONE.
int(* IntBranchVal)(const Space &home, IntVar x, int i)
Branch value function type for integer variables.
Range iterator for integer variables
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Select value nearest to a given value, use larger one in case of ties.
bool overflow_mul(int n, int m)
Check whether multiplying n and m would overflow.
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 .
unsigned int size(void) const
Return size (cardinality) of domain.
int tuples(void) const
Number of tuples.
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.
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Deterministic finite automaton (DFA)
int p
Number of positive literals for node type.
With smallest max-regret.
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.
int n
Number of negative literals for node type.
BoolVar(void)
Default constructor.
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.
Select all values starting from largest.
IntVarBranch INT_VAR_ACTIVITY_MIN(double d, BranchTbl tbl)
Select variable with lowest activity with decay factor d.
Tuple ** last
Initial last structure.
Prefer speed over memory consumption.
With smallest min-regret.
A reference-counted pointer to a SymmetryObject.
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value)
IntRelType
Relation types for integers.
IntVarValues(void)
Default constructor.
SymmetryHandle ValueSequenceSymmetry(const IntArgs &vs, int ss)
Value sequences in v of size ss are interchangeable.
Select greatest value not greater than the median.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
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.
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.
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 and Boolean variables.
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 .
int symbol_max(void) const
Return largest symbol in DFA.
Value iterator from range iterator.
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.
With largest domain size.
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.
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.
void(* VoidFunction)(void)
Base type for any function pointer.
int o_state
output state Default constructor
Tuple * nullpointer
Pointer to NULL-pointer.
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 .
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)
With largest degree divided by domain 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.
Recording activities for integer and Boolean variables.
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)
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.
Select values greater than mean of smallest and largest value.
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.
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.
struct Gecode::@511::NNF::@54::@56 a
For atomic nodes.
IntSet(void)
Initialize as empty set.
Boolean integer variables.
Tuple operator [](int i) const
Get tuple i.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Class represeting a set of tuples.
int max(void) const
Return maximum of domain.
With smallest degree divided by domain size.
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.
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.
void init(const IntVar &x)
Initialize with values x.
BoolVarArgs(int n)
Allocate array with n elements.
Value branching information.
int min(void) const
Minimum domain element.
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
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.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
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.
Select values not greater than mean of smallest and largest value.
Node * x
Pointer to corresponding Boolean expression node.
union Gecode::@511::NNF::@54 u
Union depending on nodetype t.
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntConLevel)
Post propagator for .
IntActivity & operator=(const IntActivity &a)
Assignment operator.
int min(void) const
Return minimum of entire set.
DFA(void)
Initialize for DFA accepting the empty word.
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.
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.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
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.
bool zero(void) const
Test whether domain is zero.
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.
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.
IntVarBranch INT_VAR_ACTIVITY_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest activity divided by domain size with decay factor d.
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.
PrimArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
Random (uniform, for tie breaking)
void distinct(Home home, const IntVarArgs &x, IntConLevel icl)
Post propagator for for all .
With smallest domain size.
Archive & operator<<(Archive &e, FloatNumBranch nl)
void operator++(void)
Move iterator to next symbol.
Select
Which value selection.
bool operator()(void) const
Test whether iterator still at a symbol.
int ranges(void) const
Return number of ranges of the specification.
BoolVarArgs(void)
Allocate empty array.
Select greatest value not greater than the median.
int n_states(void) const
Return the number of states.
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.
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.
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.
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.
Gecode toplevel namespace
Argument array for variables.
int med(void) const
Return median of domain (greatest element not greater than the median)
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 symbol_min(void) const
Return smallest symbol in DFA.
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
BoolVar x
The Boolean control variable.
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.
bool in(int n) const
Return whether n is included in the set.
int final_lst(void) const
Return the number of the last final state.
Class for activity management.
#define GECODE_INT_EXPORT
const long long int llinfinity
Infinity for long long integers.
void add(const IntArgs &tuple)
Add tuple to tuple set.
IntSetRanges(void)
Default constructor.
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
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.
ReifyMode
Mode for reification.
void init(Home, const IntVarArgs &x, double d=1.0)
Initialize for integer variables x with decay factor d.
Select value according to user-defined functions.
bool none(void) const
Test whether domain is neither zero nor one.
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.
int symbol(void) const
Return symbol of current transition.
bool in(int n) const
Test whether n is contained in domain.
void member(Home home, const IntVarArgs &x, IntVar y, IntConLevel)
Post domain consistent propagator for .
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.
int max(void) const
Return maximum of domain.
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.
Select value near to a given value, increment values first.
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl)
Select variable with smallest min-regret.
int o_state(void) const
Return out-state of current transition.
Select all values starting from smallest.
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
With smallest accumulated failure count divided by domain size.
Equivalence for reification (default)
IntSharedArray values(void) const
Return shared array of values.
int val(void) const
Return assigned value.
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.