A dynamic set of non-negative integers. More...
#include <IndexSet.h>
Public Member Functions | |
| IndexSet (long low, long high) | |
| IndexSet (long j) | |
| long | first () const |
| Returns the first element, 0 if the set is empty. | |
| long | last () const |
| Returns the last element, -1 if the set is empty. | |
| long | next (long j) const |
| Returns the next element after j, if any; otherwise j+1. | |
| long | prev (long j) const |
| long | card () const |
| The cardinality of the set. | |
| bool | contains (long j) const |
| Returns true iff the set contains j. | |
| bool | contains (const IndexSet &s) const |
| Returns true iff the set contains s. | |
| bool | disjointFrom (const IndexSet &s) const |
| Returns true iff the set is disjoint from s. | |
| bool | operator== (const IndexSet &s) const |
| bool | operator!= (const IndexSet &s) const |
| void | clear () |
| Set to the empty set. | |
| void | insert (long j) |
| Add j to the set. | |
| void | remove (long j) |
| Remove j from the set. | |
| void | insert (const IndexSet &s) |
| Add s to the set (union) | |
| void | remove (const IndexSet &s) |
| Remove s from the set (set minus) | |
| void | retain (const IndexSet &s) |
| Retains only those elements that are also in s (intersection) | |
Static Public Member Functions | |
| static const IndexSet & | emptySet () |
| Read-only access to an empty set. | |
A dynamic set of non-negative integers.
You can iterate through a set as follows:
1.8.3.1