dlvhex
2.5.0
|
Implementation of an ordered set based on boost::unordered_map. More...
#include <include/dlvhex2/Set.h>
Public Member Functions | |
OrderedSet () | |
Constructor. | |
void | insert (T el) |
Inserts a new element. | |
void | erase (T el) |
Removes an element. | |
long | getInsertionIndex (T el) |
Get the insertion index of an element. | |
int | compare (T el1, T el2) |
Compares two elements according to their insertion index. | |
void | resize (int s) |
No operation; kept for backwards compatibility. | |
Private Member Functions | |
void | renumber () |
Renumbers the elements but keeps their order; useful after elements have been deleted. | |
Private Attributes | |
DynamicVector< T, long > | os |
Internal sorage. | |
long | c |
Next element to insert. |
Implementation of an ordered set based on boost::unordered_map.
OrderedSet< T, H >::OrderedSet | ( | ) | [inline] |
int OrderedSet< T, H >::compare | ( | T | el1, |
T | el2 | ||
) | [inline] |
void OrderedSet< T, H >::erase | ( | T | el | ) | [inline] |
Removes an element.
el | Element to remove. |
Definition at line 611 of file Set.h.
Referenced by CDNLSolver::clearFact().
long OrderedSet< T, H >::getInsertionIndex | ( | T | el | ) | [inline] |
Get the insertion index of an element.
The larger the insertion index, the later the element was added.
el | Element whose insertion index shall be retrieved. |
el
. Definition at line 620 of file Set.h.
Referenced by OrderedSet< IDAddress, SimpleHashIDAddress >::compare(), and CDNLSolver::getAssignmentOrderIndex().
void OrderedSet< T, H >::insert | ( | T | el | ) | [inline] |
Inserts a new element.
el | Element to insert. |
Definition at line 602 of file Set.h.
Referenced by CDNLSolver::setFact().
void OrderedSet< T, H >::renumber | ( | ) | [inline, private] |
Renumbers the elements but keeps their order; useful after elements have been deleted.
Definition at line 576 of file Set.h.
Referenced by OrderedSet< IDAddress, SimpleHashIDAddress >::insert().
void OrderedSet< T, H >::resize | ( | int | s | ) | [inline] |
No operation; kept for backwards compatibility.
Definition at line 636 of file Set.h.
Referenced by CDNLSolver::resizeVectors().
long OrderedSet< T, H >::c [private] |
Next element to insert.
Definition at line 573 of file Set.h.
Referenced by OrderedSet< IDAddress, SimpleHashIDAddress >::insert(), and OrderedSet< IDAddress, SimpleHashIDAddress >::renumber().
DynamicVector<T, long> OrderedSet< T, H >::os [private] |
Internal sorage.
Definition at line 571 of file Set.h.
Referenced by OrderedSet< IDAddress, SimpleHashIDAddress >::erase(), OrderedSet< IDAddress, SimpleHashIDAddress >::getInsertionIndex(), OrderedSet< IDAddress, SimpleHashIDAddress >::insert(), and OrderedSet< IDAddress, SimpleHashIDAddress >::renumber().