Gecode::Float Namespace Reference

Floating point numbers. More...

## Namespaces

namespace | Limits
| Numerical limits for floating point variables.
namespace | Arithmetic
| Arithmetic propagators
namespace | Bool
| Boolean propagators.
namespace | Branch
| Float branchers.
namespace | Channel
| Channel propagators
namespace | Linear
| Linear propagators
namespace | Rel
| Simple relation propagators.
namespace | Transcendental
| Transcendental propagators
namespace | Trigonometric
| Trigonometric propagators

## Classes

class | Rounding
| Floating point rounding policy. More...
class | OutOfLimits
| Exception: Value out of limits More...
class | ValueMixedSign
| Exception: Value with mixed sign More...
class | VariableEmptyDomain
| Exception: Variable created with empty domain More...
class | TooFewArguments
| Exception: Too few arguments available in argument array More...
class | ArgumentSizeMismatch
| Exception: Arguments are of different size More...
class | ArgumentSame
| Exception: Arguments contain same variable multiply More...
class | UnknownRelation
| Exception: Unknown relation passed as argument More...
class | UnknownOperation
| Exception: Unknown operation passed as argument More...
class | IllegalOperation
| Exception: Illegal operation passed as argument More...
class | UnknownBranching
| Exception: Unknown value or variable selection passed as argument More...
class | ValOfUnassignedVar
| Exception: Attempt to access value of unassigned variable More...
class | Relax
| Class for posting equalities for non-relaxed variables. More...
class | FloatTraceView
| Float trace view. More...
class | FloatDelta
| Float delta information for advisors. More...
class | FloatVarImp
| Float variable implementation. More...
class | FloatView
| Float view for float variables. More...
class | MinusView
| Minus float view. More...
class | OffsetView
| OffsetView float view. More...
class | ScaleView
| Scale float view. More...
class | FloatVarImpBase
| Base-class for Float-variable implementations. More...
class | FloatVarImpConf
| Configuration for Float-variable implementations. More...

## Typedefs

typedef boost::numeric::interval_lib::rounded_arith_opp< FloatNum > | RoundingBase
| Rounding Base class (optimized version).
typedef int | mpfr_func(mpfr_t, const __mpfr_struct *, mp_rnd_t)
| Type signatur of mpfr function.

## Enumerations

enum | RelTest { RT_FALSE = 0 , RT_MAYBE = 1 , RT_TRUE = 2 }
| Result of testing relation. More...

## Functions

double | invoke_mpfr (FloatNum x, mpfr_func f, mp_rnd_t r)
| Routine to call mpfr function with proper rounding.
bool | subset (const FloatVal &x, const FloatVal &y)
bool | proper_subset (const FloatVal &x, const FloatVal &y)
bool | overlap (const FloatVal &x, const FloatVal &y)
FloatVal | intersect (const FloatVal &x, const FloatVal &y)
FloatVal | hull (const FloatVal &x, const FloatVal &y)
FloatVal | hull (const FloatVal &x, const FloatNum &y)
FloatVal | hull (const FloatNum &x, const FloatVal &y)
FloatVal | hull (const FloatNum &x, const FloatNum &y)
template<class View>
RelTest | rtest_eq (View x, View y)
| Test whether views x and y are equal.
template<class View>
RelTest | rtest_eq (View x, FloatVal n)
| Test whether view x and Float n are equal.
template<class View>
RelTest | rtest_lq (View x, View y)
| Test whether view x is less or equal than view y.
template<class View>
RelTest | rtest_lq (View x, FloatVal n)
| Test whether view x is less or equal than float n.
template<class View>
RelTest | rtest_le (View x, View y)
| Test whether view x is less than view y.
template<class View>
RelTest | rtest_le (View x, FloatVal n)
| Test whether view x is less or equal than float n.
bool | operator== (const MinusView &x, const MinusView &y)
bool | operator!= (const MinusView &x, const MinusView &y)
bool | operator== (const OffsetView &x, const OffsetView &y)
bool | operator!= (const OffsetView &x, const OffsetView &y)
template<class Char, class Traits, class View>
std::basic_ostream< Char, Traits > & | print_view (std::basic_ostream< Char, Traits > &os, const View &x)
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const FloatView &x)
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const MinusView &x)
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const OffsetView &x)
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const ScaleView &x)
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const Linear::NoView &)
bool | operator== (const ScaleView &x, const ScaleView &y)
bool | operator!= (const ScaleView &x, const ScaleView &y)
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const FloatView &x)
| Print float variable view.
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const MinusView &x)
| Print float minus view.

## Variables

const Gecode::ModEvent | ME_FLOAT_FAILED = Gecode::ME_GEN_FAILED
| Domain operation has resulted in failure.
const Gecode::ModEvent | ME_FLOAT_NONE = Gecode::ME_GEN_NONE
| Domain operation has not changed domain.
const Gecode::ModEvent | ME_FLOAT_VAL = Gecode::ME_GEN_ASSIGNED
| Domain operation has resulted in a value (assigned variable).
const Gecode::ModEvent | ME_FLOAT_BND = Gecode::ME_GEN_ASSIGNED + 1
| Domain operation has changed the minimum or maximum of the domain.
const Gecode::PropCond | PC_FLOAT_NONE = Gecode::PC_GEN_NONE
| Propagation condition to be ignored (convenience).
const Gecode::PropCond | PC_FLOAT_VAL = Gecode::PC_GEN_ASSIGNED
| Propagate when a view becomes assigned (single value).
const Gecode::PropCond | PC_FLOAT_BND = Gecode::PC_GEN_ASSIGNED + 1
| Propagate when minimum or maximum of a view changes.

## View comparison

bool | operator== (const MinusView &x, const MinusView &y)
| Test whether views x and y are the same.
bool | operator!= (const MinusView &x, const MinusView &y)
| Test whether views x and y are not the same.
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const OffsetView &x)
| Print float offset view.
bool | operator== (const OffsetView &x, const OffsetView &y)
| Test whether views x and y are the same.
bool | operator!= (const OffsetView &x, const OffsetView &y)
| Test whether views x and y are not the same.
template<class Char, class Traits>
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const ScaleView &x)
| Print scale view.
bool | operator== (const ScaleView &x, const ScaleView &y)
| Test whether views x and y are the same.
bool | operator!= (const ScaleView &x, const ScaleView &y)
| Test whether views x and y are not the same.

## Detailed Description

Floating point numbers.

The Gecode::Float namespace contains all functionality required to program propagators and branchers for floating point numbers. In addition, all propagators and branchers for floating point numbers provided by Gecode are contained as nested namespaces.

## Typedef Documentation

## RoundingBase

typedef boost::numeric::interval_lib::rounded_arith_opp<FloatNum> Gecode::Float::RoundingBase

Rounding Base class (optimized version).

Definition at line 145 of file float.hh.

## mpfr_func

typedef int Gecode::Float::mpfr_func(mpfr_t, const __mpfr_struct *, mp_rnd_t)

Type signatur of mpfr function.

Definition at line 48 of file rounding.cpp.

## Enumeration Type Documentation

## RelTest

enum Gecode::Float::RelTest

Result of testing relation.

Enumerator
RT_FALSE | Relation does not hold.
RT_MAYBE | Relation may hold or not.
RT_TRUE | Relation does hold.

Definition at line 533 of file view.hpp.

## Function Documentation

## invoke_mpfr()

double Gecode::Float::invoke_mpfr | ( | FloatNum | x,
|  | mpfr_func | f,
|  | mp_rnd_t | r )

inline

Routine to call mpfr function with proper rounding.

Definition at line 52 of file rounding.cpp.

## subset()

bool Gecode::Float::subset | ( | const FloatVal & | x,
|  | const FloatVal & | y )

related

Definition at line 490 of file val.hpp.

## proper_subset()

bool Gecode::Float::proper_subset | ( | const FloatVal & | x,
|  | const FloatVal & | y )

related

Definition at line 494 of file val.hpp.

## overlap()

bool Gecode::Float::overlap | ( | const FloatVal & | x,
|  | const FloatVal & | y )

related

Definition at line 498 of file val.hpp.

## intersect()

FloatVal Gecode::Float::intersect | ( | const FloatVal & | x,
|  | const FloatVal & | y )

related

Definition at line 503 of file val.hpp.

## hull() [1/4]

FloatVal Gecode::Float::hull | ( | const FloatVal & | x,
|  | const FloatVal & | y )

related

Definition at line 507 of file val.hpp.

## hull() [2/4]

FloatVal Gecode::Float::hull | ( | const FloatVal & | x,
|  | const FloatNum & | y )

related

Definition at line 511 of file val.hpp.

## hull() [3/4]

FloatVal Gecode::Float::hull | ( | const FloatNum & | x,
|  | const FloatVal & | y )

related

Definition at line 515 of file val.hpp.

## hull() [4/4]

FloatVal Gecode::Float::hull | ( | const FloatNum & | x,
|  | const FloatNum & | y )

related

Definition at line 519 of file val.hpp.

## rtest_eq() [1/2]

template<class View>

RelTest Gecode::Float::rtest_eq | ( | View | x,
|  | View | y )

inline

Test whether views x and y are equal.

Definition at line 40 of file rel-test.hpp.

## rtest_eq() [2/2]

template<class View>

RelTest Gecode::Float::rtest_eq | ( | View | x,
|  | FloatVal | n )

inline

Test whether view x and Float n are equal.

Definition at line 47 of file rel-test.hpp.

## rtest_lq() [1/2]

template<class View>

RelTest Gecode::Float::rtest_lq | ( | View | x,
|  | View | y )

inline

Test whether view x is less or equal than view y.

Definition at line 54 of file rel-test.hpp.

## rtest_lq() [2/2]

template<class View>

RelTest Gecode::Float::rtest_lq | ( | View | x,
|  | FloatVal | n )

inline

Test whether view x is less or equal than float n.

Definition at line 62 of file rel-test.hpp.

## rtest_le() [1/2]

template<class View>

RelTest Gecode::Float::rtest_le | ( | View | x,
|  | View | y )

inline

Test whether view x is less than view y.

Definition at line 70 of file rel-test.hpp.

## rtest_le() [2/2]

template<class View>

RelTest Gecode::Float::rtest_le | ( | View | x,
|  | FloatVal | n )

inline

Test whether view x is less or equal than float n.

Definition at line 78 of file rel-test.hpp.

## operator==() [1/6]

bool Gecode::Float::operator== | ( | const MinusView & | x,
|  | const MinusView & | y )

related

Definition at line 165 of file minus.hpp.

## operator!=() [1/6]

bool Gecode::Float::operator!= | ( | const MinusView & | x,
|  | const MinusView & | y )

related

Definition at line 169 of file minus.hpp.

## operator==() [2/6]

bool Gecode::Float::operator== | ( | const OffsetView & | x,
|  | const OffsetView & | y )

related

Definition at line 195 of file offset.hpp.

## operator!=() [2/6]

bool Gecode::Float::operator!= | ( | const OffsetView & | x,
|  | const OffsetView & | y )

related

Definition at line 199 of file offset.hpp.

## print_view()

template<class Char, class Traits, class View>

std::basic_ostream< Char, Traits > & Gecode::Float::print_view | ( | std::basic_ostream< Char, Traits > & | os,
|  | const View & | x )

Definition at line 45 of file print.hpp.

## operator<<() [1/9]

template<class Char, class Traits>

std::basic_ostream< Char, Traits > & Gecode::Float::operator<< | ( | std::basic_ostream< Char, Traits > & | os,
|  | const FloatView & | x )

related

Definition at line 45 of file print.hpp.

## operator<<() [2/9]

template<class Char, class Traits>

std::basic_ostream< Char, Traits > & Gecode::Float::operator<< | ( | std::basic_ostream< Char, Traits > & | os,
|  | const MinusView & | x )

related

Definition at line 45 of file print.hpp.

## operator<<() [3/9]

template<class Char, class Traits>

std::basic_ostream< Char, Traits > & Gecode::Float::operator<< | ( | std::basic_ostream< Char, Traits > & | os,
|  | const OffsetView & | x )

related

Definition at line 45 of file print.hpp.

## operator<<() [4/9]

template<class Char, class Traits>

std::basic_ostream< Char, Traits > & Gecode::Float::operator<< | ( | std::basic_ostream< Char, Traits > & | os,
|  | const ScaleView & | x )

related

Definition at line 45 of file print.hpp.

## operator<<() [5/9]

template<class Char, class Traits>

std::basic_ostream< Char, Traits > & Gecode::Float::operator<< | ( | std::basic_ostream< Char, Traits > & | os,
|  | const Linear::NoView & | )

related

Definition at line 45 of file print.hpp.

## operator==() [3/6]

bool Gecode::Float::operator== | ( | const ScaleView & | x,
|  | const ScaleView & | y )

related

Definition at line 200 of file scale.hpp.

## operator!=() [3/6]

bool Gecode::Float::operator!= | ( | const ScaleView & | x,
|  | const ScaleView & | y )

related

Definition at line 204 of file scale.hpp.

## Variable Documentation

## ME_FLOAT_FAILED

const Gecode::ModEvent Gecode::Float::ME_FLOAT_FAILED = Gecode::ME_GEN_FAILED

Domain operation has resulted in failure.

Definition at line 260 of file var-type.hpp.

## ME_FLOAT_NONE

const Gecode::ModEvent Gecode::Float::ME_FLOAT_NONE = Gecode::ME_GEN_NONE

Domain operation has not changed domain.

Definition at line 262 of file var-type.hpp.

## ME_FLOAT_VAL

const Gecode::ModEvent Gecode::Float::ME_FLOAT_VAL = Gecode::ME_GEN_ASSIGNED

Domain operation has resulted in a value (assigned variable).

Definition at line 264 of file var-type.hpp.

## ME_FLOAT_BND

const Gecode::ModEvent Gecode::Float::ME_FLOAT_BND = Gecode::ME_GEN_ASSIGNED + 1

Domain operation has changed the minimum or maximum of the domain.

Note that this implies that the domain has not resulted in a value.

If a propagator subscribes to this variable, it will be processed assuming a ME_FLOAT_BND modification event.

Definition at line 273 of file var-type.hpp.

## PC_FLOAT_NONE

const Gecode::PropCond Gecode::Float::PC_FLOAT_NONE = Gecode::PC_GEN_NONE

Propagation condition to be ignored (convenience).

Definition at line 275 of file var-type.hpp.

## PC_FLOAT_VAL

const Gecode::PropCond Gecode::Float::PC_FLOAT_VAL = Gecode::PC_GEN_ASSIGNED

Propagate when a view becomes assigned (single value).

If a propagator p depends on a view x with propagation condition PC_FLOAT_VAL, then p is propagated when a domain update operation on x returns the modification event ME_FLOAT_VAL.

Definition at line 283 of file var-type.hpp.

## PC_FLOAT_BND

const Gecode::PropCond Gecode::Float::PC_FLOAT_BND = Gecode::PC_GEN_ASSIGNED + 1

Propagate when minimum or maximum of a view changes.

If a propagator p depends on a view x with propagation condition PC_FLOAT_BND, then p is propagated when a domain update operation on x returns the modification events ME_FLOAT_VAL or ME_FLOAT_BND.

Definition at line 292 of file var-type.hpp.