Gecode::Float::OffsetView Class Reference
Functionality by programming task » Programming actors » Programming float actors » Float views

OffsetView float view. More...

`#include <view.hpp>`

## Protected Attributes

FloatNum | c
| Offset.
Protected Attributes inherited from Gecode::DerivedView< FloatView >
FloatView | x
| View from which this view is derived.

## Constructors and initialization

| OffsetView (void)
| Default constructor.
| OffsetView (const FloatView &y, FloatNum c)
| Initialize with float view y and an offset c.

## Value access

FloatNum | offset (void) const
| Return offset.
void | offset (FloatNum n)
| Change offset to be n.
FloatVal | domain (void) const
| Return domain.
FloatNum | min (void) const
| Return minimum of domain.
FloatNum | max (void) const
| Return maximum of domain.
FloatNum | med (void) const
| Return median of domain (closest representation).
FloatVal | val (void) const
| Return assigned value.
FloatNum | size (void) const
| Return size of domain (distance between maximum and minimum).

## Domain tests

bool | zero_in (void) const
| Test whether 0 is contained in domain.
bool | in (FloatNum n) const
| Test whether n is contained in domain.
bool | in (const FloatVal &n) const
| Test whether n is contained in domain.

## Domain update by value

ModEvent | lq (Space &home, int n)
| Restrict domain values to be less or equal than n.
ModEvent | lq (Space &home, FloatNum n)
| Restrict domain values to be less or equal than n.
ModEvent | lq (Space &home, FloatVal n)
| Restrict domain values to be less or equal than n.
ModEvent | gq (Space &home, int n)
| Restrict domain values to be greater or equal than n.
ModEvent | gq (Space &home, FloatNum n)
| Restrict domain values to be greater or equal than n.
ModEvent | gq (Space &home, FloatVal n)
| Restrict domain values to be greater or equal than n.
ModEvent | eq (Space &home, int n)
| Restrict domain values to be equal to n.
ModEvent | eq (Space &home, FloatNum n)
| Restrict domain values to be equal to n.
ModEvent | eq (Space &home, const FloatVal &n)
| Restrict domain values to be equal to n.

## Delta information for advisors

FloatNum | min (const Delta &d) const
| Return minimum value just pruned.
FloatNum | max (const Delta &d) const
| Return maximum value just pruned.

## Cloning

void | update (Space &home, OffsetView &y)

## Ordering

bool | operator< (const OffsetView &y) const
| Whether this view comes before view y (arbitray order).

## View-dependent propagator support

static ModEventDelta | med (ModEvent me)
| Translate modification event me to modification event delta for view.

## View comparison

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.

## Additional Inherited Members

Public Types inherited from Gecode::DerivedView< FloatView >
typedef FloatView::VarImpType | VarImpType
| The variable implementation type belonging to the View.
typedef FloatView::VarType | VarType
| The variable type belonging to the View.
VarImpType * | varimp (void) const
| Return variable implementation of view.
FloatView | base (void) const
| Return view from which this view is derived.
unsigned int | degree (void) const
| Return degree (number of subscribed propagators).
double | afc (void) const
| Return accumulated failure count.
bool | assigned (void) const
| Test whether view is assigned.
void | subscribe (Space &home, Propagator &p, PropCond pc, bool schedule=true)
| Subscribe propagator p with propagation condition pc to view.
void | cancel (Space &home, Propagator &p, PropCond pc)
| Cancel subscription of propagator p with propagation condition pc to view.
void | reschedule (Space &home, Propagator &p, PropCond pc)
| Re-schedule propagator p with propagation condition pc.
void | update (Space &home, DerivedView< FloatView > &y)
| Update this view to be a clone of view y.
bool | operator< (const DerivedView< FloatView > &y) const
| Whether this view comes before view y (arbitray order).
static bool | varderived (void)
| Return whether this view is derived from a VarImpView.
static void | schedule (Space &home, Propagator &p, ModEvent me)
| Schedule propagator p with modification event me.
static ModEvent | me (const ModEventDelta &med)
| Return modification event for view type in med.
static ModEventDelta | med (ModEvent)
| Translate modification event me to modification event delta for view.
static ModEvent | modevent (const Delta &d)
| Return modification event.
Protected Member Functions inherited from Gecode::DerivedView< FloatView >
| DerivedView (void)
| Default constructor.

## Detailed Description

OffsetView float view.

An offset float view for an float view and an float provides operations such that behaves as .

Definition at line 266 of file view.hpp.

## Constructor & Destructor Documentation

## OffsetView() [1/2]

Gecode::Float::OffsetView::OffsetView | ( | void |  | ) |

inline

Default constructor.

Definition at line 43 of file offset.hpp.

## OffsetView() [2/2]

Gecode::Float::OffsetView::OffsetView | ( | const FloatView & | y,
|  | FloatNum | c )

inline explicit

Initialize with float view y and an offset c.

Definition at line 45 of file offset.hpp.

## Member Function Documentation

## offset() [1/2]

FloatNum Gecode::Float::OffsetView::offset | ( | void |  | ) | const

inline

Return offset.

Definition at line 54 of file offset.hpp.

## offset() [2/2]

void Gecode::Float::OffsetView::offset | ( | FloatNum | n | ) |

inline

Change offset to be n.

Definition at line 58 of file offset.hpp.

## domain()

FloatVal Gecode::Float::OffsetView::domain | ( | void |  | ) | const

inline

Return domain.

Definition at line 62 of file offset.hpp.

## min() [1/2]

FloatNum Gecode::Float::OffsetView::min | ( | void |  | ) | const

inline

Return minimum of domain.

Definition at line 66 of file offset.hpp.

## max() [1/2]

FloatNum Gecode::Float::OffsetView::max | ( | void |  | ) | const

inline

Return maximum of domain.

Definition at line 70 of file offset.hpp.

## med() [1/2]

FloatNum Gecode::Float::OffsetView::med | ( | void |  | ) | const

inline

Return median of domain (closest representation).

Definition at line 74 of file offset.hpp.

## val()

FloatVal Gecode::Float::OffsetView::val | ( | void |  | ) | const

inline

Return assigned value.

Throws an exception of type Float::ValOfUnassignedVar if variable is not yet assigned.

Definition at line 78 of file offset.hpp.

## size()

FloatNum Gecode::Float::OffsetView::size | ( | void |  | ) | const

inline

Return size of domain (distance between maximum and minimum).

Definition at line 83 of file offset.hpp.

## zero_in()

bool Gecode::Float::OffsetView::zero_in | ( | void |  | ) | const

inline

Test whether 0 is contained in domain.

Definition at line 93 of file offset.hpp.

## in() [1/2]

bool Gecode::Float::OffsetView::in | ( | FloatNum | n | ) | const

inline

Test whether n is contained in domain.

Definition at line 97 of file offset.hpp.

## in() [2/2]

bool Gecode::Float::OffsetView::in | ( | const FloatVal & | n | ) | const

inline

Test whether n is contained in domain.

Definition at line 101 of file offset.hpp.

## lq() [1/3]

ModEvent Gecode::Float::OffsetView::lq | ( | Space & | home,
|  | int | n )

inline

Restrict domain values to be less or equal than n.

Definition at line 111 of file offset.hpp.

## lq() [2/3]

ModEvent Gecode::Float::OffsetView::lq | ( | Space & | home,
|  | FloatNum | n )

inline

Restrict domain values to be less or equal than n.

Definition at line 115 of file offset.hpp.

## lq() [3/3]

ModEvent Gecode::Float::OffsetView::lq | ( | Space & | home,
|  | FloatVal | n )

inline

Restrict domain values to be less or equal than n.

Definition at line 119 of file offset.hpp.

## gq() [1/3]

ModEvent Gecode::Float::OffsetView::gq | ( | Space & | home,
|  | int | n )

inline

Restrict domain values to be greater or equal than n.

Definition at line 124 of file offset.hpp.

## gq() [2/3]

ModEvent Gecode::Float::OffsetView::gq | ( | Space & | home,
|  | FloatNum | n )

inline

Restrict domain values to be greater or equal than n.

Definition at line 128 of file offset.hpp.

## gq() [3/3]

ModEvent Gecode::Float::OffsetView::gq | ( | Space & | home,
|  | FloatVal | n )

inline

Restrict domain values to be greater or equal than n.

Definition at line 132 of file offset.hpp.

## eq() [1/3]

ModEvent Gecode::Float::OffsetView::eq | ( | Space & | home,
|  | int | n )

inline

Restrict domain values to be equal to n.

Definition at line 137 of file offset.hpp.

## eq() [2/3]

ModEvent Gecode::Float::OffsetView::eq | ( | Space & | home,
|  | FloatNum | n )

inline

Restrict domain values to be equal to n.

Definition at line 141 of file offset.hpp.

## eq() [3/3]

ModEvent Gecode::Float::OffsetView::eq | ( | Space & | home,
|  | const FloatVal & | n )

inline

Restrict domain values to be equal to n.

Definition at line 145 of file offset.hpp.

## min() [2/2]

FloatNum Gecode::Float::OffsetView::min | ( | const Delta & | d | ) | const

inline

Return minimum value just pruned.

Definition at line 155 of file offset.hpp.

## max() [2/2]

FloatNum Gecode::Float::OffsetView::max | ( | const Delta & | d | ) | const

inline

Return maximum value just pruned.

Definition at line 159 of file offset.hpp.

## med() [2/2]

ModEventDelta Gecode::Float::OffsetView::med | ( | ModEvent | me | ) |

inline static

Translate modification event me to modification event delta for view.

Definition at line 164 of file offset.hpp.

## update()

void Gecode::Float::OffsetView::update | ( | Space & | home,
|  | OffsetView & | y )

inline

Definition at line 174 of file offset.hpp.

## operator<()

bool Gecode::Float::OffsetView::operator< | ( | const OffsetView & | y | ) | const

inline

Whether this view comes before view y (arbitray order).

Definition at line 183 of file offset.hpp.

## Friends And Related Symbol Documentation

## operator<<()

template<class Char, class Traits>

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

related

Print float offset view.

Definition at line 45 of file print.hpp.

## operator==()

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

related

Test whether views x and y are the same.

Definition at line 195 of file offset.hpp.

## operator!=()

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

related

Test whether views x and y are not the same.

Definition at line 199 of file offset.hpp.

## Member Data Documentation

## c

FloatNum Gecode::Float::OffsetView::c

protected

Offset.

Definition at line 269 of file view.hpp.

The documentation for this class was generated from the following files:

- gecode/float/view.hpp
- gecode/float/view/offset.hpp