Go to the documentation of this file.
36 #ifdef GECODE_HAS_FLOAT_VARS
77 static void*
operator new(
size_t size);
79 static void operator delete(
void*
p,
size_t size);
106 LinFloatExpr::Node::operator
new(
size_t size) {
111 LinFloatExpr::Node::operator
delete(
void*
p, size_t) {
118 if ((
l !=
nullptr) &&
l->decrement())
120 if ((
r !=
nullptr) &&
r->decrement())
153 if (home.
failed())
return;
186 if (home.
failed())
return;
215 if ((n->
n_float == 1) && (
c == 0) && (fts[0].
a == 1))
230 n->
l = n->
r =
nullptr;
238 n->
l = n->
r =
nullptr;
248 n->
l = n->
r =
nullptr;
257 n->
l = n->
r =
nullptr;
266 n->
l = n->
r =
nullptr;
269 for (
int i=
x.size();
i--; ) {
278 if (
a.size() !=
x.size())
282 n->
l = n->
r =
nullptr;
285 for (
int i=
x.size();
i--; ) {
296 n->
l = e0.n; n->
l->
use++;
297 n->
r = e1.n; n->
r->
use++;
305 n->
r = e.n; n->
r->
use++;
313 n->
l = e.n; n->
l->
use++;
322 n->
l = n->
r =
nullptr;
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
LinFloatExpr sum(const FloatVarArgs &x)
Construct linear float expression as sum of float variables.
const LinFloatExpr & operator=(const LinFloatExpr &e)
Assignment operator.
Post propagator for SetVar x
Post propagator for SetVar SetOpType SetVar y
NodeType
Type of linear expression.
void fill(Home home, Float::Linear::Term *&tf, FloatVal m, FloatVal &d) const
Generate linear terms from expression.
NodeType t
Type of expression.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Multiplication by coefficient.
Node(void)
Default constructor.
unsigned int size(I &i)
Size of all ranges of range iterator i.
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
Float::Linear::Term * tf
Integer views and coefficients.
void * ralloc(size_t s)
Allocate s bytes from heap.
FloatVal a
Coefficient and offset.
Linear term with variable.
union Gecode::LinFloatExpr::Node::@68 sum
Sum of integer or Boolean variables, or non-linear expression.
const FloatNum min
Smallest allowed float value.
bool valid(const FloatVal &n)
Return whether float n is a valid number.
int n_float
Float variables in tree.
FloatVal operator+(const FloatVal &x)
FloatRelType
Relation types for floats.
bool assigned(void) const
Test whether view is assigned.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from heap.
Gecode toplevel namespace
FloatVal operator*(const FloatVal &x, const FloatVal &y)
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
NonLinFloatExpr * nlfe(void) const
Return non-linear expression inside, or null if not non-linear.
bool decrement(void)
Decrement reference count and possibly free memory.
BoolVar expr(Home home, const BoolExpr &e, const IntPropLevels &ipls)
Post Boolean expression and return its value.
Home class for posting propagators
Subtraction of linear terms.
void estimate(Term *t, int n, FloatVal c, FloatNum &l, FloatNum &u)
Estimate lower and upper bounds.
Addition of linear terms.
Post propagator for SetVar SetOpType SetVar SetRelType r
double FloatNum
Floating point number base type.
Boolean integer variables.
NonLinFloatExpr * ne
Non-linear expression.
Class to set group information when a post function is executed.
#define GECODE_NEVER
Assert that this command is never executed.
virtual FloatVar post(Home home, FloatVar *ret) const =0
Return variable constrained to be equal to the expression.
void post(Home home, FloatRelType frt) const
Post propagator.
FloatVal operator-(const FloatVal &x)
Heap heap
The single global heap.
bool failed(void) const
Check whether corresponding space is failed.
Class for describing linear term .
Exception: Arguments are of different size
void free(T *b, long unsigned int n)
Delete n objects starting at b.
#define GECODE_MINIMODEL_EXPORT
Base class for non-linear float expressions.
unsigned int use
Nodes are reference counted.
void check(const FloatVal &n, const char *l)
Check whether float n is a valid number, otherwise throw out of limits exception with information l.
FloatVar x_float
Float variable (potentially)
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Gecode::FloatVal c(-8, 8)
int n
Number of negative literals for node type.
void rfree(void *p)
Free memory block starting at p.
LinFloatExpr(void)
Default constructor.
Gecode::IntArgs i({1, 2, 3, 4})
~LinFloatExpr(void)
Destructor.
int p
Number of positive literals for node type.
const FloatNum max
Largest allowed float value.
Nodes for linear expressions.