Integer variables.
More...
#include <int.hh>
List of all members.
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 IntVar &x) |
| Print integer variable x.
|
Constructors and initialization |
| IntVar (void) |
| Default constructor.
|
| IntVar (const IntVar &y) |
| Initialize from integer variable y.
|
| IntVar (const Int::IntView &y) |
| Initialize from integer view y.
|
| IntVar (Space &home, int min, int max) |
| Initialize variable with range domain.
|
| IntVar (Space &home, const IntSet &d) |
| Initialize variable with arbitrary 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.
|
Detailed Description
Integer variables.
Definition at line 335 of file int.hh.
Constructor & Destructor Documentation
Default constructor.
Definition at line 51 of file int.hpp.
Initialize from integer variable y.
Definition at line 53 of file int.hpp.
Initialize from integer view y.
Definition at line 56 of file int.hpp.
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 42 of file int.cpp.
Initialize variable with arbitrary domain.
The variable is created with a domain described by d. The following exceptions might be thrown:
Definition at line 50 of file int.cpp.
Member Function Documentation
Return minimum of domain.
Definition at line 66 of file int.hpp.
Return maximum of domain.
Definition at line 74 of file int.hpp.
Return median of domain (greatest element not greater than the median)
Definition at line 70 of file int.hpp.
Return size (cardinality) of domain.
Definition at line 84 of file int.hpp.
Return width of domain (distance between maximum and minimum)
Definition at line 80 of file int.hpp.
Return regret of domain minimum (distance to next larger value)
Definition at line 88 of file int.hpp.
Return regret of domain maximum (distance to next smaller value)
Definition at line 92 of file int.hpp.
Test whether domain is a range.
Definition at line 97 of file int.hpp.
Test whether n is contained in domain.
Definition at line 101 of file int.hpp.
Friends And Related Function Documentation
template<class Char , class Traits >
std::basic_ostream< Char, Traits > & operator<< |
( |
std::basic_ostream< Char, Traits > & |
os, |
|
|
const IntVar & |
x |
|
) |
| [related] |
Print integer variable x.
Definition at line 42 of file print.hpp.
The documentation for this class was generated from the following files: