#include <domain.h>
Public Types | |
| typedef unsigned long int | Var |
| typedef const_iterator | iterator |
| Alias for const_iterator. | |
Public Member Functions | |
| Domain () | |
| Creates an empty domain. | |
| Domain (Var from, unsigned int n_vars=1, unsigned int step=1) | |
| Creates a finite domain. | |
| Domain (const Domain &infinite_base, const Domain &from) | |
| Lay out one domain onto an infinite base. | |
| Domain (const set< Var > &s) | |
| Creates a finite domain given a set of variables. | |
| bool | is_finite () const |
| Checks if domain is finite. | |
| bool | is_infinite () const |
| Checks if domain is infinite. | |
| bool | is_empty () const |
| Checks if domain is empty. | |
| bool | is_compatible (const Domain &d2) const |
| Checks if two domains are compatible. | |
| bool | is_disjoint (const Domain &d2) const |
| Checks if two domains are disjoint. | |
| unsigned int | size () const |
| Get size of domain. | |
| Var | lowest () const |
| Get the lowest variable in domain. | |
| Var | highest () const |
| Get the highest variable in domain. | |
| Var | higher () const |
| Get a variable higher then any variable in domain. | |
| bool | operator() (Var v) const |
| Membership test. | |
| Domain & | operator|= (const Domain &vs) |
| Union assignment. | |
| Domain & | operator &= (const Domain &vs) |
| Intersection assignment. | |
| Domain & | operator-= (const Domain &vs) |
| Difference assignment. | |
| template<class _UnaryFunction> Domain | transform (_UnaryFunction op) const |
| transform elements of domain | |
| Domain | operator * (unsigned int v) const |
| Multiply every variable in domain. | |
| Domain | operator/ (unsigned int v) const |
| Divide every variable in domain. | |
| Domain | operator+ (unsigned int v) const |
| Add to every variable in domain. | |
| Domain | operator- (unsigned int v) const |
| Subtract from every variable in domain. | |
| Domain | first_n (unsigned int n) const |
| Get a domain with the lowest variables. | |
| Domain | last_n (unsigned int n) const |
| Get a domain with the highest variables. | |
| Domain | cut_to_same_size (const Domain &d) const |
| Remove highest variables to get same size as another domain. | |
| const_iterator | begin () const |
| Get iterator pointing to beginning of set. | |
| const_iterator | end () const |
| Get iterator pointing to end of set. | |
Static Public Member Functions | |
| Domain | infinite (Var from=0, Var step=1) |
| Creates an infinite domain. | |
| VarMap | map_vars (const Domain &vs1, const Domain &vs2) |
| Domain | sup (const Domain &vs1, const Domain &vs2) |
| Get largest domain. | |
Friends | |
| class | Domain::const_iterator |
| ostream & | operator<< (ostream &s, const Domain &vs) |
| Sends a textual description of a domain into a stream. | |
| Domain | operator| (const Domain &vs1, const Domain &vs2) |
| Union of domains. | |
| Domain | operator & (const Domain &vs1, const Domain &vs2) |
| Intersection of domains. | |
| Domain | operator- (const Domain &vs1, const Domain &vs2) |
| Difference. | |
| bool | operator== (const Domain &v1, const Domain &v2) |
| Equality. | |
| bool | operator!= (const Domain &v1, const Domain &v2) |
| Inequality. | |
A domain is created by giving the base variable, the number of variables, and a step value. The last two variables can be omitted. Some common usage patters:
Domain d1(0, 5); Domain d2(5, 5); Domain d3(0, 5, 2); Domain d4(1, 5, 2);
Giving the following sets:
d1 = {0,1,2,3,4} d2 = {5,6,7,8,9} d3 = {0,2,4,6,8} d4 = {1,3,5,7,9}
d3 and d4 are interleaved, a common way to represent a the state components of a transition relation.
|
|
Alias for const_iterator.
|
|
|
|
|
|
Creates an empty domain.
|
|
||||||||||||||||
|
Creates a finite domain.
|
|
||||||||||||
|
Lay out one domain onto an infinite base.
|
|
|
Creates a finite domain given a set of variables.
|
|
|
Get iterator pointing to beginning of set.
|
|
|
Remove highest variables to get same size as another domain.
|
|
|
Get iterator pointing to end of set.
|
|
|
Get a domain with the lowest variables.
|
|
|
Get a variable higher then any variable in domain. Requires a finite domain
|
|
|
Get the highest variable in domain. Requires a non-empty domain
|
|
||||||||||||
|
Creates an infinite domain.
|
|
|
Checks if two domains are compatible. Two domains are compatible iff they contain the same number of variables
|
|
|
Checks if two domains are disjoint.
|
|
|
Checks if domain is empty.
|
|
|
Checks if domain is finite.
|
|
|
Checks if domain is infinite.
|
|
|
Get a domain with the highest variables.
|
|
|
Get the lowest variable in domain. Requires a non-empty domain
|
|
||||||||||||
|
map_vars:
|
|
|
Intersection assignment. Same as domain = domain & vs
|
|
|
Multiply every variable in domain.
|
|
|
Membership test.
|
|
|
Add to every variable in domain.
|
|
|
Subtract from every variable in domain.
|
|
|
Difference assignment. Same as domain = domain - vs
|
|
|
Divide every variable in domain.
|
|
|
Union assignment. Same as domain = domain | vs
|
|
|
Get size of domain. Gets the number of variables in the domain. This requires that the domain is finite.
|
|
||||||||||||
|
Get largest domain.
|
|
||||||||||
|
transform elements of domain
|
|
|
|
|
||||||||||||
|
Intersection of domains.
|
|
||||||||||||
|
Inequality.
|
|
||||||||||||
|
Difference.
|
|
||||||||||||
|
Sends a textual description of a domain into a stream.
|
|
||||||||||||
|
Equality.
|
|
||||||||||||
|
Union of domains.
|
1.3.6