Boolean integer variables. More...
#include <int.hh>
Related Functions | |
(Note that these are not member functions.) | |
template<class Char , class Traits > | |
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const BoolVar &x) |
Print Boolean variable x. | |
Constructors and initialization | |
BoolVar (void) | |
Default constructor. | |
BoolVar (const BoolVar &y) | |
Initialize from Boolean variable y. | |
BoolVar (const Int::BoolView &y) | |
Initialize from Boolean view y. | |
BoolVar (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 (greatest element not greater than the median) | |
int | val (void) const |
Return assigned value. | |
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 | 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. |
Boolean integer variables.
Gecode::BoolVar::BoolVar | ( | void | ) | [inline] |
Gecode::BoolVar::BoolVar | ( | const BoolVar & | y | ) | [inline] |
Gecode::BoolVar::BoolVar | ( | const Int::BoolView & | y | ) | [inline] |
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:
int Gecode::BoolVar::min | ( | void | ) | const [inline] |
int Gecode::BoolVar::max | ( | void | ) | const [inline] |
int Gecode::BoolVar::med | ( | void | ) | const [inline] |
int Gecode::BoolVar::val | ( | void | ) | const [inline] |
Return assigned value.
Throws an exception of type Int::ValOfUnassignedVar if variable is not yet assigned.
unsigned int Gecode::BoolVar::size | ( | void | ) | const [inline] |
unsigned int Gecode::BoolVar::width | ( | void | ) | const [inline] |
unsigned int Gecode::BoolVar::regret_min | ( | void | ) | const [inline] |
unsigned int Gecode::BoolVar::regret_max | ( | void | ) | const [inline] |
bool Gecode::BoolVar::range | ( | void | ) | const [inline] |
bool Gecode::BoolVar::in | ( | int | n | ) | const [inline] |
bool Gecode::BoolVar::zero | ( | void | ) | const [inline] |
bool Gecode::BoolVar::one | ( | void | ) | const [inline] |
bool Gecode::BoolVar::none | ( | void | ) | const [inline] |
std::basic_ostream< Char, Traits > & operator<< | ( | std::basic_ostream< Char, Traits > & | os, |
const BoolVar & | x | ||
) | [related] |