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())
154 fill(home,icl,ti,tb,1,d);
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--; ) {
416 for (
int i=x.
size();
i--; ) {
431 for (
int i=x.
size();
i--; ) {
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 {
522 ti->
a=
static_cast<int>(m*
a); ti->
x=
x_int; ti++;
525 ti->
a=
static_cast<int>(m); ti->
x=
sum.ne->post(home, NULL, icl); ti++;
529 tb->
a=
static_cast<int>(m*
a); tb->
x=
x_bool; tb++;
534 ti[
i].
x =
sum.ti[
i].x; ti[
i].
a =
static_cast<int>(m*
sum.ti[
i].a);
541 tb[
i].
x =
sum.tb[
i].x; tb[
i].
a =
static_cast<int>(m*
sum.tb[
i].a);
550 l->
fill(home,icl,ti,tb,m,d);
552 r->
fill(home,icl,ti,tb,m,d);
559 l->
fill(home,icl,ti,tb,m,d);
561 r->
fill(home,icl,ti,tb,-m,d);
565 l->
fill(home,icl,ti,tb,m*a,d);
900 for (i = 0 ; i <
size ; ++
i)
912 return e.
post(home,icl);
bool failed(void) const
Check whether corresponding space is failed.
FloatVal operator-(const FloatVal &x)
IntVar x_int
Integer variable (potentially)
IntConLevel
Consistency levels for integer propagators.
NodeType t
Type of expression.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
union Gecode::LinIntExpr::Node::@61 sum
Sum of integer or Boolean variables, or non-linear expression.
void rfree(void *p)
Free memory block starting at p.
int size(void) const
Return size of array (number of elements)
void post(Home home, Term< BoolView > *t, int n, IntRelType irt, IntView x, int c, IntConLevel)
Post propagator for linear constraint over Booleans.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
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 .
Int::Linear::Term< Int::BoolView > * tb
Bool views and coefficients.
Base class for non-linear expressions over integer variables.
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.
int val(void) const
Return assigned 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.
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.
Boolean integer variables.
ArgsType const get_array(void) const
Return an Args-array of the contents of the matrix.
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.
FloatVal operator*(const FloatVal &x, const FloatVal &y)
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.
int val(void) const
Return assigned value.
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.
bool assigned(void) const
Test whether view is assigned.
Class for describing linear term .
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
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.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
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.
void post(Home home, IntRelType irt, IntConLevel icl) const
Post propagator.