Integer sets. More...
#include <int.hh>
Classes | |
class | MinInc |
Sort ranges according to increasing minimum. More... |
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 IntSet &s) |
Print integer set s. |
Constructors and initialization | |
IntSet (void) | |
Initialize as empty set. | |
IntSet (int n, int m) | |
Initialize as range with minimum n and maximum m. | |
IntSet (const int r[], int n) | |
Initialize with n integers from array r. | |
IntSet (const int r[][2], int n) | |
Initialize with n ranges from array r. | |
template<class I > | |
IntSet (I &i) | |
Initialize with range iterator i. |
Range access | |
int | ranges (void) const |
Return number of ranges of the specification. | |
int | min (int i) const |
Return minimum of range at position i. | |
int | max (int i) const |
Return maximum of range at position i. | |
unsigned int | width (int i) const |
Return width of range at position i. |
Entire set access | |
bool | in (int n) const |
Return whether n is included in the set. | |
unsigned int | size (void) const |
Return size (cardinality) of set. | |
unsigned int | width (void) const |
Return width of set (distance between maximum and minimum) | |
int | min (void) const |
Return minimum of entire set. | |
int | max (void) const |
Return maximum of entire set. |
Predefined value | |
static const IntSet | empty |
Empty set. |
Additional Inherited Members | |
![]() | |
SharedHandle (void) | |
Create shared handle with no object pointing to. | |
SharedHandle (SharedHandle::Object *so) | |
Create shared handle that points to shared object so. | |
SharedHandle (const SharedHandle &sh) | |
Copy constructor maintaining reference count. | |
SharedHandle & | operator= (const SharedHandle &sh) |
Assignment operator mainitaining reference count. | |
void | update (Space &home, bool share, SharedHandle &sh) |
Updating during cloning. | |
~SharedHandle (void) | |
Destructor that maintains reference count. | |
![]() | |
SharedHandle::Object * | object (void) const |
Access to the shared object. | |
void | object (SharedHandle::Object *n) |
Modify shared object. |
Integer sets.
Integer sets are the means to specify arbitrary sets of integers to be used as domains for integer variables.
|
inline |
Initialize as empty set.
Definition at line 47 of file int-set-1.hpp.
|
inline |
Initialize as range with minimum n and maximum m.
Note that the set is empty if n is larger than m
Definition at line 101 of file int-set-1.hpp.
|
inline |
Initialize with n integers from array r.
Definition at line 96 of file int-set-1.hpp.
|
inline |
Initialize with n ranges from array r.
For position i in the array r, the minimum is r[i][0] and the maximum is r[i][1].
Definition at line 91 of file int-set-1.hpp.
|
explicit |
Initialize with range iterator i.
Definition at line 86 of file int-set-1.hpp.
|
inline |
Return number of ranges of the specification.
Definition at line 125 of file int-set-1.hpp.
|
inline |
Return minimum of range at position i.
Definition at line 106 of file int-set-1.hpp.
|
inline |
Return maximum of range at position i.
Definition at line 112 of file int-set-1.hpp.
|
inline |
Return width of range at position i.
Definition at line 118 of file int-set-1.hpp.
|
inline |
Return whether n is included in the set.
Definition at line 131 of file int-set-1.hpp.
|
inline |
Return size (cardinality) of set.
Definition at line 152 of file int-set-1.hpp.
|
inline |
Return width of set (distance between maximum and minimum)
Definition at line 158 of file int-set-1.hpp.
|
inline |
Return minimum of entire set.
Definition at line 140 of file int-set-1.hpp.
|
inline |
Return maximum of entire set.
Definition at line 146 of file int-set-1.hpp.
|
related |
Print integer set s.
Definition at line 227 of file int-set-1.hpp.