ABA_INTSET Class Reference

class ABA_INTSET implements the abstract datatype for storing a subset of the set $\{0,\dots,n-1\}$. More...

#include <intset.h>

List of all members.

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_


Detailed Description

class ABA_INTSET implements the abstract datatype for storing a subset of the set $\{0,\dots,n-1\}$.

Definition at line 36 of file intset.h.


Constructor & Destructor Documentation

ABA_INTSET::ABA_INTSET (  ) 

The constructor. An empty set is created.

$O(n)$ bytes of memory are allocated for the internal representation of the data structure.

Parameters:
n The created object can store subsets of $\{0,\dots,n-1\}$.

ABA_INTSET::~ABA_INTSET (  ) 

The destructor deletes the allocated memory.


Member Function Documentation

void ABA_INTSET::initialize ( int  n  ) 

An empty set is initialized.

$O(n)$ bytes of memory are allocated for the internal representation of the data structure.

Parameters:
n The initialized object can store subsets of $\{0,\dots,n-1\}$.

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.

Parameters:
elem The element to be inserted.

void ABA_INTSET::remove ( int  elem  ) 

Removes an element from the set if it is contained in it.

Parameters:
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.

Returns:
The number of elements contained in the set.

int ABA_INTSET::elem ( int  index  )  const

Is used to access the elements contained in the set.

Parameters:
index The index of the element to be returned. This must be a non negative integer less than number()|.
Returns:
The element referenced by the given index.


Member Data Documentation

int* ABA_INTSET::uninitializedMap_ [private]

Definition at line 96 of file intset.h.

int* ABA_INTSET::position_ [private]

Definition at line 97 of file intset.h.

int ABA_INTSET::count_ [private]

Definition at line 98 of file intset.h.


The documentation for this class was generated from the following file:
Generated on Tue Aug 14 18:09:57 2007 for ABACUS by  doxygen 1.5.1