Go to the documentation of this file.
44 namespace Gecode {
namespace Int {
81 namespace Gecode {
namespace Int {
128 unsigned int width(
void)
const;
171 static void*
operator new(
size_t s,
Space& home);
173 static void*
operator new(
size_t s,
void*
p);
175 static void operator delete(
void*);
177 static void operator delete(
void*,
Space&);
179 static void operator delete(
void*,
void*);
225 unsigned int size(
void)
const;
227 unsigned int width(
void)
const;
241 bool range(
void)
const;
247 bool in(
int n)
const;
249 bool in(
long long int n)
const;
263 bool closer_min(
int b)
const;
424 unsigned int width(
void)
const;
467 unsigned int width(
void)
const;
481 namespace Gecode {
namespace Int {
492 friend class ::Gecode::BoolVar;
518 static const int BITS = 2;
542 unsigned int size(
void)
const;
544 unsigned int width(
void)
const;
553 bool zero(
void)
const;
556 bool one(
void)
const;
558 bool none(
void)
const;
563 bool range(
void)
const;
569 bool in(
int n)
const;
571 bool in(
long long int n)
const;
BoolStatus status(void) const
Return current domain status.
static const int BITS
How many bits does the status have.
static const BoolStatus NONE
Status of domain not yet assigned.
int max(void) const
Return maximum.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
Post propagator for SetVar x
Base-class for Bool-variable implementations.
bool in(int n) const
Test whether n is contained in domain.
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
RangeList * lst(void) const
Return last element of rangelist.
int min(void) const
Return minimum of domain.
void dispose(Space &home, RangeList *p, RangeList *l)
Free memory for all elements between this and l (inclusive)
RangeList(void)
Default constructor (noop)
void fix(RangeList *n)
Restore simple link to next element (so that it becomes a true free list)
bool one(void) const
Test whether variable is assigned to one.
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
void prevnext(RangeList *p, RangeList *n)
Set previous element to p and next element to n.
ModEvent fail(Space &home)
Run advisors to be run on failure and returns ME_GEN_FAILED.
bool range(void) const
Test whether domain is a range.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
Range iterator for ranges of integer variable implementation.
Backward iterator for ranges of integer variable implementations.
bool operator()(void) const
Test whether iterator is still at a range or done.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int min(void) const
Return smallest value of range.
bool zero(void) const
Test whether variable is assigned to zero.
const RangeList * ranges_fwd(void) const
Return range list for forward iteration.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
ModEvent minus_v(Space &home, I &i, bool depends=true)
Remove from domain the values described by i.
const FloatNum min
Smallest allowed float value.
IntDelta(void)
Create integer delta as providing no information.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p to variable with propagation condition pc.
ModEvent minus_r(Space &home, I &i, bool depends=true)
Remove from domain the ranges described by i.
const RangeList * ranges_bwd(void) const
Return range list for backward iteration.
RangeList * _lst
Link the last element.
static const BoolStatus ONE
Status of domain assigned to one.
IntVarImpFwd(void)
Default constructor.
bool assigned(void) const
Test whether variable is assigned.
bool assigned(void) const
Test whether variable is assigned.
ModEvent zero_none(Space &home)
Assign unassigned variable to zero.
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
unsigned int BoolStatus
Type for status of a Boolean variable.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to variable.
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value)
int _max
Maximum of range.
Integer variable implementation.
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
int med(void) const
Return median of domain (greatest element not greater than the median)
int val(void) const
Return assigned value (only if assigned)
bool range(void) const
Test whether domain is a range.
bool in(int n) const
Test whether n is contained in domain.
Gecode toplevel namespace
void init(const IntVarImp *x)
Initialize with ranges from variable implementation x.
RangeList * fst(void) const
Return first element of rangelist.
Base-class for propagators.
RangeList * prev(const RangeList *n) const
Return previous element (from next n)
void operator++(void)
Move iterator to previous range (if possible)
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value)
Base-class for Int-variable implementations.
int max(void) const
Return maximum of domain.
IntVarImpBwd(void)
Default constructor.
Generic domain change information to be supplied to advisors.
IntVarImp * copy(Space &home, bool share)
Return copy of this variable.
#define GECODE_INT_EXPORT
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
FreeList * next(void) const
Return next freelist object.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value)
Boolean variable implementation.
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
static ModEvent modevent(const Delta &d)
Return modification event.
ModEvent inter_r(Space &home, I &i, bool depends=true)
Intersect domain with ranges described by i.
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
unsigned int size(void) const
Return size (cardinality) of domain.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
unsigned int holes
Size of holes in the domain.
int max(void) const
Return largest value of range.
static void schedule(Gecode::Space &home, Gecode::Propagator &p, Gecode::ModEvent me)
Schedule propagator p.
void reschedule(Space &home, Propagator &p, PropCond pc)
Re-schedule propagator p.
ModEvent inter_r(Space &home, I &i, bool depends=true)
Intersect domain with ranges described by i.
int ModEvent
Type for modification events.
RangeList dom
Domain information.
Base-class for freelist-managed objects.
ModEvent narrow_v(Space &home, I &i, bool depends=true)
Replace domain by values described by i.
bool any(const View &x)
Test whether x is neither positive nor negative.
int PropCond
Type for propagation conditions.
int max(void) const
Return largest value of range.
unsigned int size(void) const
Return size (cardinality) of domain.
unsigned int width(void) const
Return width (distance between maximum and minimum)
static bool any(const Delta &d)
Test whether arbitrary values got pruned.
ModEvent narrow_r(Space &home, I &i, bool depends=true)
Replace domain by ranges described by i.
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.
ModEvent minus_r(Space &home, I &i, bool depends=true)
Remove from domain the ranges described by i.
int _min
Minimum of range.
Integer delta information for advisors.
void operator++(void)
Move iterator to next range (if possible)
static ModEvent me(const ModEventDelta &med)
Project modification event for this variable type from med.
static const BoolStatus ZERO
Status of domain assigned to zero.
IntVarImp(Space &home, bool share, IntVarImp &x)
Constructor for cloning x.
ModEvent inter_v(Space &home, I &i, bool depends=true)
Intersect domain with values described by i.
void reschedule(Space &home, Propagator &p, PropCond pc)
Re-schedule propagator p.
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 init(const IntVarImp *x)
Initialize with ranges from variable implementation x.
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)
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
int n
Number of negative literals for node type.
int min(void) const
Return minimum of domain.
int ModEventDelta
Modification event deltas.
bool none(void) const
Test whether variable is not yet assigned.
int min(void) const
Return minimum.
ModEvent one_none(Space &home)
Assign unassigned variable to one.
static bool any(const Delta &d)
Test whether arbitrary values got pruned.
ModEvent narrow_r(Space &home, I &i, bool depends=true)
Replace domain by ranges described by i.
int min(void) const
Return smallest value of range.
Lists of ranges (intervals)
int p
Number of positive literals for node type.
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
bool operator()(void) const
Test whether iterator is still at a range or done.
int max(void) const
Return maximum of domain.
const FloatNum max
Largest allowed float value.
ModEvent nq(Space &home, int n)
Restrict domain values to be different from n.
BoolVarImp * copy(Space &home, bool share)
Return copy of this variable.