Classes | |
class | BitList |
Implementation of the BitSet interface based on a linked list. More... | |
class | BitTree |
Implementation of the BitSet interface based on a binary tree. More... | |
class | DenseBitVector |
Implementation of the BitSet interface based on a dynamic vector. More... | |
class | Dummy |
Dummy implementation of the BitSet interface. More... | |
class | Iterator |
Declaration of the sps::Iterator interface. More... | |
class | RiceSet |
Implementation of the BitSet interface based on the sparse set representation by Preston Briggs and Linda Torczon (Rice University). More... | |
class | SparseBitVector |
Implementation of the BitSet interface based on a sparse vector. More... | |
class | SparseSetTest |
A class for running sparse set tests. More... | |
Functions | |
template<class T> | |
size_t | sizeof_bits () |
Template function to determine the size of a type in bits. | |
size_t | lg (size_t nValue) |
Returns the binary logarithm of nValue. |
size_t sps::lg | ( | size_t | nValue | ) | [inline] |
Returns the binary logarithm of nValue.
This function calculates the binary logarithm of nValue. It's an interger function and will therefore not always return the accurate value but the nearest integer not less than the binary logarithm of nValue. The runtime of sps::lg(n) is in O(lg(n)).
Examples:
size_t sps::sizeof_bits | ( | ) | [inline] |
Template function to determine the size of a type in bits.
This little helper function returns the size of a type in bits. The runtime of this function is 0, because the compiler can determine the result already at compile time.
Examples: