Go to the documentation of this file.
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++;
898 const int size = args.size();
913 return e.
post(home,ipl);
BoolVar x_bool
Boolean variable (potentially)
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
Post propagator for SetVar x
Exception: Arguments are of different size
IntRelType
Relation types for integers.
Post propagator for SetVar SetOpType SetVar y
union Gecode::LinIntExpr::Node::@65 sum
Sum of integer or Boolean variables, or non-linear expression.
int a
Coefficient and offset.
Node(void)
Default constructor.
Class for describing linear term .
@ NT_ADD
Addition of linear terms.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
@ NT_VAR_BOOL
Linear term with Boolean variable.
@ IRT_GQ
Greater or equal ( )
Passing integer variables.
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or NULL if not non-linear.
BoolVar expr(Home home, const BoolExpr &e, IntPropLevel ipl)
Post Boolean expression and return its value.
NonLinIntExpr * ne
Non-linear expression.
unsigned int size(I &i)
Size of all ranges of range iterator i.
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.
int n_bool
Boolean variables in tree.
Gecode::IntArgs i(4, 1, 2, 3, 4)
void * ralloc(size_t s)
Allocate s bytes from heap.
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Linear expressions over integer variables.
IntPropLevel
Propagation levels for integer propagators.
FloatVal operator+(const FloatVal &x)
bool assigned(void) const
Test whether view is assigned.
bool valid(int n)
Return whether n is in range.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from heap.
~LinIntExpr(void)
Destructor.
@ NT_VAR_INT
Linear term with integer variable.
Gecode toplevel namespace
@ NT_MUL
Multiplication by coefficient.
FloatVal operator*(const FloatVal &x, const FloatVal &y)
NodeType t
Type of expression.
Passing Boolean variables.
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
IntVar x_int
Integer variable (potentially)
Post propagator for SetVar SetOpType SetVar SetRelType r
Boolean integer variables.
virtual IntVar post(Home home, IntVar *ret, IntPropLevel ipl) const =0
Return variable constrained to be equal to the expression.
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
Base class for non-linear expressions over integer variables.
@ NT_NONLIN
Non-linear expression.
const int max
Largest allowed integer value.
Class to set group information when a post function is executed.
@ NT_SUM_INT
Sum of integer variables.
unsigned int use
Nodes are reference counted.
#define GECODE_NEVER
Assert that this command is never executed.
FloatVal operator-(const FloatVal &x)
Matrix-interface for arrays.
Heap heap
The single global heap.
void post(Home home, IntRelType irt, IntPropLevel ipl) const
Post propagator.
const ArgsType get_array(void) const
Return an Args-array of the contents of the matrix.
bool failed(void) const
Check whether corresponding space is failed.
@ NT_SUM_BOOL
Sum of Boolean variables.
@ NT_CONST
Integer constant.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
void free(T *b, long unsigned int n)
Delete n objects starting at b.
NodeType
Type of linear expression.
bool decrement(void)
Decrement reference count and possibly free memory.
void estimate(Term< View > *t, int n, int c, int &l, int &u)
Estimate lower and upper bounds.
const int min
Smallest allowed integer value.
LinIntExpr(void)
Default constructor.
Int::Linear::Term< Int::BoolView > * tb
Bool views and coefficients.
void post(Home home, Term< BoolView > *t, int n, IntRelType irt, IntView x, int c, IntPropLevel)
Post propagator for linear constraint over Booleans.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Gecode::FloatVal c(-8, 8)
const unsigned int slice
Size of a slice in a portfolio and scale factor for restarts(in number of failures)
int n
Number of negative literals for node type.
ArrayTraits< A >::ArgsType ArgsType
The type of the Args-array type for ValueType values.
@ NT_SUB
Subtraction of linear terms.
void rfree(void *p)
Free memory block starting at p.
Passing integer arguments.
Int::Linear::Term< Int::IntView > * ti
Integer views and coefficients.
int p
Number of positive literals for node type.
const LinIntExpr & operator=(const LinIntExpr &e)
Assignment operator.
int n_int
Integer variables in tree.
@ IRT_LQ
Less or equal ( )
Nodes for linear expressions.