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