Generated on Wed Nov 1 15:05:13 2006 for Gecode by doxygen 1.4.5

Gecode::IntVar Class Reference
[Integer variables]

Inherited by Gecode::BoolVar.

List of all members.


Detailed Description

Integer variables.

Definition at line 391 of file var.icc.

Constructors and initialization

 IntVar (void)
 Default constructor.
 IntVar (const IntVar &x)
 Initialize from integer variable x.
 IntVar (const Int::IntView &x)
 Initialize from integer view x.
 IntVar (Space *home, int min, int max)
 Initialize variable with range domain.
 IntVar (Space *home, const IntSet &d)
 Initialize variable with arbitrary domain.
void init (Space *home, int min, int max)
 Initialize variable with range domain.
void init (Space *home, const IntSet &d)
 Initialize variable with arbitrary domain.

Variable implementation access

Int::IntVarImpvariable (void) const
 Return integer variable implementation.

Value access

int min (void) const
 Return minimum of domain.
int max (void) const
 Return maximum of domain.
int med (void) const
 Return median of domain.
int val (void) const
 Return assigned value (only if assigned).
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 degree (void) const
 Return degree (number of subscribed propagators).

Domain tests

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

Cloning

void update (Space *home, bool share, IntVar &x)
 Update this variable to be a clone of variable x.

Protected Attributes

Int::IntVarImpvar
 Integer variable implementation used.

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &, const Gecode::IntVar &x)
 Print integer variable x.


Constructor & Destructor Documentation

Gecode::IntVar::IntVar void   )  [inline]
 

Default constructor.

Definition at line 25 of file int.icc.

Gecode::IntVar::IntVar const IntVar x  )  [inline]
 

Initialize from integer variable x.

Definition at line 29 of file int.icc.

Gecode::IntVar::IntVar const Int::IntView x  )  [inline]
 

Initialize from integer view x.

Definition at line 32 of file int.icc.

Gecode::IntVar::IntVar Space home,
int  min,
int  max
 

Initialize variable with range domain.

The variable is created with a domain ranging from min to max. The following exceptions might be thrown:

Definition at line 26 of file int.cc.

Gecode::IntVar::IntVar Space home,
const IntSet d
 

Initialize variable with arbitrary domain.

The variable is created with a domain described by d. The following exceptions might be thrown:

Definition at line 34 of file int.cc.


Member Function Documentation

void Gecode::IntVar::init Space home,
int  min,
int  max
 

Initialize variable with range domain.

The variable is created with a domain ranging from min to max. The following exceptions might be thrown:

Definition at line 43 of file int.cc.

void Gecode::IntVar::init Space home,
const IntSet d
 

Initialize variable with arbitrary domain.

The variable is created with a domain described by d. The following exceptions might be thrown:

Definition at line 52 of file int.cc.

Int::IntVarImp * Gecode::IntVar::variable void   )  const [inline]
 

Return integer variable implementation.

Definition at line 38 of file int.icc.

int Gecode::IntVar::min void   )  const [inline]
 

Return minimum of domain.

Definition at line 48 of file int.icc.

int Gecode::IntVar::max void   )  const [inline]
 

Return maximum of domain.

Definition at line 56 of file int.icc.

int Gecode::IntVar::med void   )  const [inline]
 

Return median of domain.

Definition at line 52 of file int.icc.

int Gecode::IntVar::val void   )  const [inline]
 

Return assigned value (only if assigned).

Definition at line 44 of file int.icc.

unsigned int Gecode::IntVar::size void   )  const [inline]
 

Return size (cardinality) of domain.

Definition at line 70 of file int.icc.

unsigned int Gecode::IntVar::width void   )  const [inline]
 

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

Definition at line 66 of file int.icc.

unsigned int Gecode::IntVar::degree void   )  const [inline]
 

Return degree (number of subscribed propagators).

Definition at line 62 of file int.icc.

bool Gecode::IntVar::range void   )  const [inline]
 

Test whether domain is a range.

Definition at line 81 of file int.icc.

bool Gecode::IntVar::assigned void   )  const [inline]
 

Test whether view is assigned.

Definition at line 77 of file int.icc.

bool Gecode::IntVar::in int  n  )  const [inline]
 

Test whether n is contained in domain.

Definition at line 85 of file int.icc.

void Gecode::IntVar::update Space home,
bool  share,
IntVar x
[inline]
 

Update this variable to be a clone of variable x.

Definition at line 91 of file int.icc.


Friends And Related Function Documentation

std::ostream & operator<< std::ostream &  ,
const Gecode::IntVar x
[related]
 

Print integer variable x.

Definition at line 1152 of file view.icc.


Member Data Documentation

Int::IntVarImp* Gecode::IntVar::var [protected]
 

Integer variable implementation used.

Definition at line 394 of file var.icc.


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