Generated on Thu Mar 22 10:39:55 2012 for Gecode by doxygen 1.6.3

Gecode::Int::IntVarImp Class Reference
[Other available functionality]

Integer variable implementation. More...

#include <var-imp.hpp>

List of all members.

Classes

class  RangeList
 Lists of ranges (intervals). More...

Public Member Functions

 IntVarImp (Space &home, int min, int max)
 Initialize with range domain.
 IntVarImp (Space &home, const IntSet &d)
 Initialize with domain specified by d.

Protected Member Functions

RangeListfst (void) const
 Return first element of rangelist.
void fst (RangeList *f)
 Set first element of rangelist.
RangeListlst (void) const
 Return last element of rangelist.
void lst (RangeList *l)
 Set last element of rangelist.
 IntVarImp (Space &home, bool share, IntVarImp &x)
 Constructor for cloning x.

Protected Attributes

RangeList dom
 Domain information.
RangeList_lst
 Link the last element.
unsigned int holes
 Size of holes in the domain.

Range list access for iteration



const RangeListranges_fwd (void) const
 Return range list for forward iteration.
const RangeListranges_bwd (void) const
 Return range list for backward iteration.

Value access



int min (void) const
 Return minimum of domain.
int max (void) const
 Return maximum of domain.
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).
unsigned int size (void) const
 Return size (cardinality) of domain.
unsigned int width (void) const
 Return width of domain (distance between maximum and minimum).
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).

Domain tests



bool range (void) const
 Test whether domain is a range.
bool assigned (void) const
 Test whether variable is assigned.
bool in (int n) const
 Test whether n is contained in domain.
bool in (double n) const
 Test whether n is contained in domain.

Domain update by value



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

Domain update by iterator

Variable domains can be both updated by range and value iterators. Value iterators do not need to be strict in that the same value is allowed to occur more than once in the iterated sequence.

The argument depends must be true, if the iterator passed as argument depends on the variable implementation on which the operation is invoked. In this case, the variable implementation is only updated after the iterator has been consumed. Otherwise, the domain might be updated concurrently while following the iterator.



template<class I >
ModEvent narrow_r (Space &home, I &i, bool depends=true)
 Replace domain by ranges described by i.
template<class I >
ModEvent inter_r (Space &home, I &i, bool depends=true)
 Intersect domain with ranges described by i.
template<class I >
ModEvent minus_r (Space &home, I &i, bool depends=true)
 Remove from domain the ranges described by i.
template<class I >
ModEvent narrow_v (Space &home, I &i, bool depends=true)
 Replace domain by values described by i.
template<class I >
ModEvent inter_v (Space &home, I &i, bool depends=true)
 Intersect domain with values described by i.
template<class I >
ModEvent minus_v (Space &home, I &i, bool depends=true)
 Remove from domain the values described by i.

Dependencies



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

Cloning



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

Variable implementation-dependent propagator support



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

Delta information for advisors



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

Detailed Description

Integer variable implementation.

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


Constructor & Destructor Documentation

Gecode::Int::IntVarImp::IntVarImp ( Space home,
bool  share,
IntVarImp x 
) [inline, protected]

Constructor for cloning x.

Definition at line 319 of file int.cpp.

Gecode::Int::IntVarImp::IntVarImp ( Space home,
int  min,
int  max 
) [inline]

Initialize with range domain.

Definition at line 192 of file int.hpp.

Gecode::Int::IntVarImp::IntVarImp ( Space home,
const IntSet d 
) [inline]

Initialize with domain specified by d.

Definition at line 196 of file int.hpp.


Member Function Documentation

IntVarImp::RangeList * Gecode::Int::IntVarImp::fst ( void   )  const [inline, protected]

Return first element of rangelist.

Definition at line 167 of file int.hpp.

void Gecode::Int::IntVarImp::fst ( IntVarImp::RangeList f  )  [inline, protected]

Set first element of rangelist.

Definition at line 172 of file int.hpp.

IntVarImp::RangeList * Gecode::Int::IntVarImp::lst ( void   )  const [inline, protected]

Return last element of rangelist.

Definition at line 177 of file int.hpp.

void Gecode::Int::IntVarImp::lst ( IntVarImp::RangeList l  )  [inline, protected]

Set last element of rangelist.

Definition at line 182 of file int.hpp.

int Gecode::Int::IntVarImp::min ( void   )  const [inline]

Return minimum of domain.

Definition at line 228 of file int.hpp.

int Gecode::Int::IntVarImp::max ( void   )  const [inline]

Return maximum of domain.

Definition at line 232 of file int.hpp.

int Gecode::Int::IntVarImp::val ( void   )  const [inline]

Return assigned value (only if assigned).

Definition at line 236 of file int.hpp.

int Gecode::Int::IntVarImp::med ( void   )  const

Return median of domain (greatest element not greater than the median).

Definition at line 50 of file int.cpp.

unsigned int Gecode::Int::IntVarImp::size ( void   )  const [inline]

Return size (cardinality) of domain.

Definition at line 257 of file int.hpp.

unsigned int Gecode::Int::IntVarImp::width ( void   )  const [inline]

Return width of domain (distance between maximum and minimum).

Definition at line 252 of file int.hpp.

unsigned int Gecode::Int::IntVarImp::regret_min ( void   )  const [inline]

Return regret of domain minimum (distance to next larger value).

Definition at line 262 of file int.hpp.

unsigned int Gecode::Int::IntVarImp::regret_max ( void   )  const [inline]

Return regret of domain maximum (distance to next smaller value).

Definition at line 272 of file int.hpp.

bool Gecode::Int::IntVarImp::range ( void   )  const [inline]

Test whether domain is a range.

Definition at line 242 of file int.hpp.

bool Gecode::Int::IntVarImp::assigned ( void   )  const [inline]

Test whether variable is assigned.

Definition at line 246 of file int.hpp.

bool Gecode::Int::IntVarImp::in ( int  n  )  const [inline]

Test whether n is contained in domain.

Definition at line 290 of file int.hpp.

bool Gecode::Int::IntVarImp::in ( double  n  )  const [inline]

Test whether n is contained in domain.

Definition at line 296 of file int.hpp.

const IntVarImp::RangeList * Gecode::Int::IntVarImp::ranges_fwd ( void   )  const [inline, protected]

Return range list for forward iteration.

Definition at line 309 of file int.hpp.

const IntVarImp::RangeList * Gecode::Int::IntVarImp::ranges_bwd ( void   )  const [inline, protected]

Return range list for backward iteration.

Definition at line 314 of file int.hpp.

ModEvent Gecode::Int::IntVarImp::lq ( Space home,
int  n 
) [inline]

Restrict domain values to be less or equal than n.

Definition at line 366 of file int.hpp.

ModEvent Gecode::Int::IntVarImp::lq ( Space home,
double  n 
) [inline]

Restrict domain values to be less or equal than n.

Definition at line 376 of file int.hpp.

ModEvent Gecode::Int::IntVarImp::gq ( Space home,
int  n 
) [inline]

Restrict domain values to be greater or equal than n.

Definition at line 344 of file int.hpp.

ModEvent Gecode::Int::IntVarImp::gq ( Space home,
double  n 
) [inline]

Restrict domain values to be greater or equal than n.

Definition at line 354 of file int.hpp.

ModEvent Gecode::Int::IntVarImp::nq ( Space home,
int  n 
) [inline]

Restrict domain values to be different from n.

Definition at line 411 of file int.hpp.

ModEvent Gecode::Int::IntVarImp::nq ( Space home,
double  n 
) [inline]

Restrict domain values to be different from n.

Definition at line 417 of file int.hpp.

ModEvent Gecode::Int::IntVarImp::eq ( Space home,
int  n 
) [inline]

Restrict domain values to be equal to n.

Definition at line 388 of file int.hpp.

ModEvent Gecode::Int::IntVarImp::eq ( Space home,
double  n 
) [inline]

Restrict domain values to be equal to n.

Definition at line 398 of file int.hpp.

template<class I >
ModEvent Gecode::Int::IntVarImp::narrow_r ( Space home,
I &  i,
bool  depends = true 
) [inline]

Replace domain by ranges described by i.

Definition at line 506 of file int.hpp.

template<class I >
ModEvent Gecode::Int::IntVarImp::inter_r ( Space home,
I &  i,
bool  depends = true 
) [inline]

Intersect domain with ranges described by i.

Definition at line 673 of file int.hpp.

template<class I >
ModEvent Gecode::Int::IntVarImp::minus_r ( Space home,
I &  i,
bool  depends = true 
) [inline]

Remove from domain the ranges described by i.

Definition at line 681 of file int.hpp.

template<class I >
ModEvent Gecode::Int::IntVarImp::narrow_v ( Space home,
I &  i,
bool  depends = true 
) [inline]

Replace domain by values described by i.

Definition at line 838 of file int.hpp.

template<class I >
ModEvent Gecode::Int::IntVarImp::inter_v ( Space home,
I &  i,
bool  depends = true 
) [inline]

Intersect domain with values described by i.

Definition at line 845 of file int.hpp.

template<class I >
ModEvent Gecode::Int::IntVarImp::minus_v ( Space home,
I &  i,
bool  depends = true 
) [inline]

Remove from domain the values described by i.

Definition at line 852 of file int.hpp.

void Gecode::Int::IntVarImp::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 1005 of file int.hpp.

void Gecode::Int::IntVarImp::cancel ( Space home,
Propagator p,
PropCond  pc 
) [inline]

Cancel subscription of propagator p with propagation condition pc.

Definition at line 1009 of file int.hpp.

void Gecode::Int::IntVarImp::subscribe ( Space home,
Advisor a 
) [inline]

Subscribe advisor a to variable.

Definition at line 1014 of file int.hpp.

void Gecode::Int::IntVarImp::cancel ( Space home,
Advisor a 
) [inline]

Cancel subscription of advisor a.

Definition at line 1018 of file int.hpp.

ModEventDelta Gecode::Int::IntVarImp::med ( ModEvent  me  )  [inline, static]

Translate modification event me to modification event delta for view.

Reimplemented from Gecode::VarImp< Gecode::Int::IntVarImpConf >.

Definition at line 1023 of file int.hpp.

IntVarImp * Gecode::Int::IntVarImp::copy ( Space home,
bool  share 
) [inline]

Return copy of this variable.

Definition at line 994 of file int.hpp.

int Gecode::Int::IntVarImp::min ( const Delta d  )  [inline, static]

Return minimum value just pruned.

Definition at line 325 of file int.hpp.

int Gecode::Int::IntVarImp::max ( const Delta d  )  [inline, static]

Return maximum value just pruned.

Definition at line 329 of file int.hpp.

bool Gecode::Int::IntVarImp::any ( const Delta d  )  [inline, static]

Test whether arbitrary values got pruned.

Definition at line 333 of file int.hpp.


Member Data Documentation

Domain information.

Provides fast access to minimum and maximum of the entire domain and links to the first element of a RangeList defining the domain.

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

Link the last element.

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

unsigned int Gecode::Int::IntVarImp::holes [protected]

Size of holes in the domain.

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


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