Generated on Sat Feb 7 2015 02:01:44 for Gecode by doxygen 1.8.9.1
Gecode::Int::ScaleView< Val, UnsVal > Class Template Reference

Scale integer view (template) More...

#include <view.hpp>

Protected Attributes

int a
 Scale factor. More...
 
- Protected Attributes inherited from Gecode::DerivedView< IntView >
IntView x
 View from which this view is derived. More...
 

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. More...
 
template<class Char , class Traits >
std::basic_ostream< Char, Traits > & operator<< (std::basic_ostream< Char, Traits > &os, const LLongScaleView &x)
 Print long long-precision integer scale view. More...
 

View comparison

template<class Val , class UnsVal >
bool same (const ScaleView< Val, UnsVal > &x, const ScaleView< Val, UnsVal > &y)
 Test whether views x and y are the same. More...
 
template<class Val , class UnsVal >
bool before (const ScaleView< Val, UnsVal > &x, const ScaleView< Val, UnsVal > &y)
 Test whether view x comes before y (arbitrary order) More...
 

Constructors and initialization

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

Value access

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

Domain tests

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

Domain update by value

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

View-dependent propagator support

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

Delta information for advisors

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

Cloning

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

Additional Inherited Members

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

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 671 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 91 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 97 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 103 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 109 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 120 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 125 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 138 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 145 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 152 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 158 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 165 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 171 of file scale.hpp.

template<class Val , class UnsVal >
ModEventDelta Gecode::Int::ScaleView< Val, UnsVal >::med ( ModEvent  me)
inlinestatic

Translate modification event me to modification event delta for view.

Definition at line 182 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 194 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 199 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 204 of file scale.hpp.

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

Update this view to be a clone of view y.

Definition at line 216 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.

Definition at line 119 of file print.hpp.

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

Print long long-precision integer scale view.

Definition at line 124 of file print.hpp.

template<class Val , class UnsVal >
bool same ( const ScaleView< Val, UnsVal > &  x,
const ScaleView< Val, UnsVal > &  y 
)
related

Test whether views x and y are the same.

Definition at line 301 of file scale.hpp.

template<class Val , class UnsVal >
bool before ( const ScaleView< Val, UnsVal > &  x,
const ScaleView< Val, UnsVal > &  y 
)
related

Test whether view x comes before y (arbitrary order)

Definition at line 306 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 675 of file view.hpp.


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