77 long long int m,
long long int&
d)
const;
87 static void*
operator new(
size_t size);
89 static void operator delete(
void*
p,
size_t size);
119 LinIntExpr::Node::operator
new(
size_t size) {
124 LinIntExpr::Node::operator
delete(
void*
p, size_t) {
130 if ((
l != NULL) &&
l->decrement())
132 if ((
r != NULL) &&
r->decrement())
156 return static_cast<int>(
d);
161 if (home.
failed())
return;
189 int c = n->
fill(home,icl,its,NULL);
192 }
else if (n->
n_int == 0) {
196 int c = n->
fill(home,icl,NULL,bts);
198 }
else if (n->
n_bool == 1) {
204 int c = n->
fill(home,icl,its,bts);
216 int c = n->
fill(home,icl,its,bts);
229 if (home.
failed())
return;
247 int c = n->
fill(home,icl,its,NULL);
250 }
else if (n->
n_int == 0) {
254 int c = n->
fill(home,icl,NULL,bts);
256 }
else if (n->
n_bool == 1) {
262 int c = n->
fill(home,icl,its,bts);
274 int c = n->
fill(home,icl,its,bts);
292 int c = n->
fill(home,icl,its,NULL);
293 if ((n->
n_int == 1) && (
c == 0) && (its[0].
a == 1))
301 }
else if (n->
n_int == 0) {
305 int c = n->
fill(home,icl,NULL,bts);
311 }
else if (n->
n_bool == 1) {
317 int c = n->
fill(home,icl,its,bts);
323 IntVar y(home, y_min, y_max);
333 int c = n->
fill(home,icl,its,bts);
341 IntVar y(home, y_min, y_max);
399 for (
int i=
x.size();
i--; ) {
408 if (
a.size() !=
x.size())
416 for (
int i=
x.size();
i--; ) {
431 for (
int i=
x.size();
i--; ) {
440 if (
a.size() !=
x.size())
448 for (
int i=
x.size();
i--; ) {
460 n->
l = e0.n; n->
l->
use++;
461 n->
r = e1.n; n->
r->
use++;
470 n->
r = e.n; n->
r->
use++;
479 n->
l = e.n; n->
l->
use++;
514 long long int m,
long long int&
d)
const {
525 ti->a=static_cast<int>(m);
ti->x=
sum.ne->post(home, NULL, icl);
ti++;
818 else if (
x.assigned() &&
828 else if (
x.assigned() &&
838 else if (
x.assigned() &&
848 else if (
x.assigned() &&
912 return e.
post(home,icl);
IntVar x_int
Integer variable (potentially)
FloatVal operator -(const FloatVal &x)
IntConLevel
Consistency levels for integer propagators.
NodeType t
Type of expression.
int size(void) const
Return size of array (number of elements)
FloatVal operator *(const FloatVal &x, const FloatVal &y)
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
void rfree(void *p)
Free memory block starting at p.
void post(Home home, Term< BoolView > *t, int n, IntRelType irt, IntView x, int c, IntConLevel)
Post propagator for linear constraint over Booleans.
unsigned int use
Nodes are reference counted.
Linear term with Boolean variable.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void fill(Home home, IntConLevel icl, Int::Linear::Term< Int::IntView > *&ti, Int::Linear::Term< Int::BoolView > *&tb, long long int m, long long int &d) const
Generate linear terms from expression.
bool assigned(void) const
Test whether view is assigned.
Int::Linear::Term< Int::BoolView > * tb
Bool views and coefficients.
struct Gecode::@511::NNF::@54::@55 b
For binary nodes (and, or, eqv)
Base class for non-linear expressions over integer variables.
union Gecode::LinIntExpr::Node::@58 sum
Sum of integer or Boolean variables, or non-linear expression.
void * ralloc(size_t s)
Allocate s bytes from heap.
Addition of linear terms.
Multiplication by coefficient.
Linear term with integer variable.
const int max
Largest allowed integer value.
const int min
Smallest allowed integer value.
Heap heap
The single global heap.
const LinIntExpr & operator=(const LinIntExpr &e)
Assignment operator.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from heap.
Int::Linear::Term< Int::IntView > * ti
Integer views and coefficients.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
int n_int
Integer variables in tree.
Nodes for linear expressions.
IntRelType
Relation types for integers.
FloatVal operator+(const FloatVal &x)
BoolVar x_bool
Boolean variable (potentially)
bool decrement(void)
Decrement reference count and possibly free memory.
int val(void) const
Return assigned value.
bool failed(void) const
Check whether corresponding space is failed.
unsigned int size(I &i)
Size of all ranges of range iterator i.
int a
Coefficient and offset.
LinIntExpr(void)
Default constructor.
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
NodeType
Type of linear expression.
Passing integer variables.
Passing integer arguments.
Passing Boolean variables.
Node(void)
Default constructor.
struct Gecode::@511::NNF::@54::@56 a
For atomic nodes.
Boolean integer variables.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
BoolVar expr(Home home, const BoolExpr &e, IntConLevel icl)
Post Boolean expression and return its value.
void free(T *b, long unsigned int n)
Delete n objects starting at b.
~LinIntExpr(void)
Destructor.
Node * x
Pointer to corresponding Boolean expression node.
Sum of integer variables.
Linear expressions over integer variables.
int n_bool
Boolean variables in tree.
void estimate(Term< View > *t, int n, int c, int &l, int &u)
Estimate lower and upper bounds.
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or NULL if not non-linear.
Sum of Boolean variables.
bool valid(int n)
Return whether n is in range.
Subtraction of linear terms.
NonLinIntExpr * ne
Non-linear expression.
virtual IntVar post(Home home, IntVar *ret, IntConLevel icl) const =0
Return variable constrained to be equal to the expression.
Matrix-interface for arrays.
Class for describing linear term .
Gecode toplevel namespace
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
ArgsType const get_array(void) const
Return an Args-array of the contents of the matrix.
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
Exception: Arguments are of different size
#define GECODE_NEVER
Assert that this command is never executed.
void post(Home home, IntRelType irt, IntConLevel icl) const
Post propagator.
int val(void) const
Return assigned value.