#include <finite_domain.hpp>
|
| | FiniteDomain (int domsize=0) |
| | construct as domain 0..(domain size - 1)
|
| |
| | FiniteDomain (std::pair< int, int > bounds) |
| | construct as contiguous domain lb..ub
|
| |
| | FiniteDomain (int lb, int ub) |
| | construct as contiguous domain lb..ub
|
| |
| bool | empty () const |
| | empty domain return emtpy?
|
| |
| int | size () const |
| | size of the domain
|
| |
| int | lb () const |
| | lower bound
|
| |
| int | ub () const |
| | upper bound
|
| |
| void | inc (int &v) const |
| | increment domain value
|
| |
| int | undet () const |
| | undetermined
|
| |
| bool | in (int v) const |
| | test domain membership
|
| |
Specification of a finite domain
- Note
- Even if currently only contiguous domains are supported, users shouldn't assume this, but use the provided methods to manipulate domain values.
◆ FiniteDomain() [1/3]
| ired::FiniteDomain::FiniteDomain |
( |
int |
domsize = 0 | ) |
|
|
inlineexplicit |
construct as domain 0..(domain size - 1)
- Parameters
-
| domsize | size of the domain |
◆ FiniteDomain() [2/3]
| ired::FiniteDomain::FiniteDomain |
( |
std::pair< int, int > |
bounds | ) |
|
|
inlineexplicit |
construct as contiguous domain lb..ub
- Parameters
-
| bounds | lower and upper bound |
- Note
- both, lower and upper bound, are included in the domain
◆ FiniteDomain() [3/3]
| ired::FiniteDomain::FiniteDomain |
( |
int |
lb, |
|
|
int |
ub |
|
) |
| |
|
inline |
construct as contiguous domain lb..ub
- Parameters
-
| lb | lower bound |
| ub | upper bound |
- Note
- both, lower and upper bound, are included in the domain
◆ empty()
| bool ired::FiniteDomain::empty |
( |
| ) |
const |
|
inline |
empty domain return emtpy?
- Note
- domains are empty whenever ub < lb
◆ in()
| bool ired::FiniteDomain::in |
( |
int |
v | ) |
const |
|
inline |
test domain membership
- Parameters
-
- Returns
- whether v is in the domain
◆ inc()
| void ired::FiniteDomain::inc |
( |
int & |
v | ) |
const |
|
inline |
increment domain value
- Parameters
-
Sets v to the next larger domain value after v or the lowest domain value if v was undetermined.
- Note
- undefined behavior if v neither in the domain nor 'undet', which has to be lb_-1
-
if v was the last domain variable, then afterwards, in(v) is false and v exceeds the upper bound.
◆ lb()
| int ired::FiniteDomain::lb |
( |
| ) |
const |
|
inline |
◆ size()
| int ired::FiniteDomain::size |
( |
| ) |
const |
|
inline |
size of the domain
- Returns
- size
◆ ub()
| int ired::FiniteDomain::ub |
( |
| ) |
const |
|
inline |
◆ undet()
| int ired::FiniteDomain::undet |
( |
| ) |
const |
|
inline |
undetermined
- Returns
- domain-specific undetermined value
The documentation for this class was generated from the following file: