Go to the documentation of this file.
46 namespace Gecode {
namespace Float {
namespace Linear {
52 est +=
t[
i].
a *
t[
i].
x.domain();
85 et[
n].
a=-1.0; et[
n].
x=
x;
117 c -=
t[
i].a *
t[
i].x.val();
131 Support::quicksort<Term,TermLess>(
t,
n,tl);
145 t[j].a =
a;
t[j].x =
x; j++;
162 while ((
t[j].
a < 0) && (--j >= 0)) ;
163 while ((
t[
i].
a > 0) && (++
i <
n)) ;
168 t_n =
t+n_p; n_n =
n-n_p;
178 for (
int i=n_n;
i--; )
179 t_n[
i].
a = -t_n[
i].
a;
201 if (!(
t[
i].
a == 1.0)) {
209 for (
int i = n_p;
i--; )
212 for (
int i = n_n;
i--; )
214 post_nary<FloatView>(home,
x,
y,frt,
c);
218 for (
int i = n_p;
i--; )
221 for (
int i = n_n;
i--; )
223 post_nary<ScaleView>(home,
x,
y,frt,
c);
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.
Gecode::IntArgs i(4, 1, 2, 3, 4)
bool same(const Item &i, const Item &j)
Whether two items are the same.
const FloatNum min
Smallest allowed float value.
FloatRelType
Relation types for floats.
bool assigned(void) const
Test whether view is assigned.
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
void post_nary(Home home, ViewArray< View > &x, ViewArray< View > &y, FloatRelType frt, FloatVal c)
Posting n-ary propagators.
Gecode toplevel namespace
Float view for float variables.
Reification specification.
bool in(FloatNum n) const
Test whether n is included.
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)
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)
@ FRT_LQ
Less or equal ( )
#define GECODE_NEVER
Assert that this command is never executed.
bool before(const Item &i, const Item &j)
Test whether one item is before another.
void dopost(Home home, Term *t, int n, FloatRelType frt, 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.
@ FRT_GQ
Greater or equal ( )
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.
const FloatNum max
Largest allowed float value.