46 namespace Gecode {
namespace Float {
namespace Linear {
52 est += t[
i].
a * t[
i].
x.domain();
71 est += t[
i].
a * t[
i].
x.domain();
96 et[
n].
a=-1.0; et[
n].
x=
x;
126 for (
int i=n;
i--; ) {
127 if ((t[
i].
a.min() < 0.0) && (t[
i].
a.
max() > 0.0))
145 Support::quicksort<Term,TermLess>(
t,
n,tl);
154 while ((++i < n) &&
same(t[i].x,x)) {
159 t[j].a =
a; t[j].x =
x; j++;
176 while ((t[j].
a < 0) && (--j >= 0)) ;
177 while ((t[i].
a > 0) && (++i < n)) ;
182 t_n = t+n_p; n_n = n-n_p;
192 for (
int i=n_n;
i--; )
193 t_n[
i].
a = -t_n[
i].
a;
215 if (!(t[
i].
a == 1.0)) {
223 for (
int i = n_p;
i--; )
226 for (
int i = n_n;
i--; )
228 post_nary<FloatView>(home,
x,
y,frt,
c);
232 for (
int i = n_p;
i--; )
235 for (
int i = n_n;
i--; )
237 post_nary<ScaleView>(home,
x,
y,frt,
c);
254 dopost(home, t, n, frt, c);
260 rel(home,
extend(home,re,t,n), frt, c, r);
Propagator for bounds consistent n-ary linear equality
FloatVal val(void) const
Return assigned value.
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
const FloatNum max
Largest allowed float value.
Exception: Value out of limits
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
bool assigned(void) const
Test whether view is assigned.
Propagator for bounds consistent n-ary linear less or equal
void post_nary(Home home, ViewArray< View > &x, ViewArray< View > &y, FloatRelType frt, FloatVal c)
Posting n-ary propagators.
Sort linear terms by view.
bool in(FloatNum n) const
Test whether n is included.
Gecode::FloatVal c(-8, 8)
bool same(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether two views are the same.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
bool overflow(Term *t, int n, FloatVal c)
FloatRelType
Relation types for floats.
VarImp * x
Pointer to variable implementation.
bool before(const ViewA &x, const ViewB &y)
Reification specification.
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
bool operator()(const Term &a, const Term &b)
Exception: Unknown relation passed as argument
Float view for float variables.
Post propagator for SetVar SetOpType SetVar SetRelType r
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 .
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Post propagator for SetVar SetOpType SetVar y
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
void estimate(Term *t, int n, FloatVal c, FloatNum &l, FloatNum &u)
Estimate lower and upper bounds.
Post propagator for SetVar x
Class for describing linear term .
void fail(void)
Mark space as failed.
Gecode toplevel namespace
friend FloatVal max(const FloatVal &x, const FloatVal &y)
FloatView extend(Home home, Region &r, Term *&t, int &n)
Extend terms by adding view for result.
friend FloatVal min(const FloatVal &x, const FloatVal &y)
Home class for posting propagators
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
Exception: Value with mixed sign
void dopost(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
double FloatNum
Floating point number base type.
#define GECODE_NEVER
Assert that this command is never executed.
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.