dlvhex
2.5.0
|
Data Structures | |
struct | bm::gap_len_table< T > |
Default GAP lengths table. More... | |
struct | bm::gap_len_table_min< T > |
Alternative GAP lengths table. Good for for memory saver mode and very sparse bitsets. More... | |
Functions | |
template<typename T > | |
unsigned | bm::gap_test (const T *buf, unsigned pos) |
Tests if bit = pos is true. | |
template<typename T > | |
unsigned | bm::gap_bit_count (const T *buf, unsigned dsize=0) |
Calculates number of bits ON in GAP buffer. | |
template<typename T > | |
int | bm::gapcmp (const T *buf1, const T *buf2) |
Lexicographical comparison of GAP buffers. | |
template<typename T , class F > | |
unsigned | bm::gap_buff_any_op (const T *BMRESTRICT vect1, unsigned vect1_mask, const T *BMRESTRICT vect2, unsigned vect2_mask, F f) |
Abstract distance test operation for GAP buffers. Receives functor F as a template argument. | |
template<typename T , class F > | |
unsigned | bm::gap_buff_count_op (const T *vect1, const T *vect2, F f) |
Abstract distance(similarity) operation for GAP buffers. Receives functor F as a template argument. | |
template<typename T > | |
unsigned | bm::gap_set_value (unsigned val, T *BMRESTRICT buf, unsigned pos, unsigned *BMRESTRICT is_set) |
Sets or clears bit in the GAP buffer. | |
template<typename T > | |
unsigned | bm::gap_add_value (T *buf, T pos) |
Add new value to the end of GAP buffer. | |
template<typename T > | |
unsigned | bm::gap_set_array (T *buf, const T *arr, unsigned len) |
Convert array to GAP buffer. | |
template<typename T > | |
unsigned | bm::bit_array_compute_gaps (const T *arr, unsigned len) |
Compute number of GAPs in bit-array. | |
template<typename T > | |
int | bm::gap_find_in_block (const T *buf, unsigned nbit, bm::id_t *prev) |
Searches for the next 1 bit in the GAP block. | |
template<typename T > | |
void | bm::gap_sub_to_bitset (unsigned *BMRESTRICT dest, const T *BMRESTRICT buf) |
SUB (AND NOT) GAP block to bitblock. | |
template<typename T > | |
void | bm::gap_xor_to_bitset (unsigned *BMRESTRICT dest, const T *BMRESTRICT buf) |
XOR GAP block to bitblock. | |
template<typename T > | |
void | bm::gap_add_to_bitset_l (unsigned *dest, const T *buf, unsigned buf_len) |
Adds(OR) GAP block to bitblock. | |
template<typename T > | |
void | bm::gap_add_to_bitset (unsigned *dest, const T *buf) |
Adds(OR) GAP block to bitblock. | |
template<typename T > | |
void | bm::gap_and_to_bitset (unsigned *dest, const T *buf) |
ANDs GAP block to bitblock. | |
template<typename T > | |
void | bm::gap_convert_to_bitset (unsigned *dest, const T *buf) |
GAP block to bitblock conversion. | |
template<typename T > | |
void | bm::gap_convert_to_bitset_l (unsigned *dest, const T *buf, unsigned buf_len) |
GAP block to bitblock conversion. | |
template<typename T > | |
void | bm::gap_convert_to_bitset (unsigned *dest, const T *buf, unsigned dest_len) |
GAP block to bitblock conversion. | |
template<typename T > | |
unsigned * | bm::gap_convert_to_bitset_smart (unsigned *dest, const T *buf, id_t set_max) |
Smart GAP block to bitblock conversion. | |
template<typename T > | |
unsigned | bm::gap_control_sum (const T *buf) |
Calculates sum of all words in GAP block. (For debugging purposes) | |
template<class T > | |
void | bm::gap_set_all (T *buf, unsigned set_max, unsigned value) |
Sets all bits to 0 or 1 (GAP) | |
template<class T > | |
void | bm::gap_init_range_block (T *buf, T from, T to, T value, unsigned set_max) |
Init gap block so it has block in it (can be whole block) | |
template<typename T > | |
void | bm::gap_invert (T *buf) |
Inverts all bits in the GAP buffer. | |
template<typename T > | |
bool | bm::gap_is_all_zero (const T *buf, unsigned set_max) |
Temporary inverts all bits in the GAP buffer. | |
template<typename T > | |
bool | bm::gap_is_all_one (const T *buf, unsigned set_max) |
Checks if GAP block is all-one. | |
template<typename T > | |
T | bm::gap_length (const T *buf) |
Returs GAP block length. | |
template<typename T > | |
unsigned | bm::gap_capacity (const T *buf, const T *glevel_len) |
Returs GAP block capacity. | |
template<typename T > | |
unsigned | bm::gap_limit (const T *buf, const T *glevel_len) |
Returs GAP block capacity limit. | |
template<typename T > | |
unsigned | bm::gap_level (const T *buf) |
Returs GAP blocks capacity level. | |
template<typename T > | |
void | bm::set_gap_level (T *buf, unsigned level) |
Sets GAP block capacity level. | |
template<typename T > | |
int | bm::gap_calc_level (int len, const T *glevel_len) |
Calculates GAP block capacity level. | |
template<typename T > | |
unsigned | bm::gap_free_elements (const T *buf, const T *glevel_len) |
Returns number of free elements in GAP block array. Difference between GAP block capacity on this level and actual GAP length. | |
template<typename T > | |
unsigned | bm::bit_convert_to_gap (T *BMRESTRICT dest, const unsigned *BMRESTRICT src, bm::id_t bits, unsigned dest_len) |
Converts bit block to GAP. | |
template<class T , class F > | |
void | bm::for_each_gap_dbit (const T *buf, F &func) |
Iterate gap block as delta-bits with a functor. | |
template<typename D , typename T > | |
D | bm::gap_convert_to_arr (D *BMRESTRICT dest, const T *BMRESTRICT buf, unsigned dest_len, bool invert=false) |
Convert gap block into array of ints corresponding to 1 bits. | |
BMFORCEINLINE gap_word_t * | bm::gap_operation_and (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2, gap_word_t *BMRESTRICT tmp_buf, unsigned &dsize) |
GAP AND operation. | |
BMFORCEINLINE unsigned | bm::gap_operation_any_and (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2) |
GAP AND operation test. | |
BMFORCEINLINE unsigned | bm::gap_count_and (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2) |
GAP bitcount AND operation test. | |
BMFORCEINLINE gap_word_t * | bm::gap_operation_xor (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2, gap_word_t *BMRESTRICT tmp_buf, unsigned &dsize) |
GAP XOR operation. | |
BMFORCEINLINE unsigned | bm::gap_operation_any_xor (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2) |
GAP XOR operation test. | |
BMFORCEINLINE unsigned | bm::gap_count_xor (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2) |
GAP bitcount XOR operation test. | |
gap_word_t * | bm::gap_operation_or (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2, gap_word_t *BMRESTRICT tmp_buf, unsigned &dsize) |
GAP OR operation. | |
BMFORCEINLINE unsigned | bm::gap_count_or (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2) |
GAP bitcount OR operation test. | |
gap_word_t * | bm::gap_operation_sub (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2, gap_word_t *BMRESTRICT tmp_buf, unsigned &dsize) |
GAP SUB (AND NOT) operation. | |
BMFORCEINLINE unsigned | bm::gap_operation_any_sub (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2) |
GAP SUB operation test. | |
BMFORCEINLINE unsigned | bm::gap_count_sub (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2) |
GAP bitcount SUB (AND NOT) operation test. | |
template<typename T > | |
unsigned | bm::gap_overhead (const T *length, const T *length_end, const T *glevel_len) |
Convert bit block into an array of ints corresponding to 1 bits. | |
template<typename T > | |
bool | bm::improve_gap_levels (const T *length, const T *length_end, T *glevel_len) |
Finds optimal gap blocks lengths. |
GAP functions implement different opereations on GAP compressed blocks and serve as a minimal building blocks.
unsigned bm::bit_array_compute_gaps | ( | const T * | arr, |
unsigned | len | ||
) |
unsigned bm::bit_convert_to_gap | ( | T *BMRESTRICT | dest, |
const unsigned *BMRESTRICT | src, | ||
bm::id_t | bits, | ||
unsigned | dest_len | ||
) |
Converts bit block to GAP.
dest | - Destinatio GAP buffer. |
src | - Source bitblock buffer. |
bits | - Number of bits to convert. |
dest_len | - length of the dest. buffer. |
Definition at line 2533 of file bmfunc.h.
Referenced by bm::blocks_manager< Alloc >::block_opt_func::operator()(), and bm::serializer< BV >::serialize().
void bm::for_each_gap_dbit | ( | const T * | buf, |
F & | func | ||
) |
void bm::gap_add_to_bitset | ( | unsigned * | dest, |
const T * | buf | ||
) |
Adds(OR) GAP block to bitblock.
dest | - bitblock buffer pointer. |
buf | - GAP buffer pointer. |
Definition at line 1774 of file bmfunc.h.
References bm::gap_add_to_bitset_l().
Referenced by bm::deserializer< BV, DEC >::deserialize_gap(), and bm::gap_convert_to_bitset().
void bm::gap_add_to_bitset_l | ( | unsigned * | dest, |
const T * | buf, | ||
unsigned | buf_len | ||
) |
Adds(OR) GAP block to bitblock.
dest | - bitblock buffer pointer. |
buf | - GAP buffer pointer. |
buf_len | - GAP buffer length |
Definition at line 1744 of file bmfunc.h.
References bm::or_bit_block().
Referenced by bm::deserializer< BV, DEC >::deserialize_gap(), bm::gap_add_to_bitset(), and bm::gap_convert_to_bitset_l().
unsigned bm::gap_add_value | ( | T * | buf, |
T | pos | ||
) |
Add new value to the end of GAP buffer.
buf | - GAP buffer. |
pos | - Index of bit to set. |
Definition at line 1272 of file bmfunc.h.
References bm::gap_max_bits.
Referenced by bm::deseriaizer_base< DEC >::read_gap_block().
void bm::gap_and_to_bitset | ( | unsigned * | dest, |
const T * | buf | ||
) |
ANDs GAP block to bitblock.
dest | - bitblock buffer pointer. |
buf | - GAP buffer pointer. |
Definition at line 1788 of file bmfunc.h.
References bm::sub_bit_block().
unsigned bm::gap_bit_count | ( | const T * | buf, |
unsigned | dsize = 0 |
||
) |
Calculates number of bits ON in GAP buffer.
buf | - GAP buffer pointer. |
dsize | - buffer size |
Definition at line 689 of file bmfunc.h.
Referenced by bm::blocks_manager< Alloc >::block_bitcount(), bm::combine_count_operation_with_block(), bm::bvector< Alloc >::combine_operation_with_block(), bm::serializer< BV >::encode_gap_block(), and print_stat().
unsigned bm::gap_buff_any_op | ( | const T *BMRESTRICT | vect1, |
unsigned | vect1_mask, | ||
const T *BMRESTRICT | vect2, | ||
unsigned | vect2_mask, | ||
F | f | ||
) |
Abstract distance test operation for GAP buffers. Receives functor F as a template argument.
vect1 | - operand 1 GAP encoded buffer. |
vect1_mask | - XOR mask for starting bitflag for vector1 can be 0 or 1 (1 inverts the vector) |
vect2 | - operand 2 GAP encoded buffer. |
vect2_mask | - same as vect1_mask |
f | - operation functor. |
Definition at line 1026 of file bmfunc.h.
References bm::gap_max_bits.
Referenced by bm::gap_operation_any_and(), bm::gap_operation_any_sub(), and bm::gap_operation_any_xor().
unsigned bm::gap_buff_count_op | ( | const T * | vect1, |
const T * | vect2, | ||
F | f | ||
) |
Abstract distance(similarity) operation for GAP buffers. Receives functor F as a template argument.
vect1 | - operand 1 GAP encoded buffer. |
vect2 | - operand 2 GAP encoded buffer. |
f | - operation functor. |
Definition at line 1095 of file bmfunc.h.
References bm::gap_max_bits.
Referenced by bm::gap_count_and(), bm::gap_count_or(), bm::gap_count_sub(), and bm::gap_count_xor().
int bm::gap_calc_level | ( | int | len, |
const T * | glevel_len | ||
) | [inline] |
Calculates GAP block capacity level.
len | - GAP buffer length. |
glevel_len | - GAP lengths table |
Definition at line 2461 of file bmfunc.h.
References bm::gap_levels.
Referenced by bm::bvector< Alloc >::combine_operation_with_block(), bm::iterator_deserializer< BV, SerialIterator >::deserialize(), bm::deserializer< BV, DEC >::deserialize_gap(), bm::gap_overhead(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), and bm::blocks_manager< Alloc >::block_opt_func::operator()().
unsigned bm::gap_capacity | ( | const T * | buf, |
const T * | glevel_len | ||
) |
Returs GAP block capacity.
buf | - GAP buffer pointer. |
Definition at line 2403 of file bmfunc.h.
Referenced by bm::bvector< Alloc >::calc_stat(), bm::mem_alloc< BA, PA >::free_gap_block(), bm::gap_free_elements(), and bm::blocks_manager< Alloc >::block_opt_func::operator()().
unsigned bm::gap_control_sum | ( | const T * | buf | ) |
Calculates sum of all words in GAP block. (For debugging purposes)
buf | - GAP buffer pointer. |
Definition at line 2229 of file bmfunc.h.
Referenced by print_stat().
D bm::gap_convert_to_arr | ( | D *BMRESTRICT | dest, |
const T *BMRESTRICT | buf, | ||
unsigned | dest_len, | ||
bool | invert = false |
||
) |
Convert gap block into array of ints corresponding to 1 bits.
Definition at line 2678 of file bmfunc.h.
Referenced by bm::bvector< Alloc >::combine_operation_with_block(), bm::serializer< BV >::encode_gap_block(), and bm::random_subset< BV >::get_subset().
void bm::gap_convert_to_bitset | ( | unsigned * | dest, |
const T * | buf | ||
) |
GAP block to bitblock conversion.
dest | - bitblock buffer pointer. |
buf | - GAP buffer pointer. |
Definition at line 2155 of file bmfunc.h.
References bm::bit_block_set(), and bm::gap_add_to_bitset().
Referenced by bm::combine_any_operation_with_block(), bm::combine_count_operation_with_block(), bm::bvector< Alloc >::compare(), bm::miniset< A, N >::convert_buf(), bm::blocks_manager< Alloc >::copy_bit_block(), bm::iterator_deserializer< BV, SerialIterator >::deserialize(), bm::deserializer< BV, DEC >::deserialize_gap(), bm::gap_convert_to_bitset_smart(), bm::random_subset< BV >::get_subset(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), and bm::blocks_manager< Alloc >::set_gap_block().
void bm::gap_convert_to_bitset | ( | unsigned * | dest, |
const T * | buf, | ||
unsigned | dest_len | ||
) |
GAP block to bitblock conversion.
dest | - bitblock buffer pointer. |
buf | - GAP buffer pointer. |
dest_size | - length of the destination buffer. |
Definition at line 2186 of file bmfunc.h.
References bm::gap_add_to_bitset().
void bm::gap_convert_to_bitset_l | ( | unsigned * | dest, |
const T * | buf, | ||
unsigned | buf_len | ||
) |
GAP block to bitblock conversion.
dest | - bitblock buffer pointer. |
buf | - GAP buffer pointer. |
Definition at line 2169 of file bmfunc.h.
References bm::bit_block_set(), and bm::gap_add_to_bitset_l().
Referenced by bm::blocks_manager< Alloc >::convert_gap2bitset().
unsigned * bm::gap_convert_to_bitset_smart | ( | unsigned * | dest, |
const T * | buf, | ||
id_t | set_max | ||
) |
Smart GAP block to bitblock conversion.
Checks if GAP block is ALL-ZERO or ALL-ON. In those cases returns pointer on special static bitblocks.
dest | - bitblock buffer pointer. |
buf | - GAP buffer pointer. |
set_max | - max possible bitset length |
Definition at line 2207 of file bmfunc.h.
References FULL_BLOCK_ADDR, and bm::gap_convert_to_bitset().
Referenced by bm::bvector< Alloc >::combine_operation_with_block().
BMFORCEINLINE unsigned bm::gap_count_and | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2 | ||
) |
GAP bitcount AND operation test.
vect1 | - operand 1 |
vect2 | - operand 2 |
Definition at line 3238 of file bmfunc.h.
References bm::and_op(), and bm::gap_buff_count_op().
Referenced by bm::combine_count_and_operation_with_block(), and bm::combine_count_operation_with_block().
BMFORCEINLINE unsigned bm::gap_count_or | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2 | ||
) |
GAP bitcount OR operation test.
vect1 | - operand 1 |
vect2 | - operand 2 |
Definition at line 3349 of file bmfunc.h.
References bm::gap_buff_count_op(), and bm::or_op().
Referenced by bm::combine_count_operation_with_block().
BMFORCEINLINE unsigned bm::gap_count_sub | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2 | ||
) |
GAP bitcount SUB (AND NOT) operation test.
vect1 | - operand 1 |
vect2 | - operand 2 |
Definition at line 3416 of file bmfunc.h.
References bm::gap_buff_count_op(), and bm::sub_op().
Referenced by bm::combine_count_operation_with_block().
BMFORCEINLINE unsigned bm::gap_count_xor | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2 | ||
) |
GAP bitcount XOR operation test.
vect1 | - operand 1 |
vect2 | - operand 2 |
Definition at line 3304 of file bmfunc.h.
References bm::gap_buff_count_op(), and bm::xor_op().
Referenced by bm::combine_count_operation_with_block().
int bm::gap_find_in_block | ( | const T * | buf, |
unsigned | nbit, | ||
bm::id_t * | prev | ||
) |
Searches for the next 1 bit in the GAP block.
buf | - GAP buffer |
nbit | - bit index to start checking from. |
prev | - returns previously checked value |
Definition at line 1447 of file bmfunc.h.
References bm::gap_bfind(), and bm::gap_max_bits.
Referenced by bm::bvector< Alloc >::check_or_next(), and bm::bvector< Alloc >::check_or_next_extract().
unsigned bm::gap_free_elements | ( | const T * | buf, |
const T * | glevel_len | ||
) | [inline] |
Returns number of free elements in GAP block array. Difference between GAP block capacity on this level and actual GAP length.
buf | - GAP buffer pointer glevel_len - GAP lengths table |
Definition at line 2482 of file bmfunc.h.
References bm::gap_capacity(), and bm::gap_length().
void bm::gap_init_range_block | ( | T * | buf, |
T | from, | ||
T | to, | ||
T | value, | ||
unsigned | set_max | ||
) |
Init gap block so it has block in it (can be whole block)
buf | - GAP buffer pointer. |
from | - one block start |
to | - one block end |
value | - (block value)1 or 0 |
set_max | - max possible bitset length |
Definition at line 2281 of file bmfunc.h.
References bm::gap_set_all().
void bm::gap_invert | ( | T * | buf | ) |
Inverts all bits in the GAP buffer.
buf | - GAP buffer pointer. |
Definition at line 2331 of file bmfunc.h.
Referenced by bm::gap_operation_or(), bm::blocks_manager< Alloc >::block_invert_func::operator()(), and bm::deseriaizer_base< DEC >::read_gap_block().
bool bm::gap_is_all_one | ( | const T * | buf, |
unsigned | set_max | ||
) |
Checks if GAP block is all-one.
buf | - GAP buffer pointer. |
set_max | - max possible bitset length |
Definition at line 2377 of file bmfunc.h.
Referenced by bm::blocks_manager< Alloc >::is_block_one(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), and bm::blocks_manager< Alloc >::block_opt_func::operator()().
bool bm::gap_is_all_zero | ( | const T * | buf, |
unsigned | set_max | ||
) |
Temporary inverts all bits in the GAP buffer.
In this function const-ness of the buffer means nothing. Calling this function again restores the status of the buffer.
buf | - GAP buffer pointer. (Buffer IS changed) |
Checks if GAP block is all-zero.
buf | - GAP buffer pointer. |
set_max | - max possible bitset length |
Definition at line 2363 of file bmfunc.h.
Referenced by bm::combine_any_operation_with_block(), bm::bvector< Alloc >::combine_operation_with_block(), bm::bvector< Alloc >::compare(), bm::blocks_manager< Alloc >::is_block_zero(), bm::blocks_manager< Alloc >::block_any_func::operator()(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), and bm::blocks_manager< Alloc >::block_opt_func::operator()().
T bm::gap_length | ( | const T * | buf | ) |
Returs GAP block length.
buf | - GAP buffer pointer. |
Definition at line 2389 of file bmfunc.h.
Referenced by bm::blocks_manager< Alloc >::allocate_gap_block(), bm::blocks_manager< Alloc >::block_count_change_func::block_count(), bm::bvector< Alloc >::calc_stat(), bm::bvector< Alloc >::combine_operation_with_block(), bm::blocks_manager< Alloc >::copy_block(), bm::iterator_deserializer< BV, SerialIterator >::deserialize(), bm::deserializer< BV, DEC >::deserialize_gap(), bm::serializer< BV >::encode_gap_block(), bm::blocks_manager< Alloc >::extend_gap_block(), bm::serializer< BV >::gamma_gap_block(), bm::gap_free_elements(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), bm::blocks_manager< Alloc >::block_opt_func::operator()(), bm::blocks_manager< Alloc >::block_copy_func::operator()(), print_stat(), bm::deseriaizer_base< DEC >::read_gap_block(), and bm::blocks_manager< Alloc >::set_gap_block().
unsigned bm::gap_level | ( | const T * | buf | ) |
Returs GAP blocks capacity level.
buf | - GAP buffer pointer. |
Definition at line 2431 of file bmfunc.h.
Referenced by bm::bvector< Alloc >::combine_operation_with_block(), bm::blocks_manager< Alloc >::copy_block(), bm::blocks_manager< Alloc >::extend_gap_block(), bm::blocks_manager< Alloc >::block_copy_func::operator()(), and print_stat().
unsigned bm::gap_limit | ( | const T * | buf, |
const T * | glevel_len | ||
) |
Returs GAP block capacity limit.
buf | - GAP buffer pointer. |
glevel_len | - GAP lengths table (gap_len_table) |
Definition at line 2418 of file bmfunc.h.
Referenced by bm::bvector< Alloc >::and_bit_no_check(), bm::bvector< Alloc >::check_or_next_extract(), bm::bvector< Alloc >::combine_operation_with_block(), bm::combine_or(), bm::combine_sub(), bm::combine_xor(), bm::bvector< Alloc >::set_bit_conditional_impl(), and bm::bvector< Alloc >::set_bit_no_check().
BMFORCEINLINE gap_word_t * bm::gap_operation_and | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2, | ||
gap_word_t *BMRESTRICT | tmp_buf, | ||
unsigned & | dsize | ||
) |
GAP AND operation.
Function performs AND logical operation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.
vect1 | - operand 1 |
vect2 | - operand 2 |
tmp_buf | - pointer on temporary buffer |
dsize | - out size of the destination |
Definition at line 3197 of file bmfunc.h.
References bm::and_op(), and bm::gap_buff_op().
BMFORCEINLINE unsigned bm::gap_operation_any_and | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2 | ||
) |
GAP AND operation test.
Function performs AND logical operation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.
vect1 | - operand 1 |
vect2 | - operand 2 |
Definition at line 3221 of file bmfunc.h.
References bm::and_op(), and bm::gap_buff_any_op().
Referenced by bm::combine_any_operation_with_block().
BMFORCEINLINE unsigned bm::gap_operation_any_sub | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2 | ||
) |
GAP SUB operation test.
Function performs AND logical operation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.
vect1 | - operand 1 |
vect2 | - operand 2 |
Definition at line 3399 of file bmfunc.h.
References bm::and_op(), and bm::gap_buff_any_op().
Referenced by bm::combine_any_operation_with_block().
BMFORCEINLINE unsigned bm::gap_operation_any_xor | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2 | ||
) |
GAP XOR operation test.
Function performs AND logical operation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.
vect1 | - operand 1 |
vect2 | - operand 2 |
Definition at line 3288 of file bmfunc.h.
References bm::gap_buff_any_op(), and bm::xor_op().
Referenced by bm::combine_any_operation_with_block().
gap_word_t * bm::gap_operation_or | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2, | ||
gap_word_t *BMRESTRICT | tmp_buf, | ||
unsigned & | dsize | ||
) | [inline] |
GAP OR operation.
Function performs OR logical oparation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.
vect1 | - operand 1 |
vect2 | - operand 2 |
tmp_buf | - pointer on temporary buffer |
dsize | - out destination size |
Definition at line 3329 of file bmfunc.h.
References bm::and_op(), bm::gap_buff_op(), and bm::gap_invert().
Referenced by bm::combine_any_operation_with_block().
gap_word_t * bm::gap_operation_sub | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2, | ||
gap_word_t *BMRESTRICT | tmp_buf, | ||
unsigned & | dsize | ||
) | [inline] |
GAP SUB (AND NOT) operation.
Function performs SUB logical operation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.
vect1 | - operand 1 |
vect2 | - operand 2 |
tmp_buf | - pointer on temporary buffer |
dsize | - out destination size |
Definition at line 3374 of file bmfunc.h.
References bm::and_op(), and bm::gap_buff_op().
BMFORCEINLINE gap_word_t * bm::gap_operation_xor | ( | const gap_word_t *BMRESTRICT | vect1, |
const gap_word_t *BMRESTRICT | vect2, | ||
gap_word_t *BMRESTRICT | tmp_buf, | ||
unsigned & | dsize | ||
) |
GAP XOR operation.
Function performs XOR logical operation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.
vect1 | - operand 1 |
vect2 | - operand 2 |
tmp_buf | - pointer on temporary buffer |
dsize | - out destination size |
Definition at line 3263 of file bmfunc.h.
References bm::gap_buff_op(), and bm::xor_op().
unsigned bm::gap_overhead | ( | const T * | length, |
const T * | length_end, | ||
const T * | glevel_len | ||
) |
Convert bit block into an array of ints corresponding to 1 bits.
OBSOLETE function
Calculates memory overhead for number of gap blocks sharing the same memory allocation table (level lengths table).
Definition at line 4858 of file bmfunc.h.
References bm::gap_calc_level(), and bm::gap_levels.
Referenced by bm::improve_gap_levels().
void bm::gap_set_all | ( | T * | buf, |
unsigned | set_max, | ||
unsigned | value | ||
) |
Sets all bits to 0 or 1 (GAP)
buf | - GAP buffer pointer. |
set_max | - max possible bitset length |
Definition at line 2260 of file bmfunc.h.
Referenced by bm::blocks_manager< Alloc >::check_allocate_block(), bm::gap_init_range_block(), bm::miniset< A, N >::init_gapbuf(), bm::blocks_manager< Alloc >::block_zero_func::operator()(), and bm::deseriaizer_base< DEC >::read_gap_block().
unsigned bm::gap_set_array | ( | T * | buf, |
const T * | arr, | ||
unsigned | len | ||
) |
Convert array to GAP buffer.
buf | - GAP buffer. |
arr | - array of values to set |
len | - length of the array |
Definition at line 1357 of file bmfunc.h.
References bm::gap_max_bits.
Referenced by bm::deserializer< BV, DEC >::deserialize_gap(), and bm::deseriaizer_base< DEC >::read_gap_block().
unsigned bm::gap_set_value | ( | unsigned | val, |
T *BMRESTRICT | buf, | ||
unsigned | pos, | ||
unsigned *BMRESTRICT | is_set | ||
) |
Sets or clears bit in the GAP buffer.
val | - new bit value |
buf | - GAP buffer. |
pos | - Index of bit to set. |
is_set | - (OUT) flag if bit was actually set. |
Definition at line 1179 of file bmfunc.h.
References bm::gap_bfind(), and bm::gap_max_bits.
Referenced by bm::bvector< Alloc >::and_bit_no_check(), bm::bvector< Alloc >::check_or_next_extract(), bm::bvector< Alloc >::combine_operation_with_block(), bm::combine_or(), bm::combine_sub(), bm::combine_xor(), bm::miniset< A, N >::set(), bm::bvector< Alloc >::set_bit_conditional_impl(), and bm::bvector< Alloc >::set_bit_no_check().
void bm::gap_sub_to_bitset | ( | unsigned *BMRESTRICT | dest, |
const T *BMRESTRICT | buf | ||
) |
SUB (AND NOT) GAP block to bitblock.
dest | - bitblock buffer pointer. |
buf | - GAP buffer pointer. |
Definition at line 1688 of file bmfunc.h.
References bm::sub_bit_block().
unsigned bm::gap_test | ( | const T * | buf, |
unsigned | pos | ||
) |
Tests if bit = pos is true.
buf | - GAP buffer pointer. |
pos | - index of the element. |
Definition at line 500 of file bmfunc.h.
References bm::gap_max_bits.
Referenced by bm::bvector< Alloc >::and_bit_no_check(), bm::blocks_manager< Alloc >::block_count_change_func::block_count(), bm::combine_sub(), bm::combine_xor(), bm::bvector< Alloc >::get_bit(), bm::bvector< Alloc >::set_bit_conditional_impl(), and bm::miniset< A, N >::test().
void bm::gap_xor_to_bitset | ( | unsigned *BMRESTRICT | dest, |
const T *BMRESTRICT | buf | ||
) |
XOR GAP block to bitblock.
dest | - bitblock buffer pointer. |
buf | - GAP buffer pointer. |
Definition at line 1716 of file bmfunc.h.
References bm::xor_bit_block().
int bm::gapcmp | ( | const T * | buf1, |
const T * | buf2 | ||
) |
Lexicographical comparison of GAP buffers.
buf1 | - First GAP buffer pointer. |
buf2 | - Second GAP buffer pointer. |
Definition at line 877 of file bmfunc.h.
Referenced by bm::bvector< Alloc >::compare().
bool bm::improve_gap_levels | ( | const T * | length, |
const T * | length_end, | ||
T * | glevel_len | ||
) |
Finds optimal gap blocks lengths.
length | - first element of GAP lengths array |
length_end | - end of the GAP lengths array |
glevel_len | - destination GAP lengths array |
Definition at line 4885 of file bmfunc.h.
References bm::gap_levels, bm::gap_max_buff_len, and bm::gap_overhead().
Referenced by bm::bvector< Alloc >::optimize_gap_size().
void bm::set_gap_level | ( | T * | buf, |
unsigned | level | ||
) |
Sets GAP block capacity level.
buf | - GAP buffer pointer. |
level | new GAP block capacity level. |
Definition at line 2445 of file bmfunc.h.
References bm::gap_levels.
Referenced by bm::bvector< Alloc >::combine_operation_with_block(), bm::blocks_manager< Alloc >::copy_block(), bm::iterator_deserializer< BV, SerialIterator >::deserialize(), bm::deserializer< BV, DEC >::deserialize_gap(), and bm::blocks_manager< Alloc >::set_gap_block().