61 x =
v.x;
return *
this;
79 return boost::numeric::width(
x);
83 return boost::numeric::median(
x);
88 return (boost::numeric::singleton(
x) ||
89 (nextafter(
x.lower(),
x.upper()) ==
x.upper()));
93 return boost::numeric::singleton(
x);
97 return boost::numeric::in(
n,
x);
101 return boost::numeric::zero_in(
x);
110 FloatVal p(boost::numeric::interval_lib::pi_half<FloatValImpType>());
115 FloatVal p(boost::numeric::interval_lib::pi<FloatValImpType>());
120 FloatVal p(boost::numeric::interval_lib::pi_twice<FloatValImpType>());
126 x +=
n;
return *
this;
130 x -=
n;
return *
this;
134 x *=
n;
return *
this;
138 x /=
n;
return *
this;
143 x +=
v.x;
return *
this;
147 x -=
v.x;
return *
this;
151 x *=
v.x;
return *
this;
155 x /=
v.x;
return *
this;
169 FloatNum mmi = (
x.min() == 0.0) ? 0.0 : -
x.min();
170 FloatNum mma = (
x.max() == 0.0) ? 0.0 :-
x.max();
229 }
catch (boost::numeric::interval_lib::comparison_error&) {
237 }
catch (boost::numeric::interval_lib::comparison_error&) {
246 }
catch (boost::numeric::interval_lib::comparison_error&) {
254 }
catch (boost::numeric::interval_lib::comparison_error&) {
263 }
catch (boost::numeric::interval_lib::comparison_error&) {
271 }
catch (boost::numeric::interval_lib::comparison_error&) {
280 }
catch (boost::numeric::interval_lib::comparison_error&) {
288 }
catch (boost::numeric::interval_lib::comparison_error&) {
297 }
catch (boost::numeric::interval_lib::comparison_error&) {
303 if (!boost::numeric::interval_lib::checking_strict<FloatNum>
304 ::is_empty(
x.x.lower(),
x.x.upper())) {
305 if ((
x.x.lower() ==
y) && (
x.x.upper() ==
y))
308 if (((
x.x.lower() ==
y) &&
309 (nextafter(
x.x.lower(),
x.x.upper()) ==
x.x.upper())) ||
310 ((
x.x.upper() ==
y) &&
311 (nextafter(
x.x.upper(),
x.x.lower()) ==
x.x.lower())))
320 }
catch (boost::numeric::interval_lib::comparison_error&) {
328 }
catch (boost::numeric::interval_lib::comparison_error&) {
358 template<
class Char,
class Traits>
359 std::basic_ostream<Char,Traits>&
360 operator <<(std::basic_ostream<Char,Traits>& os,
const FloatVal&
x) {
361 return os <<
'[' <<
x.min() <<
".." <<
x.max() <<
']';
410 #ifdef GECODE_HAS_MPFR
487 namespace Gecode {
namespace Float {
int p
Number of positive literals for node type.
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
bool singleton(void) const
Test whether float is a singleton.
FloatVal & operator/=(const FloatNum &n)
Divide by n.
static FloatVal pi(void)
Return lower bound of .
boost::numeric::interval< FloatNum, boost::numeric::interval_lib::policies< R, P > > FloatValImpType
Implementation type for float value.
static FloatVal hull(FloatNum x, FloatNum y)
Return hull of x and y.
static FloatVal pi_twice(void)
Return .
FloatValImpType x
Implementation of float value.
bool zero_in(void) const
Test whether zero is included.
FloatVal & operator-=(const FloatNum &n)
Subtract by n.
bool in(FloatNum n) const
Test whether n is included.
FloatVal & operator*=(const FloatNum &n)
Multiply by n.
FloatNum max(void) const
Return upper bound.
void assign(FloatNum const &l, FloatNum const &u)
Assign lower bound l and upper bound u.
FloatVal & operator+=(const FloatNum &n)
Increment by n.
FloatNum med(void) const
Return median of float value.
FloatVal & operator=(const FloatNum &n)
Assignment operator.
bool tight(void) const
Test whether float is tight.
FloatNum size(void) const
Return size of float value (distance between maximum and minimum)
static FloatVal pi_half(void)
Return .
FloatVal(void)
Default constructor.
FloatNum min(void) const
Return lower bound.
VarImp * x
Pointer to variable implementation.
FloatVal asinh(const FloatVal &x)
FloatVal fmod(const FloatVal &x, const FloatVal &y)
FloatVal sinh(const FloatVal &x)
FloatVal acosh(const FloatVal &x)
FloatVal tanh(const FloatVal &x)
FloatVal atanh(const FloatVal &x)
FloatVal cosh(const FloatVal &x)
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Post propagator for SetVar SetOpType SetVar y
double FloatNum
Floating point number base type.
bool subset(const FloatVal &x, const FloatVal &y)
bool proper_subset(const FloatVal &x, const FloatVal &y)
FloatVal hull(const FloatVal &x, const FloatVal &y)
bool overlap(const FloatVal &x, const FloatVal &y)
FloatVal intersect(const FloatVal &x, const FloatVal &y)
Gecode::IntArgs i({1, 2, 3, 4})