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,ipl,its,NULL);
192 }
else if (n->
n_int == 0) {
196 int c = n->
fill(home,ipl,NULL,bts);
198 }
else if (n->
n_bool == 1) {
204 int c = n->
fill(home,ipl,its,bts);
216 int c = n->
fill(home,ipl,its,bts);
229 if (home.
failed())
return;
247 int c = n->
fill(home,ipl,its,NULL);
250 }
else if (n->
n_int == 0) {
254 int c = n->
fill(home,ipl,NULL,bts);
256 }
else if (n->
n_bool == 1) {
262 int c = n->
fill(home,ipl,its,bts);
274 int c = n->
fill(home,ipl,its,bts);
292 int c = n->
fill(home,ipl,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,ipl,NULL,bts);
311 }
else if (n->
n_bool == 1) {
317 int c = n->
fill(home,ipl,its,bts);
333 int c = n->
fill(home,ipl,its,bts);
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, ipl);
ti++;
913 return e.
post(home,ipl);
FloatVal operator-(const FloatVal &x)
IntVar x_int
Integer variable (potentially)
NodeType t
Type of expression.
int size(void) const
Return size of array (number of elements)
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.
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 .
bool assigned(void) const
Test whether view is assigned.
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.
const LinIntExpr & operator=(const LinIntExpr &e)
Assignment operator.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
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.
Class to set group information when a post function is executed.
bool failed(void) const
Check whether corresponding space is failed.
unsigned int size(I &i)
Size of all ranges of range iterator i.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
int a
Coefficient and offset.
LinIntExpr(void)
Default constructor.
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
void post(Home home, IntRelType irt, IntPropLevel ipl) const
Post propagator.
NodeType
Type of linear expression.
Passing integer variables.
Passing integer arguments.
Passing Boolean variables.
Node(void)
Default constructor.
BoolVar expr(Home home, const BoolExpr &e, IntPropLevel ipl)
Post Boolean expression and return its value.
Boolean integer variables.
Post propagator for SetVar SetOpType SetVar SetRelType r
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.
IntPropLevel
Propagation levels for integer propagators.
virtual IntVar post(Home home, IntVar *ret, IntPropLevel ipl) const =0
Return variable constrained to be equal to the expression.
Post propagator for SetVar SetOpType SetVar y
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.
Sum of integer variables.
Linear expressions over integer variables.
int n_bool
Boolean variables in tree.
Heap heap
The single global heap.
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.
union Gecode::LinIntExpr::Node::@65 sum
Sum of integer or Boolean variables, or non-linear expression.
bool valid(int n)
Return whether n is in range.
Subtraction of linear terms.
void fill(Home home, IntPropLevel ipl, 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.
Post propagator for SetVar x
NonLinIntExpr * ne
Non-linear 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 post(Home home, Term< BoolView > *t, int n, IntRelType irt, IntView x, int c, IntPropLevel)
Post propagator for linear constraint over Booleans.
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.
const unsigned int slice
Size of a slice in a portfolio and scale factor for restarts(in number of failures)