Scale integer view (template) More...
#include <view.hpp>
Protected Attributes | |
int | a |
Scale factor. More... | |
![]() | |
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 ![]() | |
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 | |
![]() | |
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... | |
![]() | |
VarImpType * | varimp (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 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... | |
![]() | |
DerivedView (void) | |
Default constructor. More... | |
DerivedView (const IntView &y) | |
Initialize with view y. More... | |
Scale integer view (template)
A scale integer view for an integer view
and a non-negative integer
provides operations such that
behaves as
.
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:
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
related |
|
related |
|
protected |