Collaboration diagram for BIT functions:
![]() |
Data Structures | |
struct | bm::bit_count_table< T > |
Structure to aid in counting bits table contains count of bits in 0-255 diapason of numbers. More... | |
struct | bm::block_set_table< T > |
Structure keeps all-left/right ON bits masks. More... | |
struct | bm::first_bit_table< T > |
Structure keeps index of first ON bit for every byte. More... | |
struct | bm::all_set< T > |
Structure carries pointer on bit block with all bits 1. More... | |
Defines | |
#define | BM_INCWORD_BITCOUNT(cnt, w) |
Functions | |
BMFORCEINLINE bm::id_t | bm::word_bitcount (bm::id_t w) |
bm::id_t | bm::word_bitcount64 (bm::id64_t w) |
template<typename T> | |
int | bm::wordcmp0 (T w1, T w2) |
Lexicographical comparison of two words as bit strings. Auxiliary implementation for testing and reference purposes. | |
template<typename T> | |
int | bm::wordcmp (T a, T b) |
Lexicographical comparison of two words as bit strings. Auxiliary implementation for testing and reference purposes. | |
void | bm::or_bit_block (unsigned *dest, unsigned bitpos, unsigned bitcount) |
Sets bits to 1 in the bitblock. | |
void | bm::sub_bit_block (unsigned *dest, unsigned bitpos, unsigned bitcount) |
SUB (AND NOT) bit interval to 1 in the bitblock. | |
void | bm::xor_bit_block (unsigned *dest, unsigned bitpos, unsigned bitcount) |
XOR bit interval to 1 in the bitblock. | |
template<typename T> | |
bm::id_t | bm::gap_bitset_and_count (const unsigned *block, const T *buf) |
Compute bitcount of bit block AND masked by GAP block. | |
template<typename T> | |
bm::id_t | bm::gap_bitset_and_any (const unsigned *block, const T *buf) |
Bitcount test of bit block AND masked by GAP block. | |
template<typename T> | |
bm::id_t | bm::gap_bitset_sub_count (const unsigned *block, const T *buf) |
Compute bitcount of bit block SUB masked by GAP block. | |
template<typename T> | |
bm::id_t | bm::gap_bitset_sub_any (const unsigned *block, const T *buf) |
Compute bitcount test of bit block SUB masked by GAP block. | |
template<typename T> | |
bm::id_t | bm::gap_bitset_xor_count (const unsigned *block, const T *buf) |
Compute bitcount of bit block XOR masked by GAP block. | |
template<typename T> | |
bm::id_t | bm::gap_bitset_xor_any (const unsigned *block, const T *buf) |
Compute bitcount test of bit block XOR masked by GAP block. | |
template<typename T> | |
bm::id_t | bm::gap_bitset_or_count (const unsigned *block, const T *buf) |
Compute bitcount of bit block OR masked by GAP block. | |
template<typename T> | |
bm::id_t | bm::gap_bitset_or_any (const unsigned *block, const T *buf) |
Compute bitcount test of bit block OR masked by GAP block. | |
void | bm::bit_block_set (bm::word_t *BMRESTRICT dst, bm::word_t value) |
Bitblock memset operation. | |
template<typename T> | |
int | bm::bitcmp (const T *buf1, const T *buf2, unsigned len) |
Lexicographical comparison of BIT buffers. | |
template<typename T> | |
T | bm::bit_convert_to_arr (T *BMRESTRICT dest, const unsigned *BMRESTRICT src, bm::id_t bits, unsigned dest_len) |
Convert bit block into an array of ints corresponding to 1 bits. | |
bm::id_t | bm::bit_block_calc_count (const bm::word_t *block, const bm::word_t *block_end) |
Bitcount for bit string. | |
bm::id_t | bm::bit_count_change (bm::word_t w) |
bm::id_t | bm::bit_block_calc_count_change (const bm::word_t *block, const bm::word_t *block_end) |
bm::id_t | bm::bit_block_calc_count_range (const bm::word_t *block, bm::word_t left, bm::word_t right) |
bm::id_t | bm::bit_block_any_range (const bm::word_t *block, bm::word_t left, bm::word_t right) |
template<typename T> | |
void | bm::bit_invert (T *start, T *end) |
bool | bm::is_bits_one (const bm::wordop_t *start, const bm::wordop_t *end) |
Returns "true" if all bits in the block are 1. | |
bool | bm::bit_is_all_zero (const bm::wordop_t *start, const bm::wordop_t *end) |
Returns "true" if all bits in the block are 0. | |
void | bm::bit_block_copy (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src) |
Bitblock copy operation. | |
void | bm::bit_block_and (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src) |
Plain bitblock AND operation. Function does not analyse availability of source and destination blocks. | |
unsigned | bm::bit_block_and_count (const bm::word_t *src1, const bm::word_t *src1_end, const bm::word_t *src2) |
Function ANDs two bitblocks and computes the bitcount. Function does not analyse availability of source blocks. | |
unsigned | bm::bit_block_and_any (const bm::word_t *src1, const bm::word_t *src1_end, const bm::word_t *src2) |
Function ANDs two bitblocks and tests for any bit. Function does not analyse availability of source blocks. | |
unsigned | bm::bit_block_xor_count (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Function XORs two bitblocks and computes the bitcount. Function does not analyse availability of source blocks. | |
unsigned | bm::bit_block_xor_any (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Function XORs two bitblocks and and tests for any bit. Function does not analyse availability of source blocks. | |
unsigned | bm::bit_block_sub_count (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Function SUBs two bitblocks and computes the bitcount. Function does not analyse availability of source blocks. | |
unsigned | bm::bit_block_sub_any (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Function SUBs two bitblocks and and tests for any bit. Function does not analyse availability of source blocks. | |
unsigned | bm::bit_block_or_count (const bm::word_t *src1, const bm::word_t *src1_end, const bm::word_t *src2) |
Function ORs two bitblocks and computes the bitcount. Function does not analyse availability of source blocks. | |
unsigned | bm::bit_block_or_any (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Function ORs two bitblocks and and tests for any bit. Function does not analyse availability of source blocks. | |
bm::word_t * | bm::bit_operation_and (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src) |
bitblock AND operation. | |
bm::id_t | bm::bit_operation_and_count (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Performs bitblock AND operation and calculates bitcount of the result. | |
bm::id_t | bm::bit_operation_and_any (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Performs bitblock AND operation test. | |
bm::id_t | bm::bit_operation_sub_count (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Performs bitblock SUB operation and calculates bitcount of the result. | |
bm::id_t | bm::bit_operation_sub_count_inv (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Performs inverted bitblock SUB operation and calculates bitcount of the result. | |
bm::id_t | bm::bit_operation_sub_any (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Performs bitblock test of SUB operation. | |
bm::id_t | bm::bit_operation_or_count (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Performs bitblock OR operation and calculates bitcount of the result. | |
bm::id_t | bm::bit_operation_or_any (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Performs bitblock OR operation test. | |
void | bm::bit_block_or (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src) |
Plain bitblock OR operation. Function does not analyse availability of source and destination blocks. | |
bm::word_t * | bm::bit_operation_or (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src) |
Block OR operation. Makes analysis if block is 0 or FULL. | |
void | bm::bit_block_sub (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src) |
Plain bitblock SUB (AND NOT) operation. Function does not analyse availability of source and destination blocks. | |
bm::word_t * | bm::bit_operation_sub (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src) |
bitblock SUB operation. | |
void | bm::bit_block_xor (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src) |
Plain bitblock XOR operation. Function does not analyse availability of source and destination blocks. | |
bm::word_t * | bm::bit_operation_xor (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src) |
bitblock XOR operation. | |
bm::id_t | bm::bit_operation_xor_count (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Performs bitblock XOR operation and calculates bitcount of the result. | |
bm::id_t | bm::bit_operation_xor_any (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src1_end, const bm::word_t *BMRESTRICT src2) |
Performs bitblock XOR operation test. | |
void | bm::bit_find_head_tail (const bm::word_t *data, unsigned *head_idx, unsigned *tail_idx) |
Inspects bit block for zero words at the head and at the end. | |
int | bm::bit_find_in_block (const bm::word_t *data, unsigned nbit, bm::id_t *prev) |
Searches for the next 1 bit in the BIT block. | |
template<typename T, typename B> | |
unsigned | bm::bit_list (T w, B *bits) |
Unpacks word into list of ON bit indexes. |
|
Value: cnt += \ bm::bit_count_table<true>::_count[(unsigned char)(w)] + \ bm::bit_count_table<true>::_count[(unsigned char)((w) >> 8)] + \ bm::bit_count_table<true>::_count[(unsigned char)((w) >> 16)] + \ bm::bit_count_table<true>::_count[(unsigned char)((w) >> 24)]; Definition at line 209 of file bmfunc.h. Referenced by bm::bit_block_and_count(), bm::bit_block_calc_count(), bm::bit_block_calc_count_change(), bm::bit_block_calc_count_range(), bm::bit_block_or_count(), bm::bit_block_sub_count(), bm::bit_block_xor_count(), bm::bit_count_change(), bm::bit_COUNT_B< W >::operator()(), bm::bit_COUNT_A< W >::operator()(), bm::bit_COUNT_SUB_BA< W >::operator()(), bm::bit_COUNT_SUB_AB< W >::operator()(), bm::bit_COUNT_OR< W >::operator()(), bm::bit_COUNT_XOR< W >::operator()(), bm::bit_COUNT_AND< W >::operator()(), and bm::bit_COUNT< W >::operator()(). |
|
Plain bitblock AND operation. Function does not analyse availability of source and destination blocks.
Definition at line 2960 of file bmfunc.h. References BMRESTRICT, and VECT_AND_ARR. Referenced by bm::bit_operation_and(). |
|
Function ANDs two bitblocks and tests for any bit. Function does not analyse availability of source blocks.
Definition at line 3029 of file bmfunc.h. Referenced by bm::bit_operation_and_any(). |
|
Function ANDs two bitblocks and computes the bitcount. Function does not analyse availability of source blocks.
Definition at line 2994 of file bmfunc.h. References BM_INCWORD_BITCOUNT, and VECT_BITCOUNT_AND. Referenced by bm::bit_operation_and_count(). |
|
Function calculates if there is any number of 1 bits in the given array of words in the range between left anf right bits (borders included). Make sure the addresses are aligned. Definition at line 2622 of file bmfunc.h. References BM_ASSERT. Referenced by bm::gap_bitset_and_any(), bm::gap_bitset_or_any(), bm::gap_bitset_sub_any(), and bm::gap_bitset_xor_any(). |
|
Bitcount for bit string. Function calculates number of 1 bits in the given array of words. Make sure the addresses are aligned. Definition at line 2373 of file bmfunc.h. References BM_ASSERT, BM_INCWORD_BITCOUNT, and bm::word_bitcount64(). Referenced by bm::bit_operation_or_count(), bm::bit_operation_sub_count(), bm::bit_operation_xor_count(), and bm::bvector< Alloc, MS >::stat(). |
|
Function calculates number of times when bit value changed (1-0 or 0-1) in the bit block. Definition at line 2465 of file bmfunc.h. References BM_ASSERT, BM_INCWORD_BITCOUNT, and bm::word_bitcount64(). |
|
Function calculates number of 1 bits in the given array of words in the range between left anf right bits (borders included) Make sure the addresses are aligned. Definition at line 2553 of file bmfunc.h. References BM_ASSERT, and BM_INCWORD_BITCOUNT. Referenced by bm::bvector< Alloc, MS >::count_range(), bm::gap_bitset_and_count(), bm::gap_bitset_or_count(), bm::gap_bitset_sub_count(), and bm::gap_bitset_xor_count(). |
|
Bitblock copy operation.
Definition at line 2940 of file bmfunc.h. References VECT_COPY_BLOCK. |
|
Plain bitblock OR operation. Function does not analyse availability of source and destination blocks.
Definition at line 3513 of file bmfunc.h. References BMRESTRICT, and VECT_OR_ARR. Referenced by bm::bit_operation_or(). |
|
Function ORs two bitblocks and and tests for any bit. Function does not analyse availability of source blocks.
Definition at line 3224 of file bmfunc.h. Referenced by bm::bit_operation_or_any(). |
|
Function ORs two bitblocks and computes the bitcount. Function does not analyse availability of source blocks.
Definition at line 3190 of file bmfunc.h. References BM_INCWORD_BITCOUNT, and VECT_BITCOUNT_OR. Referenced by bm::bit_operation_or_count(). |
|
Bitblock memset operation.
Definition at line 1790 of file bmfunc.h. Referenced by bm::gap_convert_to_bitset(). |
|
Plain bitblock SUB (AND NOT) operation. Function does not analyse availability of source and destination blocks.
Definition at line 3609 of file bmfunc.h. References BMRESTRICT, and VECT_SUB_ARR. Referenced by bm::bit_operation_sub(). |
|
Function SUBs two bitblocks and and tests for any bit. Function does not analyse availability of source blocks.
Definition at line 3160 of file bmfunc.h. Referenced by bm::bit_operation_sub_any(). |
|
Function SUBs two bitblocks and computes the bitcount. Function does not analyse availability of source blocks.
Definition at line 3126 of file bmfunc.h. References BM_INCWORD_BITCOUNT, and VECT_BITCOUNT_SUB. Referenced by bm::bit_operation_sub_count(). |
|
Plain bitblock XOR operation. Function does not analyse availability of source and destination blocks.
Definition at line 3705 of file bmfunc.h. References BMRESTRICT, and VECT_XOR_ARR. Referenced by bm::bit_operation_xor(). |
|
Function XORs two bitblocks and and tests for any bit. Function does not analyse availability of source blocks.
Definition at line 3095 of file bmfunc.h. Referenced by bm::bit_operation_xor_any(). |
|
Function XORs two bitblocks and computes the bitcount. Function does not analyse availability of source blocks.
Definition at line 3060 of file bmfunc.h. References BM_INCWORD_BITCOUNT, and VECT_BITCOUNT_XOR. Referenced by bm::bit_operation_xor_count(). |
|
Convert bit block into an array of ints corresponding to 1 bits.
Definition at line 2308 of file bmfunc.h. References BMRESTRICT. |
|
Function calculates number of times when bit value changed (1-0 or 0-1). For 001 result is 2 010 - 3 011 - 2 111 - 1 Definition at line 2447 of file bmfunc.h. References BM_INCWORD_BITCOUNT. |
|
Inspects bit block for zero words at the head and at the end. If there are no head-tail zeroes output parameters head_idx and tail_idx are going to be [0, bm::set_block_size-1]. If block is all-zero head_idx is -1
Definition at line 3837 of file bmfunc.h. References BM_ASSERT. |
|
Searches for the next 1 bit in the BIT block.
|
|
Function inverts block of bits Definition at line 2687 of file bmfunc.h. References VECT_INVERT_ARR. |
|
Returns "true" if all bits in the block are 0.
Definition at line 2729 of file bmfunc.h. Referenced by bm::bit_operation_or_any(), bm::bit_operation_sub_any(), bm::bit_operation_xor_any(), and bm::bvector< Alloc, MS >::compare(). |
|
Unpacks word into list of ON bit indexes.
Definition at line 3921 of file bmfunc.h. Referenced by bm::bvector< Alloc, MS >::enumerator::go_up(). |
|
bitblock AND operation.
Definition at line 3256 of file bmfunc.h. References bm::bit_block_and(), BM_ASSERT, IS_EMPTY_BLOCK, IS_FULL_BLOCK, and IS_VALID_ADDR. |
|
Performs bitblock AND operation test.
Definition at line 3344 of file bmfunc.h. References bm::bit_block_and_any(), and IS_EMPTY_BLOCK. |
|
Performs bitblock AND operation and calculates bitcount of the result.
Definition at line 3321 of file bmfunc.h. References bm::bit_block_and_count(), and IS_EMPTY_BLOCK. |
|
Block OR operation. Makes analysis if block is 0 or FULL.
Definition at line 3551 of file bmfunc.h. References bm::bit_block_or(), BM_ASSERT, FULL_BLOCK_ADDR, IS_FULL_BLOCK, and IS_VALID_ADDR. |
|
Performs bitblock OR operation test.
Definition at line 3482 of file bmfunc.h. References bm::bit_block_or_any(), bm::bit_is_all_zero(), and IS_EMPTY_BLOCK. |
|
Performs bitblock OR operation and calculates bitcount of the result.
Definition at line 3450 of file bmfunc.h. References bm::bit_block_calc_count(), bm::bit_block_or_count(), and IS_EMPTY_BLOCK. |
|
bitblock SUB operation.
Definition at line 3649 of file bmfunc.h. References bm::bit_block_sub(), BM_ASSERT, IS_FULL_BLOCK, and IS_VALID_ADDR. |
|
Performs bitblock test of SUB operation.
Definition at line 3420 of file bmfunc.h. References bm::bit_block_sub_any(), bm::bit_is_all_zero(), and IS_EMPTY_BLOCK. |
|
Performs bitblock SUB operation and calculates bitcount of the result.
Definition at line 3369 of file bmfunc.h. References bm::bit_block_calc_count(), bm::bit_block_sub_count(), and IS_EMPTY_BLOCK. Referenced by bm::bit_operation_sub_count_inv(). |
|
Performs inverted bitblock SUB operation and calculates bitcount of the result.
Definition at line 3399 of file bmfunc.h. References bm::bit_operation_sub_count(). |
|
bitblock XOR operation.
Definition at line 3745 of file bmfunc.h. References bm::bit_block_xor(), BM_ASSERT, and IS_VALID_ADDR. |
|
Performs bitblock XOR operation test.
Definition at line 3808 of file bmfunc.h. References bm::bit_block_xor_any(), bm::bit_is_all_zero(), and IS_EMPTY_BLOCK. |
|
Performs bitblock XOR operation and calculates bitcount of the result.
Definition at line 3783 of file bmfunc.h. References bm::bit_block_calc_count(), bm::bit_block_xor_count(), and IS_EMPTY_BLOCK. |
|
Lexicographical comparison of BIT buffers.
Definition at line 2138 of file bmfunc.h. References BM_ASSERT. Referenced by bm::bvector< Alloc, MS >::compare(). |
|
Bitcount test of bit block AND masked by GAP block.
Definition at line 1500 of file bmfunc.h. References bm::bit_block_any_range(), and BM_ASSERT. |
|
Compute bitcount of bit block AND masked by GAP block.
Definition at line 1464 of file bmfunc.h. References bm::bit_block_calc_count_range(), and BM_ASSERT. |
|
Compute bitcount test of bit block OR masked by GAP block.
Definition at line 1739 of file bmfunc.h. References bm::bit_block_any_range(), and BM_ASSERT. |
|
Compute bitcount of bit block OR masked by GAP block.
Definition at line 1692 of file bmfunc.h. References bm::bit_block_calc_count_range(), and BM_ASSERT. |
|
Compute bitcount test of bit block SUB masked by GAP block.
Definition at line 1572 of file bmfunc.h. References bm::bit_block_any_range(), and BM_ASSERT. |
|
Compute bitcount of bit block SUB masked by GAP block.
Definition at line 1539 of file bmfunc.h. References bm::bit_block_calc_count_range(), and BM_ASSERT. |
|
Compute bitcount test of bit block XOR masked by GAP block.
Definition at line 1649 of file bmfunc.h. References bm::bit_block_any_range(), and BM_ASSERT. |
|
Compute bitcount of bit block XOR masked by GAP block.
Definition at line 1610 of file bmfunc.h. References bm::bit_block_calc_count_range(), and BM_ASSERT. |
|
Returns "true" if all bits in the block are 1.
|
|
Sets bits to 1 in the bitblock.
Definition at line 1149 of file bmfunc.h. Referenced by bm::gap_add_to_bitset(). |
|
SUB (AND NOT) bit interval to 1 in the bitblock.
Definition at line 1211 of file bmfunc.h. Referenced by bm::gap_and_to_bitset(), and bm::gap_sub_to_bitset(). |
|
Returns bit count |
|
Function calculates number of 1 bits in 64-bit word. Definition at line 234 of file bmfunc.h. Referenced by bm::bit_block_calc_count(), and bm::bit_block_calc_count_change(). |
|
Lexicographical comparison of two words as bit strings. Auxiliary implementation for testing and reference purposes.
|
|
Lexicographical comparison of two words as bit strings. Auxiliary implementation for testing and reference purposes.
|
|
XOR bit interval to 1 in the bitblock.
Definition at line 1273 of file bmfunc.h. Referenced by bm::gap_xor_to_bitset(). |