#include <intset.h>
Public Member Functions | |
ABA_INTSET () | |
~ABA_INTSET () | |
void | initialize (int n) |
bool | exists (int elem) const |
void | insert (int elem) |
void | remove (int elem) |
int | count () const |
This function and the function elem() can be used to iterate over the elements of the set. | |
int | elem (int index) const |
Private Attributes | |
int * | uninitializedMap_ |
int * | position_ |
int | count_ |
Definition at line 36 of file intset.h.
ABA_INTSET::ABA_INTSET | ( | ) |
The constructor. An empty set is created.
bytes of memory are allocated for the internal representation of the data structure.
n | The created object can store subsets of ![]() |
ABA_INTSET::~ABA_INTSET | ( | ) |
The destructor deletes the allocated memory.
void ABA_INTSET::initialize | ( | int | n | ) |
An empty set is initialized.
bytes of memory are allocated for the internal representation of the data structure.
n | The initialized object can store subsets of ![]() |
bool ABA_INTSET::exists | ( | int | elem | ) | const |
Tests if an integer is contained in the set.
void ABA_INTSET::insert | ( | int | elem | ) |
Inserts an element in the set.
The element is not inserted twice if it is already contained in the set.
elem | The element to be inserted. |
void ABA_INTSET::remove | ( | int | elem | ) |
Removes an element from the set if it is contained in it.
elem | The element to be removed. |
int ABA_INTSET::count | ( | ) | const |
This function and the function elem() can be used to iterate over the elements of the set.
int ABA_INTSET::elem | ( | int | index | ) | const |
Is used to access the elements contained in the set.
index | The index of the element to be returned. This must be a non negative integer less than number()|. |
int* ABA_INTSET::uninitializedMap_ [private] |
int* ABA_INTSET::position_ [private] |
int ABA_INTSET::count_ [private] |