Generated on Mon May 5 05:54:11 2008 for Gecode by doxygen 1.5.5

Gecode::BoolVar Class Reference
[Integer variables]

#include <int.hh>

Inherits Gecode::VarBase< VarImp >< Gecode::Int::BoolVarImp >.

List of all members.


Detailed Description

Boolean integer variables.

Definition at line 449 of file int.hh.


Constructors and initialization

 BoolVar (void)
 Default constructor.
 BoolVar (const BoolVar &x)
 Initialize from Boolean variable x.
 BoolVar (const Int::BoolView &x)
 Initialize from Boolean view x.
 BoolVar (const Reflection::Var &x)
 Initialize from reflection variable x.
 BoolVar (Space *home, int min, int max)
 Initialize Boolean variable with range domain.
void init (Space *home, int min, int max)
 Initialize Boolean variable with range domain.

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).

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.

Boolean domain tests

bool zero (void) const
 Test whether domain is zero.
bool one (void) const
 Test whether domain is one.
bool none (void) const
 Test whether domain is neither zero nor one.

Cloning

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

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &, const Gecode::BoolVar &x)
 Print Boolean variable x.

Constructor & Destructor Documentation

Gecode::BoolVar::BoolVar ( void   )  [inline]

Default constructor.

Definition at line 52 of file bool.icc.

Gecode::BoolVar::BoolVar ( const BoolVar x  )  [inline]

Initialize from Boolean variable x.

Definition at line 54 of file bool.icc.

Gecode::BoolVar::BoolVar ( const Int::BoolView x  )  [inline]

Initialize from Boolean view x.

Definition at line 57 of file bool.icc.

Gecode::BoolVar::BoolVar ( const Reflection::Var x  )  [inline]

Initialize from reflection variable x.

Definition at line 60 of file bool.icc.

Gecode::BoolVar::BoolVar ( Space home,
int  min,
int  max 
)

Initialize Boolean 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 42 of file bool.cc.


Member Function Documentation

void Gecode::BoolVar::init ( Space home,
int  min,
int  max 
)

Initialize Boolean variable with range domain.

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

  • If min is greater than max, an exception of type Gecode::Int::VariableEmptyDomain is thrown.
  • If min is less than 0 or max is greater than 1, an exception of type Gecode::Int::NotZerOne is thrown.

Definition at line 56 of file bool.cc.

int Gecode::BoolVar::min ( void   )  const [inline]

Return minimum of domain.

Definition at line 68 of file bool.icc.

int Gecode::BoolVar::max ( void   )  const [inline]

Return maximum of domain.

Definition at line 76 of file bool.icc.

int Gecode::BoolVar::med ( void   )  const [inline]

Return median of domain.

Definition at line 72 of file bool.icc.

int Gecode::BoolVar::val ( void   )  const [inline]

Return assigned value (only if assigned).

Definition at line 64 of file bool.icc.

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

Return size (cardinality) of domain.

Definition at line 86 of file bool.icc.

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

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

Definition at line 82 of file bool.icc.

bool Gecode::BoolVar::range ( void   )  const [inline]

Test whether domain is a range.

Definition at line 97 of file bool.icc.

bool Gecode::BoolVar::assigned ( void   )  const [inline]

Test whether view is assigned.

Definition at line 93 of file bool.icc.

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

Test whether n is contained in domain.

Definition at line 101 of file bool.icc.

bool Gecode::BoolVar::zero ( void   )  const [inline]

Test whether domain is zero.

Definition at line 112 of file bool.icc.

bool Gecode::BoolVar::one ( void   )  const [inline]

Test whether domain is one.

Definition at line 116 of file bool.icc.

bool Gecode::BoolVar::none ( void   )  const [inline]

Test whether domain is neither zero nor one.

Definition at line 120 of file bool.icc.

void Gecode::BoolVar::update ( Space home,
bool  share,
BoolVar x 
) [inline]

Update this variable to be a clone of variable x.

Definition at line 107 of file bool.icc.


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  ,
const Gecode::BoolVar x 
) [related]

Print Boolean variable x.

Definition at line 1827 of file view.icc.


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