Generated on Thu Apr 11 13:59:57 2019 for Gecode by doxygen 1.6.3

Gecode::Int::ScaleView< Val, UnsVal > Class Template Reference
[Integer views]

Scale integer view (template). More...

#include <view.hpp>

List of all members.

Protected Attributes

int a
 Scale factor.

Related Functions

(Note that these are not member functions.)



template<class Char , class Traits >
std::basic_ostream< Char,
Traits > & 
operator<< (std::basic_ostream< Char, Traits > &os, const IntScaleView &x)
 Print integer-precision integer scale view.

Constructors and initialization



 ScaleView (void)
 Default constructor.
 ScaleView (int b, const IntView &y)
 Initialize as $b\cdot y$.

Value access



int scale (void) const
 Return scale factor of scale view.
Val min (void) const
 Return minimum of domain.
Val max (void) const
 Return maximum of domain.
Val med (void) const
 Return median of domain (greatest element not greater than the median).
Val val (void) const
 Return assigned value (only if assigned).
UnsVal size (void) const
 Return size (cardinality) of domain.
UnsVal width (void) const
 Return width of domain (distance between maximum and minimum).
UnsVal regret_min (void) const
 Return regret of domain minimum (distance to next larger value).
UnsVal regret_max (void) const
 Return regret of domain maximum (distance to next smaller value).

Domain tests



bool range (void) const
 Test whether domain is a range.
bool in (Val n) const
 Test whether n is contained in domain.

Domain update by value



ModEvent lq (Space &home, Val n)
 Restrict domain values to be less or equal than n.
ModEvent le (Space &home, Val n)
 Restrict domain values to be less than n.
ModEvent gq (Space &home, Val n)
 Restrict domain values to be greater or equal than n.
ModEvent gr (Space &home, Val n)
 Restrict domain values to be greater than n.
ModEvent nq (Space &home, Val n)
 Restrict domain values to be different from n.
ModEvent eq (Space &home, Val n)
 Restrict domain values to be equal to n.

Delta information for advisors



Val min (const Delta &d) const
 Return minimum value just pruned.
Val max (const Delta &d) const
 Return maximum value just pruned.
UnsVal width (const Delta &d) const
 Return width of values just pruned.
bool any (const Delta &d) const
 Test whether arbitrary values got pruned.

Cloning



void update (Space &home, ScaleView< Val, UnsVal > &y)
 Update this view to be a clone of view y.

Ordering



bool operator< (const ScaleView< Val, UnsVal > &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 Val , class UnsVal >
bool operator== (const ScaleView< Val, UnsVal > &x, const ScaleView< Val, UnsVal > &y)
 Test whether views x and y are the same.
template<class Val , class UnsVal >
bool operator!= (const ScaleView< Val, UnsVal > &x, const ScaleView< Val, UnsVal > &y)
 Test whether views x and y are not the same.

Detailed Description

template<class Val, class UnsVal>
class Gecode::Int::ScaleView< Val, UnsVal >

Scale integer view (template).

A scale integer view $s$ for an integer view $x$ and a non-negative integer $a$ provides operations such that $s$ behaves as $a\cdot x$.

The precision of a scale integer view is defined by the value types Val and UnsVal. Val can be either int or long long int where UnsVal must be the unsigned variant of Val. The range which is allowed for the two types is defined by the values in Gecode::Limits.

Note that scale integer views currently do not provide operations for updating domains by range iterators.

The template is not to be used directly (as it is very clumsy). Use the following instead:

  • IntScaleView for scale views with integer precision
  • LLongScaleView for scale views with long long precision

Definition at line 704 of file view.hpp.


Constructor & Destructor Documentation

template<class Val , class UnsVal >
Gecode::Int::ScaleView< Val, UnsVal >::ScaleView ( void   )  [inline]

Default constructor.

Definition at line 48 of file scale.hpp.

template<class Val , class UnsVal >
Gecode::Int::ScaleView< Val, UnsVal >::ScaleView ( int  b,
const IntView y 
) [inline]

Initialize as $b\cdot y$.

Definition at line 52 of file scale.hpp.


Member Function Documentation

template<class Val , class UnsVal >
int Gecode::Int::ScaleView< Val, UnsVal >::scale ( void   )  const [inline]

Return scale factor of scale view.

Definition at line 62 of file scale.hpp.

template<class Val , class UnsVal >
Val Gecode::Int::ScaleView< Val, UnsVal >::min ( void   )  const [inline]

Return minimum of domain.

Definition at line 67 of file scale.hpp.

template<class Val , class UnsVal >
Val Gecode::Int::ScaleView< Val, UnsVal >::max ( void   )  const [inline]

Return maximum of domain.

Definition at line 73 of file scale.hpp.

template<class Val , class UnsVal >
Val Gecode::Int::ScaleView< Val, UnsVal >::med ( void   )  const [inline]

Return median of domain (greatest element not greater than the median).

Definition at line 79 of file scale.hpp.

template<class Val , class UnsVal >
Val Gecode::Int::ScaleView< Val, UnsVal >::val ( void   )  const [inline]

Return assigned value (only if assigned).

Definition at line 85 of file scale.hpp.

template<class Val , class UnsVal >
UnsVal Gecode::Int::ScaleView< Val, UnsVal >::size ( void   )  const [inline]

Return size (cardinality) of domain.

Definition at line 98 of file scale.hpp.

template<class Val , class UnsVal >
UnsVal Gecode::Int::ScaleView< Val, UnsVal >::width ( void   )  const [inline]

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

Definition at line 104 of file scale.hpp.

template<class Val , class UnsVal >
UnsVal Gecode::Int::ScaleView< Val, UnsVal >::regret_min ( void   )  const [inline]

Return regret of domain minimum (distance to next larger value).

Definition at line 110 of file scale.hpp.

template<class Val , class UnsVal >
UnsVal Gecode::Int::ScaleView< Val, UnsVal >::regret_max ( void   )  const [inline]

Return regret of domain maximum (distance to next smaller value).

Definition at line 116 of file scale.hpp.

template<class Val , class UnsVal >
bool Gecode::Int::ScaleView< Val, UnsVal >::range ( void   )  const [inline]

Test whether domain is a range.

Definition at line 127 of file scale.hpp.

template<class Val , class UnsVal >
bool Gecode::Int::ScaleView< Val, UnsVal >::in ( Val  n  )  const [inline]

Test whether n is contained in domain.

Definition at line 132 of file scale.hpp.

template<class Val , class UnsVal >
ModEvent Gecode::Int::ScaleView< Val, UnsVal >::lq ( Space home,
Val  n 
) [inline]

Restrict domain values to be less or equal than n.

Definition at line 145 of file scale.hpp.

template<class Val , class UnsVal >
ModEvent Gecode::Int::ScaleView< Val, UnsVal >::le ( Space home,
Val  n 
) [inline]

Restrict domain values to be less than n.

Definition at line 152 of file scale.hpp.

template<class Val , class UnsVal >
ModEvent Gecode::Int::ScaleView< Val, UnsVal >::gq ( Space home,
Val  n 
) [inline]

Restrict domain values to be greater or equal than n.

Definition at line 159 of file scale.hpp.

template<class Val , class UnsVal >
ModEvent Gecode::Int::ScaleView< Val, UnsVal >::gr ( Space home,
Val  n 
) [inline]

Restrict domain values to be greater than n.

Definition at line 165 of file scale.hpp.

template<class Val , class UnsVal >
ModEvent Gecode::Int::ScaleView< Val, UnsVal >::nq ( Space home,
Val  n 
) [inline]

Restrict domain values to be different from n.

Definition at line 172 of file scale.hpp.

template<class Val , class UnsVal >
ModEvent Gecode::Int::ScaleView< Val, UnsVal >::eq ( Space home,
Val  n 
) [inline]

Restrict domain values to be equal to n.

Definition at line 178 of file scale.hpp.

template<class Val , class UnsVal >
ModEventDelta Gecode::Int::ScaleView< Val, UnsVal >::med ( ModEvent  me  )  [inline, static]

Translate modification event me to modification event delta for view.

Reimplemented from Gecode::DerivedView< IntView >.

Definition at line 189 of file scale.hpp.

template<class Val , class UnsVal >
Val Gecode::Int::ScaleView< Val, UnsVal >::min ( const Delta d  )  const [inline]

Return minimum value just pruned.

Definition at line 201 of file scale.hpp.

template<class Val , class UnsVal >
Val Gecode::Int::ScaleView< Val, UnsVal >::max ( const Delta d  )  const [inline]

Return maximum value just pruned.

Definition at line 206 of file scale.hpp.

template<class Val , class UnsVal >
UnsVal Gecode::Int::ScaleView< Val, UnsVal >::width ( const Delta d  )  const [inline]

Return width of values just pruned.

Definition at line 211 of file scale.hpp.

template<class Val , class UnsVal >
bool Gecode::Int::ScaleView< Val, UnsVal >::any ( const Delta d  )  const [inline]

Test whether arbitrary values got pruned.

Definition at line 216 of file scale.hpp.

template<class Val , class UnsVal >
void Gecode::Int::ScaleView< Val, UnsVal >::update ( Space home,
ScaleView< Val, UnsVal > &  y 
) [inline]

Update this view to be a clone of view y.

Definition at line 228 of file scale.hpp.

template<class Val , class UnsVal >
bool Gecode::Int::ScaleView< Val, UnsVal >::operator< ( const ScaleView< Val, UnsVal > &  y  )  const [inline]

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

Definition at line 240 of file scale.hpp.


Friends And Related Function Documentation

template<class Char , class Traits >
std::basic_ostream< Char, Traits > & operator<< ( std::basic_ostream< Char, Traits > &  os,
const IntScaleView< Val, UnsVal > &  x 
) [related]

Print integer-precision integer scale view.

Print long long-precision integer scale view.

Definition at line 120 of file print.hpp.

template<class Val , class UnsVal >
bool operator== ( const ScaleView< Val, UnsVal > &  x,
const ScaleView< Val, UnsVal > &  y 
) [related]

Test whether views x and y are the same.

Definition at line 325 of file scale.hpp.

template<class Val , class UnsVal >
bool operator!= ( const ScaleView< Val, UnsVal > &  x,
const ScaleView< Val, UnsVal > &  y 
) [related]

Test whether views x and y are not the same.

Definition at line 330 of file scale.hpp.


Member Data Documentation

template<class Val, class UnsVal>
int Gecode::Int::ScaleView< Val, UnsVal >::a [protected]

Scale factor.

Definition at line 708 of file view.hpp.


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