Go to the documentation of this file.
73 long long int m,
long long int&
d)
const;
83 static void*
operator new(
size_t size);
85 static void operator delete(
void*
p,
size_t size);
115 LinIntExpr::Node::operator
new(
size_t size) {
120 LinIntExpr::Node::operator
delete(
void*
p, size_t) {
126 if ((
l !=
nullptr) &&
l->decrement())
128 if ((
r !=
nullptr) &&
r->decrement())
152 return static_cast<int>(
d);
158 if (home.
failed())
return;
186 int c = n->
fill(home,ipls,its,
nullptr);
190 }
else if (n->
n_int == 0) {
194 int c = n->
fill(home,ipls,
nullptr,bts);
197 }
else if (n->
n_bool == 1) {
203 int c = n->
fill(home,ipls,its,bts);
216 int c = n->
fill(home,ipls,its,bts);
231 if (home.
failed())
return;
249 int c = n->
fill(home,ipls,its,
nullptr);
253 }
else if (n->
n_int == 0) {
257 int c = n->
fill(home,ipls,
nullptr,bts);
260 }
else if (n->
n_bool == 1) {
266 int c = n->
fill(home,ipls,its,bts);
279 int c = n->
fill(home,ipls,its,bts);
299 int c = n->
fill(home,ipls,its,
nullptr);
300 if ((n->
n_int == 1) && (
c == 0) && (its[0].
a == 1))
309 }
else if (n->
n_int == 0) {
313 int c = n->
fill(home,ipls,
nullptr,bts);
320 }
else if (n->
n_bool == 1) {
326 int c = n->
fill(home,ipls,its,bts);
342 int c = n->
fill(home,ipls,its,bts);
367 n->
l = n->
r =
nullptr;
375 n->
l = n->
r =
nullptr;
386 n->
l = n->
r =
nullptr;
396 n->
l = n->
r =
nullptr;
406 n->
l = n->
r =
nullptr;
409 for (
int i=
x.size();
i--; ) {
418 if (
a.size() !=
x.size())
423 n->
l = n->
r =
nullptr;
426 for (
int i=
x.size();
i--; ) {
438 n->
l = n->
r =
nullptr;
441 for (
int i=
x.size();
i--; ) {
450 if (
a.size() !=
x.size())
455 n->
l = n->
r =
nullptr;
458 for (
int i=
x.size();
i--; ) {
470 n->
l = e0.n; n->
l->
use++;
471 n->
r = e1.n; n->
r->
use++;
480 n->
r = e.n; n->
r->
use++;
489 n->
l = e.n; n->
l->
use++;
499 n->
l = n->
r =
nullptr;
524 long long int m,
long long int&
d)
const {
535 ti->a=
static_cast<int>(m);
ti->x=
sum.ne->post(home,
nullptr, ipls);
ti++;
908 for (
int i = 0;
i<args.size();
i++)
918 return e.
post(home,ipls);
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
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.
NonLinIntExpr * ne
Non-linear expression.
unsigned int size(I &i)
Size of all ranges of range iterator i.
int n_bool
Boolean variables in tree.
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.
FloatVal operator+(const FloatVal &x)
bool assigned(void) const
Test whether view is assigned.
void post(Home home, IntRelType irt, const IntPropLevels &ipls) const
Post propagator.
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.
Class for specifying integer propagation levels used by minimodel.
~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.
BoolVar expr(Home home, const BoolExpr &e, const IntPropLevels &ipls)
Post Boolean expression and return its value.
Passing Boolean variables.
Home class for posting propagators
void fill(Home home, const IntPropLevels &ipls, 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.
IntVar x_int
Integer variable (potentially)
Post propagator for SetVar SetOpType SetVar SetRelType r
Boolean integer variables.
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.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
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.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
FloatVal operator-(const FloatVal &x)
Matrix-interface for arrays.
Heap heap
The single global heap.
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.
IntPropLevel linear2(void) const
Return integer propagation level for binary linear constraints.
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.
union Gecode::LinIntExpr::Node::@69 sum
Sum of integer or Boolean variables, or non-linear expression.
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.
Gecode::IntArgs i({1, 2, 3, 4})
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.
IntPropLevel linear(void) const
Return integer propagation level for non-binary linear constraints.
virtual IntVar post(Home home, IntVar *ret, const IntPropLevels &ipls) const =0
Return variable constrained to be equal to the expression.
@ IRT_LQ
Less or equal ( )
Nodes for linear expressions.