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))
125 if (t[i].
x.assigned()) {
126 c -= t[i].
a * t[i].
x.
val();
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)) ;
175 std::swap(t[i],t[j]);
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;
193 std::swap(n_p,n_n); std::swap(t_p,t_n); c = -c;
211 if (!(t[i].a == 1.0)) {
219 for (
int i = n_p; i--; )
222 for (
int i = n_n; i--; )
228 for (
int i = n_p; i--; )
231 for (
int i = n_n; i--; )
250 dopost(home, t, n, frt, c);
FloatValImpType x
Implementation of float value.
bool in(FloatNum n) const
Test whether n is included.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
friend FloatVal min(const FloatVal &x, const FloatVal &y)
Float view for float variables.
FloatVal val(void) const
Return assigned value.
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, FloatVal c)
Post propagator for .
static ExecStatus post(Home home, ViewArray< P > &x, ViewArray< N > &y, FloatVal c)
Post propagator for .
Sort linear terms by view.
bool operator()(const Term &a, const Term &b)
Class for describing linear term .
Exception: Value out of limits
Exception: Unknown relation passed as argument
Exception: Value with mixed sign
Home class for posting propagators
void fail(void)
Mark space as failed.
Reification specification.
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
double FloatNum
Floating point number base type.
FloatRelType
Relation types for floats.
@ FRT_LQ
Less or equal ( )
@ FRT_GQ
Greater or equal ( )
const FloatNum max
Largest allowed float value.
const FloatNum min
Smallest allowed float value.
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.
FloatView extend(Home home, Region &r, Term *&t, int &n)
Extend terms by adding view for result.
bool overflow(Term *t, int n, FloatVal c)
void post_nary(Home home, ViewArray< View > &x, ViewArray< View > &y, FloatRelType frt, FloatVal c)
Posting n-ary propagators.
void dopost(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
void estimate(Term *t, int n, FloatVal c, FloatNum &l, FloatNum &u)
Estimate lower and upper bounds.
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar SetOpType SetVar y
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar x
#define GECODE_NEVER
Assert that this command is never executed.