111namespace Gecode {
namespace Int {
155 int baseval(
int val)
const;
159 unsigned int size(
void)
const;
161 unsigned int width(
void)
const;
171 bool range(
void)
const;
174 bool in(
int n)
const;
176 bool in(
long long int n)
const;
270 template<
class Char,
class Traits>
271 std::basic_ostream<Char,Traits>&
306 int baseval(
int val)
const;
310 unsigned int size(
void)
const;
312 unsigned int width(
void)
const;
322 bool range(
void)
const;
325 bool in(
int n)
const;
327 bool in(
long long int n)
const;
421 template<
class Char,
class Traits>
422 std::basic_ostream<Char,Traits>&
473 int baseval(
int val)
const;
477 unsigned int size(
void)
const;
479 unsigned int width(
void)
const;
489 bool range(
void)
const;
492 bool in(
int n)
const;
494 bool in(
long long int n)
const;
600 template<
class Char,
class Traits>
601 std::basic_ostream<Char,Traits>&
703 template<
class Val,
class UnsVal>
816 template<
class Char,
class Traits>
817 std::basic_ostream<Char,Traits>&
824 template<
class Char,
class Traits>
825 std::basic_ostream<Char,Traits>&
832 template<
class Val,
class UnsVal>
837 template<
class Val,
class UnsVal>
875 unsigned int size(
void)
const;
877 unsigned int width(
void)
const;
887 bool range(
void)
const;
889 bool in(
int n)
const;
891 bool in(
long long int n)
const;
991 template<
class Char,
class Traits>
992 std::basic_ostream<Char,Traits>&
1024 int min(
void)
const;
1026 int max(
void)
const;
1028 int med(
void)
const;
1030 int val(
void)
const;
1033 unsigned int size(
void)
const;
1035 unsigned int width(
void)
const;
1045 bool range(
void)
const;
1047 bool in(
int n)
const;
1049 bool in(
long long int n)
const;
1137 template<
class Char,
class Traits>
1138 std::basic_ostream<Char,Traits>&
1163 template<
class View>
1186 int min(
void)
const;
1188 int max(
void)
const;
1190 int med(
void)
const;
1192 int val(
void)
const;
1193#ifdef GECODE_HAS_CBS
1195 int baseval(
int val)
const;
1199 unsigned int size(
void)
const;
1201 unsigned int width(
void)
const;
1211 bool range(
void)
const;
1214 bool in(
int n)
const;
1216 bool in(
long long int n)
const;
1326 template<
class Char,
class Traits,
class View>
1327 std::basic_ostream<Char,Traits>&
1334 template<
class View>
1338 template<
class View>
1350 template<
class View>
1409 int min(
void)
const;
1411 int max(
void)
const;
1413 int med(
void)
const;
1415 int val(
void)
const;
1416#ifdef GECODE_HAS_CBS
1418 int baseval(
int val)
const;
1422 unsigned int size(
void)
const;
1424 unsigned int width(
void)
const;
1434 bool range(
void)
const;
1436 bool in(
int n)
const;
1438 bool in(
long long int n)
const;
1444 bool zero(
void)
const;
1446 bool one(
void)
const;
1448 bool none(
void)
const;
1558 template<
class Char,
class Traits>
1559 std::basic_ostream<Char,Traits>&
1601 bool zero(
void)
const;
1603 bool one(
void)
const;
1605 bool none(
void)
const;
1656 int min(
void)
const;
1658 int max(
void)
const;
1660 int val(
void)
const;
1661#ifdef GECODE_HAS_CBS
1663 int baseval(
int val)
const;
1698 template<
class Char,
class Traits>
1699 std::basic_ostream<Char,Traits>&
1723namespace Gecode {
namespace Int {
Boolean integer variables.
Base-class for constant views.
Generic domain change information to be supplied to advisors.
static ModEvent me(const ModEventDelta &med)
Boolean variable implementation.
static const int BITS
How many bits does the status have.
static const BoolStatus NONE
Status of domain not yet assigned.
static const BoolStatus ZERO
Status of domain assigned to zero.
static const BoolStatus ONE
Status of domain assigned to one.
Boolean view for Boolean variables.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
bool in(int n) const
Test whether n is contained in domain.
BoolView(void)
Default constructor.
int max(void) const
Return maximum of domain.
bool any(const Delta &d) const
Test whether arbitrary values got pruned.
static const BoolStatus NONE
Status of domain not yet assigned.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
static const BoolStatus ONE
Status of domain assigned to one.
ModEvent narrow_r(Space &home, I &i, bool depends=true)
Replace domain by ranges described by i.
int min(void) const
Return minimum of domain.
ModEvent inter_r(Space &home, I &i, bool depends=true)
Intersect domain with ranges described by i.
bool range(void) const
Test whether domain is a range.
ModEvent zero_none(Space &home)
Assign not yet assigned view to zero.
unsigned int size(void) const
Return size (cardinality) of domain.
ModEvent narrow_v(Space &home, I &i, bool depends=true)
Replace domain by values described by i.
bool none(void) const
Test whether view is not yet assigned.
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
ModEvent le(Space &home, int n)
Restrict domain values to be less than n.
BoolStatus status(void) const
Return current domain status.
bool zero(void) const
Test whether view is assigned to be zero.
ModEvent one_none(Space &home)
Assign not yet assigned view to one.
ModEvent gr(Space &home, int n)
Restrict domain values to be greater than n.
static const int BITS
How many bits does the status have.
int med(void) const
Return median of domain (greatest element not greater than the median).
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
bool one(void) const
Test whether view is assigned to be one.
ModEvent minus_r(Space &home, I &i, bool depends=true)
Remove from domain the ranges described by i.
int val(void) const
Return assigned value (only if assigned).
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value).
static const BoolStatus ZERO
Status of domain assigned to zero.
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum).
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
unsigned int size(void) const
Return size (cardinality) of domain.
bool any(const Delta &d) const
Test whether arbitrary values got pruned.
ModEvent le(Space &home, int n)
Restrict domain values to be less than n.
int med(void) const
Return median of domain (greatest element not greater than the median).
unsigned int width(void) const
Return width of domain (distance between maximum and minimum).
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
ModEvent narrow_r(Space &home, I &i, bool depends=true)
Replace domain by ranges described by i.
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
RangeList * _firstRange
First cached range.
RangeList * _lastRange
Last cached range.
ModEvent minus_r(Space &home, I &i, bool depends=true)
Remove from domain the ranges described by i.
bool in(int n) const
Test whether n is contained in domain.
void initCache(Space &home, const IntSet &s)
Initialize cache to set s.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
ModEvent narrow_v(Space &home, I &i, bool depends=true)
Replace domain by values described by i.
unsigned int _size
Size of cached domain.
bool range(void) const
Test whether domain is a range.
int val(void) const
Return assigned value (only if assigned).
void cache(Space &home)
Update cache to current domain.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
ModEvent inter_r(Space &home, I &i, bool depends=true)
Intersect domain with ranges described by i.
ModEvent gr(Space &home, int n)
Restrict domain values to be greater than n.
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value).
int min(void) const
Return minimum of domain.
void update(Space &home, CachedView< View > &y)
Update this view to be a clone of view y.
bool modified(void) const
Check whether cache differs from current domain.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
int max(void) const
Return maximum of domain.
CachedView(void)
Default constructor.
ModEvent narrow_r(Space &home, I &i, bool depends=true)
Replace domain by ranges described by i.
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
bool range(void) const
Test whether domain is a range.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
ModEvent gr(Space &home, int n)
Restrict domain values to be greater than n.
ModEvent inter_r(Space &home, I &i, bool depends=true)
Intersect domain with ranges described by i.
bool operator<(const ConstIntView &y) const
Whether this view comes before view y (arbitrary order).
ModEvent minus_r(Space &home, I &i, bool depends=true)
Remove from domain the ranges described by i.
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value).
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
bool in(int n) const
Test whether n is contained in domain.
unsigned int size(void) const
Return size (cardinality) of domain.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
int min(void) const
Return minimum of domain.
int max(void) const
Return maximum of domain.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum).
void update(Space &home, ConstIntView &y)
Update this view to be a clone of view y.
ModEvent le(Space &home, int n)
Restrict domain values to be less than n.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
ModEvent narrow_v(Space &home, I &i, bool depends=true)
Replace domain by values described by i.
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
ConstIntView(void)
Default constructor.
int val(void) const
Return assigned value (only if assigned).
int med(void) const
Return median of domain (greatest element not greater than the median).
bool any(const Delta &d) const
Test whether arbitrary values got pruned.
Integer variable implementation.
Integer view for integer variables.
unsigned int size(void) const
Return size (cardinality) of domain.
ModEvent inter_r(Space &home, I &i, bool depends=true)
Intersect domain with ranges described by i.
int min(void) const
Return minimum of domain.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum).
bool range(void) const
Test whether domain is a range.
ModEvent gr(Space &home, int n)
Restrict domain values to be greater than n.
ModEvent narrow_v(Space &home, I &i, bool depends=true)
Replace domain by values described by i.
bool in(int n) const
Test whether n is contained in domain.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
int med(void) const
Return median of domain (greatest element not greater than the median).
ModEvent le(Space &home, int n)
Restrict domain values to be less than n.
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
IntView(void)
Default constructor.
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value).
ModEvent minus_r(Space &home, I &i, bool depends=true)
Remove from domain the ranges described by i.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
int val(void) const
Return assigned value (only if assigned).
bool any(const Delta &d) const
Test whether arbitrary values got pruned.
int max(void) const
Return maximum of domain.
ModEvent narrow_r(Space &home, I &i, bool depends=true)
Replace domain by ranges described by i.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
ModEvent narrow_v(Space &home, I &i, bool depends=true)
Replace domain by values described by i.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
ModEvent le(Space &home, int n)
Restrict domain values to be less than n.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum).
ModEvent gr(Space &home, int n)
Restrict domain values to be greater than n.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value).
ModEvent minus_r(Space &home, I &i, bool depends=true)
Remove from domain the ranges described by i.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
int max(void) const
Return maximum of domain.
int min(void) const
Return minimum of domain.
ModEvent inter_r(Space &home, I &i, bool depends=true)
Intersect domain with ranges described by i.
bool in(int n) const
Test whether n is contained in domain.
bool range(void) const
Test whether domain is a range.
unsigned int size(void) const
Return size (cardinality) of domain.
ModEvent narrow_r(Space &home, I &i, bool depends=true)
Replace domain by ranges described by i.
bool any(const Delta &d) const
Test whether arbitrary values got pruned.
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
MinusView(void)
Default constructor.
int med(void) const
Return median of domain.
int val(void) const
Return assigned value (only if assigned).
ModEvent gr(Space &home, int n)
Restrict domain values to be greater than n.
BoolStatus status(void) const
Return current domain status.
bool zero(void) const
Test whether view is assigned to be zero.
bool one(void) const
Test whether view is assigned to be one.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
bool none(void) const
Test whether view is not yet assigned.
ModEvent le(Space &home, int n)
Restrict domain values to be less than n.
unsigned int width(const Delta &d) const
Return width of values just pruned.
ModEvent one_none(Space &home)
Assign not yet assigned view to one.
bool any(const Delta &d) const
Test whether arbitrary values got pruned.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
static const BoolStatus ONE
Status of domain assigned to one.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
int max(void) const
Return maximum of domain.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
int min(void) const
Return minimum of domain.
static const BoolStatus NONE
Status of domain not yet assigned.
ModEvent zero_none(Space &home)
Assign not yet assigned view to zero.
NegBoolView(void)
Default constructor.
int val(void) const
Return assigned value (only if assigned).
static const int BITS
How many bits does the status have.
static const BoolStatus ZERO
Status of domain assigned to zero.
Converter without offsets.
View ViewType
The view type.
void update(const NoOffset &)
Update during cloning.
int offset(void) const
Access offset.
View & operator()(View &x)
Pass through x.
int min(void) const
Return minimum of domain.
ModEvent gr(Space &home, int n)
Restrict domain values to be greater than n.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
int val(void) const
Return assigned value (only if assigned).
void update(Space &home, OffsetView &y)
Update this view to be a clone of view y.
ModEvent inter_r(Space &home, I &i, bool depends=true)
Intersect domain with ranges described by i.
int med(void) const
Return median of domain (greatest element not greater than the median).
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value).
ModEvent narrow_v(Space &home, I &i, bool depends=true)
Replace domain by values described by i.
unsigned int size(void) const
Return size (cardinality) of domain.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
int offset(void) const
Return offset.
int max(void) const
Return maximum of domain.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum).
bool any(const Delta &d) const
Test whether arbitrary values got pruned.
OffsetView(void)
Default constructor.
bool in(int n) const
Test whether n is contained in domain.
bool operator<(const OffsetView &y) const
Whether this view comes before view y (arbitrary order).
ModEvent minus_r(Space &home, I &i, bool depends=true)
Remove from domain the ranges described by i.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
ModEvent le(Space &home, int n)
Restrict domain values to be less than n.
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
bool range(void) const
Test whether domain is a range.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
ModEvent narrow_r(Space &home, I &i, bool depends=true)
Replace domain by ranges described by i.
Offset(int off=0)
Constructor with offset off.
OffsetView ViewType
The view type.
void update(const Offset &o)
Update during cloning.
OffsetView operator()(IntView &x)
Return OffsetRefView for x.
int offset(void) const
Access offset.
Scale integer view (template).
Val val(void) const
Return assigned value (only if assigned).
ModEvent gq(Space &home, Val n)
Restrict domain values to be greater or equal than n.
Val min(const Delta &d) const
Return minimum value just pruned.
int scale(void) const
Return scale factor of scale view.
bool in(Val n) const
Test whether n is contained in domain.
bool range(void) const
Test whether domain is a range.
void update(Space &home, ScaleView< Val, UnsVal > &y)
Update this view to be a clone of view y.
bool any(const Delta &d) const
Test whether arbitrary values got pruned.
ModEvent le(Space &home, Val n)
Restrict domain values to be less than n.
UnsVal width(const Delta &d) const
Return width of values just pruned.
static ModEventDelta med(ModEvent me)
Translate modification event me to modification event delta for view.
UnsVal regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
UnsVal width(void) const
Return width of domain (distance between maximum and minimum).
Val max(void) const
Return maximum of domain.
Val med(void) const
Return median of domain (greatest element not greater than the median).
ModEvent gr(Space &home, Val n)
Restrict domain values to be greater than n.
bool operator<(const ScaleView< Val, UnsVal > &y) const
Whether this view comes before view y (arbitrary order).
Val min(void) const
Return minimum of domain.
ModEvent eq(Space &home, Val n)
Restrict domain values to be equal to n.
ScaleView(int b, const IntView &y)
Initialize as .
ModEvent nq(Space &home, Val n)
Restrict domain values to be different from n.
UnsVal regret_min(void) const
Return regret of domain minimum (distance to next larger value).
ModEvent lq(Space &home, Val n)
Restrict domain values to be less or equal than n.
UnsVal size(void) const
Return size (cardinality) of domain.
Val max(const Delta &d) const
Return maximum value just pruned.
ScaleView(void)
Default constructor.
Range iterator for cached integer views
void init(const CachedView< View > &x)
Initialize with ranges for view x.
ViewRanges< View > dr
Current domain iterator.
Iter::Ranges::RangeList cr
Cached domain iterator.
ViewDiffRanges(void)
Default constructor.
Range iterator for integer views.
ViewRanges(const View &x)
Initialize with ranges for view x.
int max(void) const
Return largest value of range.
bool operator()(void) const
Test whether iterator is still at a range or done.
int min(void) const
Return smallest value of range.
void init(const View &x)
Initialize with ranges for view x.
unsigned int width(void) const
Return width of range (distance between minimum and maximum).
void operator++(void)
Move iterator to next range (if possible).
ViewRanges(void)
Default constructor.
void init(const View &x)
Initialize with values x.
ViewValues(void)
Default constructor.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
ZeroIntView(void)
Default constructor.
int med(void) const
Return median of domain (greatest element not greater than the median).
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value).
ModEvent minus_r(Space &home, I &i, bool depends=true)
Remove from domain the ranges described by i.
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
int max(void) const
Return maximum of domain.
ModEvent narrow_r(Space &home, I &i, bool depends=true)
Replace domain by ranges described by i.
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
bool any(const Delta &d) const
Test whether arbitrary values got pruned.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value).
bool range(void) const
Test whether domain is a range.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
ModEvent inter_r(Space &home, I &i, bool depends=true)
Intersect domain with ranges described by i.
ModEvent narrow_v(Space &home, I &i, bool depends=true)
Replace domain by values described by i.
ModEvent gr(Space &home, int n)
Restrict domain values to be greater than n.
ModEvent le(Space &home, int n)
Restrict domain values to be less than n.
int val(void) const
Return assigned value (only if assigned).
unsigned int size(void) const
Return size (cardinality) of domain.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum).
bool in(int n) const
Test whether n is contained in domain.
int min(void) const
Return minimum of domain.
Range iterator for computing set difference.
Range iterator for range lists
Value iterator from range iterator.
Lists of ranges (intervals).
static ModEvent me(const ModEventDelta &med)
ScaleView< long long int, unsigned long long int > LLongScaleView
Long long-precision integer scale view.
ScaleView< int, unsigned int > IntScaleView
Integer-precision integer scale view.
int ModEventDelta
Modification event deltas.
RelTest rtest_eq_dom(VX x, VY y)
Test whether views x and y are equal (use full domain information).
RelTest rtest_nq_dom(VX x, VY y)
Test whether views x and y are different (use full domain information).
RelTest rtest_eq_bnd(VX x, VY y)
Test whether views x and y are equal (use bounds information).
RelTest rtest_lq(VX x, VY y)
Test whether view x is less or equal than view y.
RelTest rtest_le(VX x, VY y)
Test whether view x is less than view y.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const IdxViewArray< View > &x)
bool operator==(const CachedView< View > &x, const CachedView< View > &y)
BoolTest bool_test(const BoolView &b0, const BoolView &b1)
unsigned int BoolStatus
Type for status of a Boolean variable.
bool operator!=(const CachedView< View > &x, const CachedView< View > &y)
RelTest
Result of testing relation.
@ RT_TRUE
Relation does hold.
@ RT_MAYBE
Relation may hold or not.
@ RT_FALSE
Relation does not hold.
RelTest rtest_nq_bnd(VX x, VY y)
Test whether views x and y are different (use bounds information).
@ BT_COMP
Same variable but complement.
RelTest rtest_gr(VX x, VY y)
Test whether view x is greater than view y.
RelTest rtest_gq(VX x, VY y)
Test whether view x is greater or equal than view y.
Gecode toplevel namespace
int ModEvent
Type for modification events.