Static Value-Flow Analysis
|
#include <SparseBitVector.h>
Public Types | |
enum | { BITWORD_SIZE = sizeof(BitWord) * CHAR_BIT , BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE , BITS_PER_ELEMENT = ElementSize } |
using | BitWord = unsigned long |
using | size_type = unsigned |
Public Member Functions | |
SparseBitVectorElement (unsigned Idx) | |
bool | operator== (const SparseBitVectorElement &RHS) const |
bool | operator!= (const SparseBitVectorElement &RHS) const |
BitWord | word (unsigned Idx) const |
unsigned | index () const |
bool | empty () const |
void | set (unsigned Idx) |
bool | test_and_set (unsigned Idx) |
void | reset (unsigned Idx) |
bool | test (unsigned Idx) const |
size_type | count () const |
int | find_first () const |
find_first - Returns the index of the first set bit. | |
int | find_last () const |
find_last - Returns the index of the last set bit. | |
int | find_next (unsigned Curr) const |
bool | unionWith (const SparseBitVectorElement &RHS) |
bool | intersects (const SparseBitVectorElement &RHS) const |
bool | intersectWith (const SparseBitVectorElement &RHS, bool &BecameZero) |
bool | intersectWithComplement (const SparseBitVectorElement &RHS, bool &BecameZero) |
void | intersectWithComplement (const SparseBitVectorElement &RHS1, const SparseBitVectorElement &RHS2, bool &BecameZero) |
Private Member Functions | |
SparseBitVectorElement ()=default | |
Private Attributes | |
unsigned | ElementIndex = 0 |
BitWord | Bits [BITWORDS_PER_ELEMENT] = {0} |
Friends | |
class | SVFIRWriter |
class | SVFIRReader |
SparseBitVector is an implementation of a bitvector that is sparse by only storing the elements that have non-zero bits set. In order to make this fast for the most common cases, SparseBitVector is implemented as a linked list of SparseBitVectorElements. We maintain a pointer to the last SparseBitVectorElement accessed (in the form of a list iterator), in order to make multiple in-order test/set constant time after the first one is executed. Note that using vectors to store SparseBitVectorElement's does not work out very well because it causes insertion in the middle to take enormous amounts of time with a large amount of bits. Other structures that have better worst cases for insertion in the middle (various balanced trees, etc) do not perform as well in practice as a linked list with this iterator kept up to date. They are also significantly more memory intensive.
Definition at line 259 of file SparseBitVector.h.
using SVF::SparseBitVectorElement< ElementSize >::BitWord = unsigned long |
Definition at line 265 of file SparseBitVector.h.
using SVF::SparseBitVectorElement< ElementSize >::size_type = unsigned |
Definition at line 266 of file SparseBitVector.h.
Enumerator | |
---|---|
BITWORD_SIZE | |
BITWORDS_PER_ELEMENT | |
BITS_PER_ELEMENT |
Definition at line 267 of file SparseBitVector.h.
|
privatedefault |
|
inlineexplicit |
Definition at line 284 of file SparseBitVector.h.
|
inline |
Definition at line 348 of file SparseBitVector.h.
|
inline |
Definition at line 314 of file SparseBitVector.h.
|
inline |
find_first - Returns the index of the first set bit.
Definition at line 357 of file SparseBitVector.h.
|
inline |
find_last - Returns the index of the last set bit.
Definition at line 367 of file SparseBitVector.h.
|
inline |
find_next - Returns the index of the next set bit starting from the "Curr" bit. Returns -1 if the next set bit is not found.
Definition at line 382 of file SparseBitVector.h.
|
inline |
Definition at line 309 of file SparseBitVector.h.
|
inline |
Definition at line 422 of file SparseBitVector.h.
|
inline |
Definition at line 434 of file SparseBitVector.h.
|
inline |
Definition at line 459 of file SparseBitVector.h.
|
inline |
Definition at line 483 of file SparseBitVector.h.
|
inline |
Definition at line 297 of file SparseBitVector.h.
|
inline |
Definition at line 287 of file SparseBitVector.h.
|
inline |
Definition at line 338 of file SparseBitVector.h.
|
inline |
Definition at line 322 of file SparseBitVector.h.
|
inline |
Definition at line 343 of file SparseBitVector.h.
|
inline |
Definition at line 327 of file SparseBitVector.h.
|
inline |
Definition at line 407 of file SparseBitVector.h.
|
inline |
Definition at line 303 of file SparseBitVector.h.
|
friend |
Definition at line 262 of file SparseBitVector.h.
|
friend |
Definition at line 261 of file SparseBitVector.h.
|
private |
Definition at line 279 of file SparseBitVector.h.
|
private |
Definition at line 278 of file SparseBitVector.h.