Generated on Sat Feb 7 2015 02:01:51 for Gecode by doxygen 1.8.9.1
Gecode::Set::SetVarImp Class Reference

Finite integer set variable implementation. More...

#include <var-imp.hpp>

Protected Member Functions

 SetVarImp (Space &home, bool share, SetVarImp &x)
 Constructor for cloning x. More...
 
- Protected Member Functions inherited from Gecode::Set::SetVarImpBase
 SetVarImpBase (Gecode::Space &home, bool share, SetVarImpBase &x)
 Constructor for cloning x. More...
 
- Protected Member Functions inherited from Gecode::VarImp< Gecode::Set::SetVarImpConf >
void cancel (Space &home)
 Cancel all subscriptions when variable implementation is assigned. More...
 
bool advise (Space &home, ModEvent me, Delta &d)
 Run advisors when variable implementation has been modified with modification event me and domain change d. More...
 
void schedule (Space &home, PropCond pc1, PropCond pc2, ModEvent me)
 Schedule subscribed propagators. More...
 

Constructors and initialization

 SetVarImp (Space &home)
 Initialize with empty lower and full upper bound. More...
 
 SetVarImp (Space &home, int glbMin, int glbMax, int lubMin, int lubMax, unsigned int cardMin=0, unsigned int cardMax=Limits::card)
 Initialize with given bounds and cardinality. More...
 
 SetVarImp (Space &home, const IntSet &glbD, int lubMin, int lubMax, unsigned int cardMin, unsigned int cardMax)
 Initialize with given bounds and cardinality. More...
 
 SetVarImp (Space &home, int glbMin, int glbMax, const IntSet &lubD, unsigned int cardMin, unsigned int cardMax)
 Initialize with given bounds and cardinality. More...
 
 SetVarImp (Space &home, const IntSet &glbD, const IntSet &lubD, unsigned int cardMin, unsigned int cardMax)
 Initialize with given bounds and cardinality. More...
 

Value access

unsigned int cardMin (void) const
 Return current cardinality minimum. More...
 
unsigned int cardMax (void) const
 Return current cardinality maximum. More...
 
int lubMin (void) const
 Return minimum of the least upper bound. More...
 
int lubMax (void) const
 Return maximum of the least upper bound. More...
 
int lubMinN (unsigned int n) const
 Return n -th smallest element in the least upper bound. More...
 
int glbMin (void) const
 Return minimum of the greatest lower bound. More...
 
int glbMax (void) const
 Return maximum of the greatest lower bound. More...
 
unsigned int glbSize (void) const
 Return the size of the greatest lower bound. More...
 
unsigned int lubSize (void) const
 Return the size of the least upper bound. More...
 

Domain tests

bool assigned (void) const
 Test whether variable is assigned. More...
 
bool knownIn (int n) const
 Test whether n is contained in greatest lower bound. More...
 
bool knownOut (int) const
 Test whether n is not contained in least upper bound. More...
 

Domain update by value

ModEvent include (Space &home, int n)
 Include n in the greatest lower bound. More...
 
ModEvent include (Space &home, int i, int j)
 Include the range $\{i,\dots,j\}$ in the greatest lower bound. More...
 
ModEvent exclude (Space &home, int n)
 Exclude n from the least upper bound. More...
 
ModEvent exclude (Space &home, int i, int j)
 Exclude the range $\{i,\dots,j\}$ from the least upper bound. More...
 
ModEvent intersect (Space &home, int n)
 Exclude everything but n from the least upper bound. More...
 
ModEvent intersect (Space &home, int i, int j)
 Exclude everything but the range $\{i,\dots,j\}$ from the least upper bound. More...
 
ModEvent cardMin (Space &home, unsigned int n)
 Restrict cardinality to be at least n. More...
 
ModEvent cardMax (Space &home, unsigned int n)
 Restrict cardinality to be at most n. More...
 

Domain update by range iterator

template<class I >
ModEvent includeI (Space &home, I &i)
 Include set described by i in the greatest lower bound. More...
 
template<class I >
ModEvent excludeI (Space &home, I &i)
 Exclude set described by i from the least upper bound. More...
 
template<class I >
ModEvent intersectI (Space &home, I &i)
 Exclude everything but set described by i from the least upper bound. More...
 

Dependencies

void subscribe (Space &home, Propagator &p, PropCond pc, bool schedule=true)
 Subscribe propagator p with propagation condition pc to variable. More...
 
void cancel (Space &home, Propagator &p, PropCond pc)
 Cancel subscription of propagator p with propagation condition pc. More...
 
void subscribe (Space &home, Advisor &a)
 Subscribe advisor a to variable. More...
 
void cancel (Space &home, Advisor &a)
 Cancel subscription of advisor a. More...
 

Cloning

SetVarImpcopy (Space &home, bool share)
 Return copy of this variable. More...
 

Delta information for advisors

static int glbMin (const Delta &d)
 Return minimum value just pruned from glb. More...
 
static int glbMax (const Delta &d)
 Return maximum value just pruned from glb. More...
 
static bool glbAny (const Delta &d)
 Test whether arbitrary values got pruned from glb. More...
 
static int lubMin (const Delta &d)
 Return minimum value just pruned from lub. More...
 
static int lubMax (const Delta &d)
 Return maximum value just pruned from lub. More...
 
static bool lubAny (const Delta &d)
 Test whether arbitrary values got pruned from lub. More...
 

Additional Inherited Members

- Public Member Functions inherited from Gecode::Set::SetVarImpBase
 SetVarImpBase (void)
 Constructor for creating static instance of variable. More...
 
 SetVarImpBase (Gecode::Space &home)
 Constructor for creating variable. More...
 
void subscribe (Gecode::Space &home, Gecode::Propagator &p, Gecode::PropCond pc, bool assigned, bool schedule)
 Subscribe propagator p with propagation condition pc. More...
 
void subscribe (Gecode::Space &home, Gecode::Advisor &a, bool assigned)
 Subscribe advisor a if assigned is false. More...
 
Gecode::ModEvent notify (Gecode::Space &home, Gecode::ModEvent me, Gecode::Delta &d)
 Notify that variable implementation has been modified with modification event me and delta information d. More...
 
- Public Member Functions inherited from Gecode::VarImp< Gecode::Set::SetVarImpConf >
 VarImp (Space &home)
 Creation. More...
 
 VarImp (void)
 Creation of static instances. More...
 
VarImpnext (void) const
 Return next copied variable. More...
 
 VarImp (Space &home, bool share, VarImp &x)
 Constructor for cloning. More...
 
bool copied (void) const
 Is variable already copied. More...
 
VarImpforward (void) const
 Use forward pointer if variable already copied. More...
 
void cancel (Space &home, Propagator &p, PropCond pc, bool assigned)
 Cancel subscription of propagator p with propagation condition pc. More...
 
void cancel (Space &home, Advisor &a, bool assigned)
 Cancel subscription of advisor a. More...
 
void subscribe (Space &home, Propagator &p, PropCond pc, bool assigned, ModEvent me, bool schedule)
 Subscribe propagator p with propagation condition pc. More...
 
void subscribe (Space &home, Advisor &a, bool assigned)
 Subscribe advisor a to variable. More...
 
unsigned int degree (void) const
 Return degree (number of subscribed propagators and advisors) More...
 
double afc (const Space &home) const
 Return accumulated failure count (plus degree) More...
 
unsigned int bits (void) const
 Provide access to free bits. More...
 
unsigned int & bits (void)
 Provide access to free bits. More...
 
- Static Public Member Functions inherited from Gecode::VarImp< Gecode::Set::SetVarImpConf >
static void schedule (Space &home, Propagator &p, ModEvent me, bool force=false)
 Schedule propagator p with modification event me. More...
 
static ModEvent me (const ModEventDelta &med)
 Project modification event for this variable type from med. More...
 
static ModEventDelta med (ModEvent me)
 Translate modification event me into modification event delta. More...
 
static ModEvent me_combine (ModEvent me1, ModEvent me2)
 Combine modifications events me1 and me2. More...
 
static ModEvent modevent (const Delta &d)
 Return modification event. More...
 
static void * operator new (size_t, Space &)
 Allocate memory from space. More...
 
static void operator delete (void *, Space &)
 Return memory to space. More...
 
static void operator delete (void *)
 Needed for exceptions. More...
 
- Public Attributes inherited from Gecode::VarImp< Gecode::Set::SetVarImpConf >
ActorLink ** base
 Subscribed actors. More...
 
VarImp< Gecode::Set::SetVarImpConf > * fwd
 Forwarding pointer. More...
 
unsigned int idx [pc_max+1]
 Indices of subscribed actors. More...
 
VarImp< Gecode::Set::SetVarImpConf > * next
 During cloning, points to the next copied variable. More...
 

Detailed Description

Finite integer set variable implementation.

Definition at line 434 of file var-imp.hpp.

Constructor & Destructor Documentation

Gecode::Set::SetVarImp::SetVarImp ( Space home,
bool  share,
SetVarImp x 
)
inlineprotected

Constructor for cloning x.

Definition at line 121 of file set.cpp.

Gecode::Set::SetVarImp::SetVarImp ( Space home)
inline

Initialize with empty lower and full upper bound.

Definition at line 52 of file set.hpp.

Gecode::Set::SetVarImp::SetVarImp ( Space home,
int  glbMin,
int  glbMax,
int  lubMin,
int  lubMax,
unsigned int  cardMin = 0,
unsigned int  cardMax = Limits::card 
)
inline

Initialize with given bounds and cardinality.

Creates a set variable $s$ with $\mathit{glb}(s)=\{\mathit{glbMin},\dots,\mathit{glbMax}\}$, $\mathit{lub}(s)=\{\mathit{lubMin},\dots,\mathit{lubMax}\}$, and $\mathit{cardMin}\leq |s|\leq\mathit{cardMax}$

Definition at line 59 of file set.hpp.

Gecode::Set::SetVarImp::SetVarImp ( Space home,
const IntSet glbD,
int  lubMin,
int  lubMax,
unsigned int  cardMin,
unsigned int  cardMax 
)
inline

Initialize with given bounds and cardinality.

Creates a set variable $s$ with $\mathit{glb}(s)=\mathit{glbD}$, $\mathit{lub}(s)=\{\mathit{lubMin},\dots,\mathit{lubMax}\}$, and $\mathit{cardMin}\leq |s|\leq\mathit{cardMax}$

Definition at line 68 of file set.hpp.

Gecode::Set::SetVarImp::SetVarImp ( Space home,
int  glbMin,
int  glbMax,
const IntSet lubD,
unsigned int  cardMin,
unsigned int  cardMax 
)
inline

Initialize with given bounds and cardinality.

Creates a set variable $s$ with $\mathit{glb}(s)=\{\mathit{glbMin},\dots,\mathit{glbMax}\}$, $\mathit{lub}(s)=\mathit{lubD}$, and $\mathit{cardMin}\leq |s|\leq\mathit{cardMax}$

Definition at line 78 of file set.hpp.

Gecode::Set::SetVarImp::SetVarImp ( Space home,
const IntSet glbD,
const IntSet lubD,
unsigned int  cardMin,
unsigned int  cardMax 
)
inline

Initialize with given bounds and cardinality.

Creates a set variable $s$ with $\mathit{glb}(s)=\mathit{glbD}$, $\mathit{lub}(s)=\mathit{lubD}$, and $\mathit{cardMin}\leq |s|\leq\mathit{cardMax}$

Definition at line 88 of file set.hpp.

Member Function Documentation

unsigned int Gecode::Set::SetVarImp::cardMin ( void  ) const
inline

Return current cardinality minimum.

Definition at line 103 of file set.hpp.

unsigned int Gecode::Set::SetVarImp::cardMax ( void  ) const
inline

Return current cardinality maximum.

Definition at line 106 of file set.hpp.

int Gecode::Set::SetVarImp::lubMin ( void  ) const
inline

Return minimum of the least upper bound.

Definition at line 115 of file set.hpp.

int Gecode::Set::SetVarImp::lubMax ( void  ) const
inline

Return maximum of the least upper bound.

Definition at line 118 of file set.hpp.

int Gecode::Set::SetVarImp::lubMinN ( unsigned int  n) const
inline

Return n -th smallest element in the least upper bound.

Definition at line 121 of file set.hpp.

int Gecode::Set::SetVarImp::glbMin ( void  ) const
inline

Return minimum of the greatest lower bound.

Definition at line 124 of file set.hpp.

int Gecode::Set::SetVarImp::glbMax ( void  ) const
inline

Return maximum of the greatest lower bound.

Definition at line 127 of file set.hpp.

unsigned int Gecode::Set::SetVarImp::glbSize ( void  ) const
inline

Return the size of the greatest lower bound.

Definition at line 130 of file set.hpp.

unsigned int Gecode::Set::SetVarImp::lubSize ( void  ) const
inline

Return the size of the least upper bound.

Definition at line 133 of file set.hpp.

bool Gecode::Set::SetVarImp::assigned ( void  ) const
inline

Test whether variable is assigned.

Definition at line 98 of file set.hpp.

bool Gecode::Set::SetVarImp::knownIn ( int  n) const
inline

Test whether n is contained in greatest lower bound.

Definition at line 109 of file set.hpp.

bool Gecode::Set::SetVarImp::knownOut ( int  i) const
inline

Test whether n is not contained in least upper bound.

Definition at line 112 of file set.hpp.

ModEvent Gecode::Set::SetVarImp::include ( Space home,
int  n 
)
inline

Include n in the greatest lower bound.

Definition at line 291 of file set.hpp.

ModEvent Gecode::Set::SetVarImp::include ( Space home,
int  i,
int  j 
)
inline

Include the range $\{i,\dots,j\}$ in the greatest lower bound.

Definition at line 276 of file set.hpp.

ModEvent Gecode::Set::SetVarImp::exclude ( Space home,
int  n 
)
inline

Exclude n from the least upper bound.

Definition at line 365 of file set.hpp.

ModEvent Gecode::Set::SetVarImp::exclude ( Space home,
int  i,
int  j 
)
inline

Exclude the range $\{i,\dots,j\}$ from the least upper bound.

Definition at line 350 of file set.hpp.

ModEvent Gecode::Set::SetVarImp::intersect ( Space home,
int  n 
)
inline

Exclude everything but n from the least upper bound.

Definition at line 210 of file set.hpp.

ModEvent Gecode::Set::SetVarImp::intersect ( Space home,
int  i,
int  j 
)
inline

Exclude everything but the range $\{i,\dots,j\}$ from the least upper bound.

Definition at line 185 of file set.hpp.

ModEvent Gecode::Set::SetVarImp::cardMin ( Space home,
unsigned int  n 
)
inline

Restrict cardinality to be at least n.

Definition at line 165 of file set.hpp.

ModEvent Gecode::Set::SetVarImp::cardMax ( Space home,
unsigned int  n 
)
inline

Restrict cardinality to be at most n.

Definition at line 175 of file set.hpp.

template<class I >
ModEvent Gecode::Set::SetVarImp::includeI ( Space home,
I &  i 
)
inline

Include set described by i in the greatest lower bound.

Definition at line 296 of file set.hpp.

template<class I >
ModEvent Gecode::Set::SetVarImp::excludeI ( Space home,
I &  i 
)
inline

Exclude set described by i from the least upper bound.

Definition at line 371 of file set.hpp.

template<class I >
ModEvent Gecode::Set::SetVarImp::intersectI ( Space home,
I &  i 
)
inline

Exclude everything but set described by i from the least upper bound.

Definition at line 216 of file set.hpp.

void Gecode::Set::SetVarImp::subscribe ( Space home,
Propagator p,
PropCond  pc,
bool  schedule = true 
)
inline

Subscribe propagator p with propagation condition pc to variable.

In case schedule is false, the propagator is just subscribed but not scheduled for execution (this must be used when creating subscriptions during propagation).

Definition at line 513 of file set.hpp.

void Gecode::Set::SetVarImp::cancel ( Space home,
Propagator p,
PropCond  pc 
)
inline

Cancel subscription of propagator p with propagation condition pc.

Definition at line 517 of file set.hpp.

void Gecode::Set::SetVarImp::subscribe ( Space home,
Advisor a 
)
inline

Subscribe advisor a to variable.

Definition at line 521 of file set.hpp.

void Gecode::Set::SetVarImp::cancel ( Space home,
Advisor a 
)
inline

Cancel subscription of advisor a.

Definition at line 525 of file set.hpp.

SetVarImp * Gecode::Set::SetVarImp::copy ( Space home,
bool  share 
)
inline

Return copy of this variable.

Definition at line 428 of file set.hpp.

int Gecode::Set::SetVarImp::glbMin ( const Delta d)
inlinestatic

Return minimum value just pruned from glb.

Definition at line 140 of file set.hpp.

int Gecode::Set::SetVarImp::glbMax ( const Delta d)
inlinestatic

Return maximum value just pruned from glb.

Definition at line 144 of file set.hpp.

bool Gecode::Set::SetVarImp::glbAny ( const Delta d)
inlinestatic

Test whether arbitrary values got pruned from glb.

Definition at line 148 of file set.hpp.

int Gecode::Set::SetVarImp::lubMin ( const Delta d)
inlinestatic

Return minimum value just pruned from lub.

Definition at line 152 of file set.hpp.

int Gecode::Set::SetVarImp::lubMax ( const Delta d)
inlinestatic

Return maximum value just pruned from lub.

Definition at line 156 of file set.hpp.

bool Gecode::Set::SetVarImp::lubAny ( const Delta d)
inlinestatic

Test whether arbitrary values got pruned from lub.

Definition at line 160 of file set.hpp.


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