EWAH (Enhanced Word-Aligned Hybrid) compressed bitmap.
EWAH uses run-length encoding for efficient bitmap storage. Each bitmap consists of: - Uncompressed bit count (4 bytes) - Compressed word count (4 bytes) - Compressed words (8 bytes each) - Current RLW position (4 bytes)
Each Run Length Word (RLW) 64-bit layout (LSB to MSB): - Bit 0: running_bit (1 bit) - value of repeated words (0 or 1) - Bits 1-32: running_len (32 bits) - count of repeated words - Bits 33-63: literal_words (31 bits) - count of literal words following this RLW
| Method | __and__ |
Bitwise AND operation. |
| Method | __contains__ |
Check if a bit is set. |
| Method | __init__ |
Initialize EWAH bitmap. |
| Method | __len__ |
Return the number of set bits. |
| Method | __or__ |
Bitwise OR operation. |
| Method | __sub__ |
Bitwise subtraction (set difference). |
| Method | __xor__ |
Bitwise XOR operation. |
| Method | add |
Set a bit. |
| Method | encode |
Encode bitmap to EWAH compressed format. |
| Instance Variable | bit |
Undocumented |
| Instance Variable | bits |
Undocumented |
| Method | _decode |
Decode EWAH compressed bitmap data. |
Bitwise AND operation.
| Parameters | |
other:EWAHBitmap | Other bitmap to AND with |
| Returns | |
EWAHBitmap | New bitmap with AND result |
Bitwise OR operation.
| Parameters | |
other:EWAHBitmap | Other bitmap to OR with |
| Returns | |
EWAHBitmap | New bitmap with OR result |
Bitwise subtraction (set difference).
Returns bits that are in self but not in other. Equivalent to: self & ~other
| Parameters | |
other:EWAHBitmap | Bitmap to subtract |
| Returns | |
EWAHBitmap | New bitmap with bits in self but not in other |
Bitwise XOR operation.
| Parameters | |
other:EWAHBitmap | Other bitmap to XOR with |
| Returns | |
EWAHBitmap | New bitmap with XOR result |
Encode bitmap to EWAH compressed format.
| Returns | |
bytes | Compressed bitmap data including header, words, and RLW position |