EWAHBoolArray 0.8.0
A compressed bitmap class in C++
|
A dynamic bitset implementation. More...
#include <boolarray.h>
Public Types | |
enum | { wordinbits = sizeof(uword) * 8 } |
Public Member Functions | |
BoolArray (const size_t n, const uword initval=0) | |
BoolArray (const BoolArray &ba) | |
size_t | sizeInBytes () const |
void | read (std::istream &in) |
void | readBuffer (std::istream &in, const size_t size) |
void | setSizeInBits (const size_t sizeib) |
void | write (std::ostream &out) |
void | write (std::ostream &out, const size_t numberofbits) const |
void | writeBuffer (std::ostream &out, const size_t numberofbits) const |
size_t | sizeOnDisk () const |
BoolArray & | operator= (const BoolArray &x) |
bool | operator== (const BoolArray &x) const |
bool | operator!= (const BoolArray &x) const |
void | setWord (const size_t pos, const uword val) |
void | addWord (const uword val) |
uword | getWord (const size_t pos) const |
void | set (const size_t pos) |
set to true (whether it was already set to true or not) | |
void | unset (const size_t pos) |
set to false (whether it was already set to false or not) | |
bool | get (const size_t pos) const |
true of false? (set or unset) | |
void | reset () |
set all bits to 0 | |
size_t | sizeInBits () const |
void | logicaland (const BoolArray &ba, BoolArray &out) const |
Computes the logical and and writes to the provided BoolArray (out). | |
BoolArray | logicaland (const BoolArray &a) const |
Computes the logical and and return the result. | |
void | inplace_logicaland (const BoolArray &ba) |
void | logicalandnot (const BoolArray &ba, BoolArray &out) const |
Computes the logical andnot and writes to the provided BoolArray (out). | |
BoolArray | logicalandnot (const BoolArray &a) const |
Computes the logical andnot and return the result. | |
void | inplace_logicalandnot (const BoolArray &ba) |
void | logicalor (const BoolArray &ba, BoolArray &out) const |
Computes the logical or and writes to the provided BoolArray (out). | |
BoolArray | logicalor (const BoolArray &a) const |
Computes the logical or and return the result. | |
void | inplace_logicalor (const BoolArray &ba) |
void | logicalxor (const BoolArray &ba, BoolArray &out) const |
Computes the logical xor and writes to the provided BoolArray (out). | |
BoolArray | logicalxor (const BoolArray &a) const |
Computes the logical xor and return the result. | |
void | inplace_logicalxor (const BoolArray &ba) |
void | logicalnot (BoolArray &out) const |
Computes the logical not and writes to the provided BoolArray (out). | |
BoolArray | logicalandnot () const |
Computes the logical not and return the result. | |
void | inplace_logicalnot () |
size_t | numberOfOnes () const |
Returns the number of bits set to the value 1. | |
void | printout (std::ostream &o=std::cout) |
void | makeSameSize (BoolArray &a) |
Make sure the two bitmaps have the same size (padding with zeroes if necessary). | |
void | setToSize (const BoolArray &a) |
Make sure the current bitmap has the size of the provided bitmap. | |
size_t | padWithZeroes (const size_t totalbits) |
make sure the size of the array is totalbits bits by padding with zeroes. | |
void | append (const BoolArray &a) |
std::vector< size_t > | toArray () const |
operator std::string () const | |
Transform into a string that presents a list of set bits. | |
Static Public Member Functions | |
static BoolArray | bitmapOf (size_t n,...) |
A dynamic bitset implementation.
(without compression).
Definition at line 19 of file boolarray.h.
anonymous enum |
Definition at line 389 of file boolarray.h.
|
inline |
Definition at line 21 of file boolarray.h.
|
inline |
Definition at line 25 of file boolarray.h.
|
inline |
Definition at line 27 of file boolarray.h.
|
inline |
Definition at line 173 of file boolarray.h.
|
inline |
Definition at line 117 of file boolarray.h.
void ewah::BoolArray< uword >::append | ( | const BoolArray< uword > & | a | ) |
Definition at line 474 of file boolarray.h.
|
inlinestatic |
Definition at line 29 of file boolarray.h.
|
inline |
true of false? (set or unset)
Definition at line 154 of file boolarray.h.
|
inline |
Definition at line 124 of file boolarray.h.
|
inline |
Definition at line 198 of file boolarray.h.
|
inline |
Definition at line 230 of file boolarray.h.
|
inline |
Definition at line 327 of file boolarray.h.
|
inline |
Definition at line 270 of file boolarray.h.
|
inline |
Definition at line 304 of file boolarray.h.
|
inline |
Computes the logical and and return the result.
The current bitmaps is unchanged.
Definition at line 192 of file boolarray.h.
|
inline |
Computes the logical and and writes to the provided BoolArray (out).
The current bitmaps is unchanged.
Definition at line 179 of file boolarray.h.
|
inline |
Computes the logical not and return the result.
The current bitmaps is unchanged.
Definition at line 321 of file boolarray.h.
|
inline |
Computes the logical andnot and return the result.
The current bitmaps is unchanged.
Definition at line 224 of file boolarray.h.
|
inline |
Computes the logical andnot and writes to the provided BoolArray (out).
The current bitmaps is unchanged.
Definition at line 209 of file boolarray.h.
|
inline |
Computes the logical not and writes to the provided BoolArray (out).
The current bitmaps is unchanged.
Definition at line 310 of file boolarray.h.
|
inline |
Computes the logical or and return the result.
The current bitmaps is unchanged.
Definition at line 264 of file boolarray.h.
|
inline |
Computes the logical or and writes to the provided BoolArray (out).
The current bitmaps is unchanged.
Definition at line 242 of file boolarray.h.
|
inline |
Computes the logical xor and return the result.
The current bitmaps is unchanged.
Definition at line 298 of file boolarray.h.
|
inline |
Computes the logical xor and writes to the provided BoolArray (out).
The current bitmaps is unchanged.
Definition at line 276 of file boolarray.h.
|
inline |
Make sure the two bitmaps have the same size (padding with zeroes if necessary).
It has constant running time complexity.
Definition at line 358 of file boolarray.h.
|
inline |
Returns the number of bits set to the value 1.
The running time complexity is proportional to the size of the bitmap.
This is sometimes called the cardinality.
Definition at line 340 of file boolarray.h.
|
inline |
Transform into a string that presents a list of set bits.
The running time is linear in the size of the bitmap.
Definition at line 408 of file boolarray.h.
|
inline |
Definition at line 108 of file boolarray.h.
|
inline |
Definition at line 93 of file boolarray.h.
|
inline |
Definition at line 99 of file boolarray.h.
|
inline |
make sure the size of the array is totalbits bits by padding with zeroes.
returns the number of words added (storage cost increase)
Definition at line 376 of file boolarray.h.
|
inline |
Definition at line 348 of file boolarray.h.
|
inline |
Definition at line 41 of file boolarray.h.
|
inline |
Definition at line 52 of file boolarray.h.
|
inline |
set all bits to 0
Definition at line 165 of file boolarray.h.
|
inline |
set to true (whether it was already set to true or not)
Definition at line 134 of file boolarray.h.
|
inline |
Definition at line 61 of file boolarray.h.
|
inline |
Make sure the current bitmap has the size of the provided bitmap.
Definition at line 367 of file boolarray.h.
|
inline |
Definition at line 110 of file boolarray.h.
|
inline |
Definition at line 171 of file boolarray.h.
|
inline |
Definition at line 39 of file boolarray.h.
|
inline |
Definition at line 87 of file boolarray.h.
|
inline |
Definition at line 391 of file boolarray.h.
|
inline |
set to false (whether it was already set to false or not)
Definition at line 145 of file boolarray.h.
|
inline |
Definition at line 63 of file boolarray.h.
|
inline |
Definition at line 65 of file boolarray.h.
|
inline |
Definition at line 76 of file boolarray.h.