Go to the documentation of this file.
42 namespace Gecode {
namespace Float {
namespace Linear {
48 est +=
t[
i].
a *
t[
i].
x.domain();
67 est +=
t[
i].
a *
t[
i].
x.domain();
92 et[
n].
a=-1.0; et[
n].
x=
x;
122 for (
int i=
n;
i--; ) {
123 if ((
t[
i].
a.min() < 0.0) && (
t[
i].a.max() > 0.0))
126 c -=
t[
i].a *
t[
i].x.val();
141 Support::quicksort<Term,TermLess>(
t,
n,tl);
150 while ((++
i <
n) && (
t[
i].
x ==
x)) {
155 t[j].a =
a;
t[j].x =
x; j++;
172 while ((
t[j].
a < 0) && (--j >= 0)) ;
173 while ((
t[
i].
a > 0) && (++
i <
n)) ;
178 t_n =
t+n_p; n_n =
n-n_p;
188 for (
int i=n_n;
i--; )
189 t_n[
i].
a = -t_n[
i].
a;
211 if (!(
t[
i].
a == 1.0)) {
219 for (
int i = n_p;
i--; )
222 for (
int i = n_n;
i--; )
224 post_nary<FloatView>(home,
x,
y,frt,
c);
228 for (
int i = n_p;
i--; )
231 for (
int i = n_n;
i--; )
233 post_nary<ScaleView>(home,
x,
y,frt,
c);
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Post propagator for SetVar x
Post propagator for SetVar SetOpType SetVar y
friend FloatVal max(const FloatVal &x, const FloatVal &y)
Propagator for bounds consistent n-ary linear less or equal
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
friend FloatVal min(const FloatVal &x, const FloatVal &y)
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
FloatView extend(Home home, Region &r, Term *&t, int &n)
Extend terms by adding view for result.
const FloatNum min
Smallest allowed float value.
FloatRelType
Relation types for floats.
bool assigned(void) const
Test whether view is assigned.
void post_nary(Home home, ViewArray< View > &x, ViewArray< View > &y, FloatRelType frt, FloatVal c)
Posting n-ary propagators.
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
Gecode toplevel namespace
Float view for float variables.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Reification specification.
bool in(FloatNum n) const
Test whether n is included.
Home class for posting propagators
void estimate(Term *t, int n, FloatVal c, FloatNum &l, FloatNum &u)
Estimate lower and upper bounds.
Post propagator for SetVar SetOpType SetVar SetRelType r
double FloatNum
Floating point number base type.
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.
bool operator()(const Term &a, const Term &b)
#define GECODE_NEVER
Assert that this command is never executed.
void dopost(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
bool overflow(Term *t, int n, FloatVal c)
Exception: Value out of limits
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Propagator for bounds consistent n-ary linear equality
void fail(void)
Mark space as failed.
Class for describing linear term .
Exception: Unknown relation passed as argument
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.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Gecode::FloatVal c(-8, 8)
Sort linear terms by view.
int n
Number of negative literals for node type.
Gecode::IntArgs i({1, 2, 3, 4})
const FloatNum max
Largest allowed float value.
Exception: Value with mixed sign