BitMagicC++Library
Data Structures | Typedefs | Enumerations | Functions | Variables
bm Namespace Reference

Data Structures

struct  _copyright
 Internal structure. More...
 
struct  all_set
 Structure carries pointer on bit block with all bits 1. More...
 
struct  bit_AND
 Bit AND functor. More...
 
struct  bit_ASSIGN
 Bit ASSIGN functor. More...
 
struct  bit_COUNT
 Bit COUNT functor. More...
 
struct  bit_COUNT_A
 Bit COUNT A functor. More...
 
struct  bit_COUNT_AND
 Bit COUNT AND functor. More...
 
struct  bit_COUNT_B
 Bit COUNT B functor. More...
 
struct  bit_COUNT_OR
 Bit COUNT OR functor. More...
 
struct  bit_COUNT_SUB_AB
 Bit COUNT SUB AB functor. More...
 
struct  bit_COUNT_SUB_BA
 Bit SUB BA functor. More...
 
struct  bit_count_table
 Structure to aid in counting bits table contains count of bits in 0-255 diapason of numbers. More...
 
struct  bit_COUNT_XOR
 Bit COUNT XOR functor. More...
 
struct  bit_grabber
 
struct  bit_grabber< unsigned char, 8 >
 
struct  bit_grabber< unsigned short, 16 >
 
struct  bit_grabber< unsigned, 32 >
 
class  bit_in
 Byte based reader for un-aligned bit streaming. More...
 
struct  bit_OR
 Bit OR functor. More...
 
class  bit_out
 Byte based writer for un-aligned bit streaming. More...
 
struct  bit_SUB
 Bit SUB functor. More...
 
struct  bit_trans_grabber
 
struct  bit_XOR
 Bit XOR functor. More...
 
class  bitblock_get_adapter
 Bit-block get adapter, takes bitblock and represents it as a get_32() accessor function. More...
 
class  bitblock_store_adapter
 Bit-block store adapter, takes bitblock and saves results into it. More...
 
class  bitblock_sum_adapter
 Bit-block sum adapter, takes values and sums it /internal. More...
 
class  block_allocator
 Default malloc based bitblock allocator class. More...
 
struct  block_set_table
 Structure keeps all-left/right ON bits masks. More...
 
struct  bv_statistics
 Structure with statistical information about bitset's memory allocation details. More...
 
class  bvector
 bitvector Bit-vector container with runtime compression of bits More...
 
class  bvector_mini
 Bitvector class with very limited functionality. More...
 
class  bvmini
 Mini bitvector used in bvector template to keep block type flags. More...
 
class  compressed_collection_deserializer
 Deseriaizer for compressed collections. More...
 
class  compressed_collection_serializer
 Seriaizer for compressed collections. More...
 
struct  conditional
 ad-hoc conditional expressions More...
 
struct  conditional< false >
 
class  copy_to_array_functor
 Adaptor to copy 1 bits to array. More...
 
struct  d_copy_func
 d-Gap copy functor More...
 
struct  DeBruijn_bit_position
 
class  decoder
 Class for decoding data from memory buffer. More...
 
class  decoder_base
 Base class for all decoding functionality. More...
 
class  decoder_little_endian
 Class for decoding data from memory buffer. More...
 
class  decoder_range_adapter
 Adapter to get words from a range stream (see range serialized bit-block) More...
 
class  deseriaizer_base
 Base deserialization class. More...
 
class  deserializer
 Deserializer for bit-vector. More...
 
struct  distance_metric_descriptor
 Distance metric descriptor, holds metric code and result. More...
 
class  encoder
 Memory encoding. More...
 
struct  first_bit_table
 Structure keeps index of first right 1 bit for every byte. More...
 
class  gamma_decoder
 Elias Gamma decoder. More...
 
class  gamma_encoder
 Functor for Elias Gamma encoding. More...
 
struct  gap_len_table
 Default GAP lengths table. More...
 
struct  gap_len_table_min
 Alternative GAP lengths table. Good for for memory saver mode and very sparse bitsets. More...
 
struct  gap_len_table_nl
 Non-linear size growth GAP lengths table. More...
 
class  gap_transpose_engine
 Bit-plain splicing of a GAP block. More...
 
struct  globals
 Internal structure. More...
 
class  iterator_deserializer
 Iterator to walk forward the serialized stream. More...
 
class  mem_alloc
 BM style allocator adapter. More...
 
class  miniset
 Template class implements memory saving set functionality. More...
 
class  operation_deserializer
 Deserializer, performs logical operations between bit-vector and serialized bit-vector. More...
 
struct  operation_functions
 
class  ptr_allocator
 Default malloc based bitblock allocator class. More...
 
class  ptr_guard
 Mini auto-pointer for internal memory management. More...
 
class  random_subset
 
class  serial_stream_iterator
 Serialization stream iterator. More...
 
class  serializer
 Bit-vector serialization class. More...
 
class  sparse_vector
 sparse vector with runtime compression using bit transposition method More...
 
struct  sparse_vector_serial_layout
 layout class for serialization buffer structure More...
 
class  sse_empty_guard
 SSE2 reinitialization guard class. More...
 
struct  tmatrix
 Mini-matrix for bit transposition purposes. More...
 

Typedefs

typedef void(* gap_operation_to_bitset_func_type) (unsigned *, const gap_word_t *)
 
typedef gap_word_t *(* gap_operation_func_type) (const gap_word_t *BMRESTRICT, const gap_word_t *BMRESTRICT, gap_word_t *BMRESTRICT, unsigned &)
 
typedef bm::id_t(* bit_operation_count_func_type) (const bm::word_t *BMRESTRICT, const bm::word_t *BMRESTRICT, const bm::word_t *BMRESTRICT)
 
typedef decoder decoder_big_endian
 Class for decoding data from memory buffer. More...
 
typedef unsigned long long int id64_t
 
typedef unsigned int id_t
 
typedef unsigned int word_t
 
typedef unsigned short short_t
 
typedef unsigned short gap_word_t
 
typedef id64_t wordop_t
 
typedef mem_alloc< block_allocator, ptr_allocatorstandard_allocator
 

Enumerations

enum  set_operation {
  set_AND = 0, set_OR = 1, set_SUB = 2, set_XOR = 3,
  set_ASSIGN = 4, set_COUNT = 5, set_COUNT_AND = 6, set_COUNT_XOR = 7,
  set_COUNT_OR = 8, set_COUNT_SUB_AB = 9, set_COUNT_SUB_BA = 10, set_COUNT_A = 11,
  set_COUNT_B = 12, set_END
}
 Nomenclature of set operations. More...
 
enum  operation { BM_AND = set_AND, BM_OR = set_OR, BM_SUB = set_SUB, BM_XOR = set_XOR }
 Bit operations enumeration. More...
 
enum  ByteOrder { BigEndian = 0, LittleEndian = 1 }
 Byte orders recognized by the library. More...
 
enum  strategy { BM_BIT = 0, BM_GAP = 1 }
 Block allocation strategies. More...
 
enum  set_representation { set_bitset = 0, set_gap = 1, set_array1 = 2, set_array0 = 3 }
 set representation variants More...
 
enum  simd_codes { simd_none = 0, simd_sse2 = 1, simd_sse42 = 2, simd_avx2 = 5 }
 codes for supported SIMD optimizations More...
 
enum  distance_metric {
  COUNT_AND = set_COUNT_AND, COUNT_XOR = set_COUNT_XOR, COUNT_OR = set_COUNT_OR, COUNT_SUB_AB = set_COUNT_SUB_AB,
  COUNT_SUB_BA = set_COUNT_SUB_BA, COUNT_A = set_COUNT_A, COUNT_B = set_COUNT_B
}
 Distance metrics codes defined for vectors A and B. More...
 
enum  serialization_header_mask {
  BM_HM_DEFAULT = 1, BM_HM_RESIZE = (1 << 1), BM_HM_ID_LIST = (1 << 2), BM_HM_NO_BO = (1 << 3),
  BM_HM_NO_GAPL = (1 << 4)
}
 
enum  serialization_flags { BM_NO_BYTE_ORDER = 1, BM_NO_GAP_LENGTH = (1 << 1) }
 Bit mask flags for serialization algorithm. More...
 

Functions

template<class Alloc >
bvector< Alloc > operator & (const bvector< Alloc > &v1, const bvector< Alloc > &v2)
 
template<class Alloc >
bvector< Alloc > operator| (const bvector< Alloc > &v1, const bvector< Alloc > &v2)
 
template<class Alloc >
bvector< Alloc > operator^ (const bvector< Alloc > &v1, const bvector< Alloc > &v2)
 
template<class Alloc >
bvector< Alloc > operator- (const bvector< Alloc > &v1, const bvector< Alloc > &v2)
 
bm::id_t bit_block_calc_count_range (const bm::word_t *block, bm::word_t left, bm::word_t right)
 
bm::id_t bit_block_any_range (const bm::word_t *block, bm::word_t left, bm::word_t right)
 
BMFORCEINLINE bm::id_t word_bitcount (bm::id_t w)
 
int parallel_popcnt_32 (unsigned int n)
 
BMFORCEINLINE int word_bitcount64 (bm::id64_t x)
 
unsigned bitcount64_4way (bm::id64_t x, bm::id64_t y, bm::id64_t u, bm::id64_t v)
 
BMFORCEINLINE bm::id_t word_trailing_zeros (bm::id_t w)
 
bool is_const_set_operation (set_operation op)
 Returns true if set operation is constant (bitcount) More...
 
bm::operation setop2op (bm::set_operation op)
 Convert set operation to operation. More...
 
template<typename W >
void xor_swap (W &x, W &y)
 XOR swap two scalar variables. More...
 
template<typename T >
int wordcmp0 (T w1, T w2)
 Lexicographical comparison of two words as bit strings (reference) Auxiliary implementation for testing and reference purposes. More...
 
template<typename T >
int wordcmp (T a, T b)
 Lexicographical comparison of two words as bit strings. Auxiliary implementation for testing and reference purposes. More...
 
template<typename T >
unsigned gap_bfind (const T *buf, unsigned pos, unsigned *is_set)
 
template<typename T >
unsigned gap_test (const T *buf, unsigned pos)
 Tests if bit = pos is true. More...
 
template<typename T >
unsigned gap_test_unr (const T *buf, const unsigned pos)
 Tests if bit = pos is true. Analog of bm::gap_test with SIMD unrolling. More...
 
template<class T , class F >
void for_each_nzblock (T ***root, unsigned size1, F &f)
 
template<class T , class F >
void for_each_nzblock2 (T ***root, unsigned size1, F &f)
 
template<class T , class F >
bool for_each_nzblock_if (T ***root, unsigned size1, F &f)
 
template<class T , class F >
void for_each_block (T ***root, unsigned size1, F &f)
 
template<class T , class F >
bmfor_each (T first, T last, F f)
 
template<class T >
sum_arr (T *first, T *last)
 
template<typename T >
unsigned gap_bit_count (const T *buf, unsigned dsize=0)
 Calculates number of bits ON in GAP buffer. More...
 
template<typename T >
unsigned gap_bit_count_unr (const T *buf)
 Calculates number of bits ON in GAP buffer. Loop unrolled version. More...
 
template<typename T >
unsigned gap_bit_count_range (const T *const buf, T left, T right)
 Counts 1 bits in GAP buffer in the closed [left, right] range. More...
 
template<typename T >
unsigned gap_bit_count_to (const T *const buf, T right)
 Counts 1 bits in GAP buffer in the closed [0, right] range. More...
 
template<class T , class Func >
void for_each_dgap (const T *gap_buf, Func &func)
 
template<typename T >
T * gap_2_dgap (const T *gap_buf, T *dgap_buf, bool copy_head=true)
 Convert GAP buffer into D-GAP buffer. More...
 
template<typename T >
void dgap_2_gap (const T *dgap_buf, T *gap_buf, T gap_header=0)
 Convert D-GAP buffer into GAP buffer. More...
 
template<typename T >
int gapcmp (const T *buf1, const T *buf2)
 Lexicographical comparison of GAP buffers. More...
 
template<typename T , class F >
void gap_buff_op (T *BMRESTRICT dest, const T *BMRESTRICT vect1, unsigned vect1_mask, const T *BMRESTRICT vect2, unsigned vect2_mask, F &f, unsigned &dlen)
 Abstract operation for GAP buffers. Receives functor F as a template argument. More...
 
template<typename T , class F >
unsigned 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. More...
 
template<typename T , class F >
unsigned 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. More...
 
template<typename T >
unsigned gap_set_value (unsigned val, T *BMRESTRICT buf, unsigned pos, unsigned *BMRESTRICT is_set)
 Sets or clears bit in the GAP buffer. More...
 
template<typename T >
unsigned gap_add_value (T *buf, unsigned pos)
 Add new value to the end of GAP buffer. More...
 
template<typename T >
unsigned gap_set_array (T *buf, const T *arr, unsigned len)
 Convert array to GAP buffer. More...
 
template<typename T >
unsigned bit_array_compute_gaps (const T *arr, unsigned len)
 Compute number of GAPs in bit-array. More...
 
template<typename T >
int gap_find_in_block (const T *buf, unsigned nbit, bm::id_t *prev)
 Searches for the next 1 bit in the GAP block. More...
 
BMFORCEINLINE void set_bit (unsigned *dest, unsigned bitpos)
 Set 1 bit in a block. More...
 
BMFORCEINLINE unsigned test_bit (const unsigned *block, unsigned bitpos)
 Test 1 bit in a block. More...
 
void or_bit_block (unsigned *dest, unsigned bitpos, unsigned bitcount)
 Sets bits to 1 in the bitblock. More...
 
void sub_bit_block (unsigned *dest, unsigned bitpos, unsigned bitcount)
 SUB (AND NOT) bit interval to 1 in the bitblock. More...
 
void xor_bit_block (unsigned *dest, unsigned bitpos, unsigned bitcount)
 XOR bit interval to 1 in the bitblock. More...
 
template<typename T >
void gap_sub_to_bitset (unsigned *dest, const T *buf)
 SUB (AND NOT) GAP block to bitblock. More...
 
template<typename T >
void gap_xor_to_bitset (unsigned *dest, const T *buf)
 XOR GAP block to bitblock. More...
 
template<typename T >
void gap_add_to_bitset (unsigned *dest, const T *buf)
 Adds(OR) GAP block to bitblock. More...
 
template<typename T >
void gap_and_to_bitset (unsigned *dest, const T *buf)
 ANDs GAP block to bitblock. More...
 
template<typename T >
bm::id_t gap_bitset_and_count (const unsigned *block, const T *buf)
 Compute bitcount of bit block AND masked by GAP block. More...
 
template<typename T >
bm::id_t gap_bitset_and_any (const unsigned *block, const T *buf)
 Bitcount test of bit block AND masked by GAP block. More...
 
template<typename T >
bm::id_t gap_bitset_sub_count (const unsigned *block, const T *buf)
 Compute bitcount of bit block SUB masked by GAP block. More...
 
template<typename T >
bm::id_t gap_bitset_sub_any (const unsigned *block, const T *buf)
 Compute bitcount test of bit block SUB masked by GAP block. More...
 
template<typename T >
bm::id_t gap_bitset_xor_count (const unsigned *block, const T *buf)
 Compute bitcount of bit block XOR masked by GAP block. More...
 
template<typename T >
bm::id_t gap_bitset_xor_any (const unsigned *block, const T *buf)
 Compute bitcount test of bit block XOR masked by GAP block. More...
 
template<typename T >
bm::id_t gap_bitset_or_count (const unsigned *block, const T *buf)
 Compute bitcount of bit block OR masked by GAP block. More...
 
template<typename T >
bm::id_t gap_bitset_or_any (const unsigned *block, const T *buf)
 Compute bitcount test of bit block OR masked by GAP block. More...
 
void bit_block_set (bm::word_t *BMRESTRICT dst, bm::word_t value)
 Bitblock memset operation. More...
 
template<typename T >
void gap_convert_to_bitset (unsigned *dest, const T *buf)
 GAP block to bitblock conversion. More...
 
template<typename T >
void gap_convert_to_bitset (unsigned *dest, const T *buf, unsigned dest_len)
 GAP block to bitblock conversion. More...
 
template<typename T >
unsigned * gap_convert_to_bitset_smart (unsigned *dest, const T *buf, id_t set_max)
 Smart GAP block to bitblock conversion. More...
 
template<typename T >
unsigned gap_control_sum (const T *buf)
 Calculates sum of all words in GAP block. (For debugging purposes) More...
 
template<class T >
void gap_set_all (T *buf, unsigned set_max, unsigned value)
 Sets all bits to 0 or 1 (GAP) More...
 
template<class T >
void 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) More...
 
template<typename T >
void gap_invert (T *buf)
 Inverts all bits in the GAP buffer. More...
 
template<typename T >
bool gap_is_all_zero (const T *buf, unsigned set_max)
 Temporary inverts all bits in the GAP buffer. More...
 
template<typename T >
bool gap_is_all_one (const T *buf, unsigned set_max)
 Checks if GAP block is all-one. More...
 
template<typename T >
gap_length (const T *buf)
 Returs GAP block length. More...
 
template<typename T >
unsigned gap_capacity (const T *buf, const T *glevel_len)
 Returs GAP block capacity. More...
 
template<typename T >
unsigned gap_limit (const T *buf, const T *glevel_len)
 Returs GAP block capacity limit. More...
 
template<typename T >
unsigned gap_level (const T *buf)
 Returs GAP blocks capacity level. More...
 
template<typename T >
void set_gap_level (T *buf, unsigned level)
 Sets GAP block capacity level. More...
 
template<typename T >
int gap_calc_level (int len, const T *glevel_len)
 Calculates GAP block capacity level. More...
 
template<typename T >
unsigned 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. More...
 
template<typename T >
int bitcmp (const T *buf1, const T *buf2, unsigned len)
 Lexicographical comparison of BIT buffers. More...
 
template<typename T >
unsigned bit_convert_to_gap (T *BMRESTRICT dest, const unsigned *BMRESTRICT src, bm::id_t bits, unsigned dest_len)
 Converts bit block to GAP. More...
 
template<class T , class F >
void for_each_gap_dbit (const T *buf, F &func)
 Iterate gap block as delta-bits with a functor. More...
 
template<typename D , typename T >
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. More...
 
bm::id_t bit_block_calc_count (const bm::word_t *block, const bm::word_t *block_end)
 Bitcount for bit string. More...
 
bm::id_t bit_count_change (bm::word_t w)
 
void bit_count_change32 (const bm::word_t *block, const bm::word_t *block_end, unsigned *bit_count, unsigned *gap_count)
 
bm::id_t bit_block_calc_count_change (const bm::word_t *block, const bm::word_t *block_end, unsigned *bit_count)
 
bm::id_t bit_block_calc_count_to (const bm::word_t *block, bm::word_t right)
 
void bit_block_rotate_left_1 (bm::word_t *block)
 
void bit_block_rotate_left_1_unr (bm::word_t *block)
 
template<typename T >
void bit_invert (T *start, T *end)
 
bool is_bits_one (const bm::wordop_t *start, const bm::wordop_t *end)
 Returns "true" if all bits in the block are 1. More...
 
bool bit_is_all_zero (const bm::wordop_t *start, const bm::wordop_t *end)
 Returns "true" if all bits in the block are 0. More...
 
BMFORCEINLINE unsigned and_op (unsigned v1, unsigned v2)
 GAP and functor. More...
 
BMFORCEINLINE unsigned xor_op (unsigned v1, unsigned v2)
 GAP xor functor. More...
 
BMFORCEINLINE unsigned or_op (unsigned v1, unsigned v2)
 GAP or functor. More...
 
BMFORCEINLINE unsigned sub_op (unsigned v1, unsigned v2)
 GAP or functor. More...
 
BMFORCEINLINE gap_word_tgap_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. More...
 
BMFORCEINLINE unsigned gap_operation_any_and (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP AND operation test. More...
 
BMFORCEINLINE unsigned gap_count_and (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP bitcount AND operation test. More...
 
BMFORCEINLINE gap_word_tgap_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. More...
 
BMFORCEINLINE unsigned gap_operation_any_xor (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP XOR operation test. More...
 
BMFORCEINLINE unsigned gap_count_xor (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP bitcount XOR operation test. More...
 
gap_word_tgap_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. More...
 
BMFORCEINLINE unsigned gap_count_or (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP bitcount OR operation test. More...
 
gap_word_tgap_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. More...
 
BMFORCEINLINE unsigned gap_operation_any_sub (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP SUB operation test. More...
 
BMFORCEINLINE unsigned gap_count_sub (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP bitcount SUB (AND NOT) operation test. More...
 
void bit_block_copy (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src)
 Bitblock copy operation. More...
 
void 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. More...
 
unsigned 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. More...
 
unsigned 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. More...
 
unsigned 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. More...
 
unsigned 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. More...
 
unsigned 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. More...
 
unsigned 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. More...
 
unsigned 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. More...
 
unsigned 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. More...
 
bm::word_tbit_operation_and (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src)
 bitblock AND operation. More...
 
bm::id_t 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. More...
 
bm::id_t 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. More...
 
bm::id_t 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. More...
 
bm::id_t 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. More...
 
bm::id_t 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. More...
 
bm::id_t 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. More...
 
bm::id_t 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. More...
 
void 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. More...
 
bm::word_tbit_operation_or (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src)
 Block OR operation. Makes analysis if block is 0 or FULL. More...
 
void 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. More...
 
bm::word_tbit_operation_sub (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src)
 bitblock SUB operation. More...
 
void 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. More...
 
bm::word_tbit_operation_xor (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src)
 bitblock XOR operation. More...
 
bm::id_t 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. More...
 
bm::id_t 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. More...
 
template<class T >
unsigned bit_count_nonzero_size (const T *blk, unsigned data_size)
 Inspects block for full zero words. More...
 
int 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. More...
 
template<typename T , typename F >
void bit_for_each_4 (T w, F &func)
 Templated algorithm to unpacks octet based word into list of ON bit indexes. More...
 
template<typename T , typename F >
void bit_for_each (T w, F &func)
 Templated algorithm to unpacks word into list of ON bit indexes. More...
 
template<typename T , typename B >
unsigned bit_list_4 (T w, B *bits)
 Unpacks word into list of ON bit indexes (quad-bit based) More...
 
template<typename B >
unsigned short bitscan_popcnt (bm::id_t w, B *bits, unsigned offs=0)
 Unpacks word into list of ON bit indexes using popcnt method. More...
 
template<typename B >
unsigned short bitscan_popcnt64 (bm::id64_t w, B *bits)
 Unpacks 64-bit word into list of ON bit indexes using popcnt method. More...
 
template<typename V , typename B >
unsigned short bitscan (V w, B *bits)
 
template<typename T , typename B >
unsigned bit_list (T w, B *bits)
 Unpacks word into list of ON bit indexes. More...
 
bm::set_representation best_representation (unsigned bit_count, unsigned total_possible_bitcount, unsigned gap_count, unsigned block_size)
 Choose best representation for a bit-block. More...
 
template<typename T >
bit_convert_to_arr (T *BMRESTRICT dest, const unsigned *BMRESTRICT src, bm::id_t bits, unsigned dest_len, unsigned mask=0)
 Convert bit block into an array of ints corresponding to 1 bits. More...
 
template<typename T >
unsigned gap_overhead (const T *length, const T *length_end, const T *glevel_len)
 Calculates memory overhead for number of gap blocks sharing the same memory allocation table (level lengths table). More...
 
template<typename T >
bool improve_gap_levels (const T *length, const T *length_end, T *glevel_len)
 Finds optimal gap blocks lengths. More...
 
template<class It1 , class It2 , class BinaryOp , class Encoder >
void bit_recomb (It1 &it1, It2 &it2, BinaryOp &op, Encoder &enc, unsigned block_size=bm::set_block_size)
 
unsigned short bitscan_wave (const bm::word_t *w_ptr, unsigned char *bits)
 Unpacks word wave (2x 32-bit words) More...
 
BMFORCEINLINE void sse2_xor_arr_2_mask (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end, bm::word_t mask)
 XOR array elements to specified mask dst = *src ^ mask. More...
 
BMFORCEINLINE void sse2_andnot_arr_2_mask (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end, bm::word_t mask)
 Inverts array elements and NOT them to specified mask dst = ~*src & mask. More...
 
BMFORCEINLINE void sse2_and_arr (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end)
 AND array elements against another array dst &= *src. More...
 
BMFORCEINLINE void sse2_or_arr (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end)
 OR array elements against another array dst |= *src. More...
 
BMFORCEINLINE void sse2_xor_arr (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end)
 OR array elements against another array dst ^= *src. More...
 
BMFORCEINLINE void sse2_sub_arr (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end)
 AND-NOT (SUB) array elements against another array dst &= ~*src. More...
 
BMFORCEINLINE void sse2_set_block (__m128i *BMRESTRICT dst, __m128i *BMRESTRICT dst_end, bm::word_t value)
 SSE2 block memset dst = value. More...
 
BMFORCEINLINE void sse2_copy_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end)
 SSE2 block copy dst = *src. More...
 
BMFORCEINLINE void sse2_invert_arr (bm::word_t *first, bm::word_t *last)
 Invert array elements dst = ~*dst or dst ^= *dst. More...
 
BMFORCEINLINE __m128i sse2_and (__m128i a, __m128i b)
 
BMFORCEINLINE __m128i sse2_or (__m128i a, __m128i b)
 
BMFORCEINLINE __m128i sse2_xor (__m128i a, __m128i b)
 
BMFORCEINLINE __m128i sse2_sub (__m128i a, __m128i b)
 
const bm::gap_word_tsse2_gap_sum_arr (const bm::gap_word_t *BMRESTRICT pbuf, unsigned sse_vect_waves, unsigned *sum)
 Gap block population count (array sum) utility. More...
 
bm::id_t sse4_bit_count (const __m128i *block, const __m128i *block_end)
 
BMFORCEINLINE unsigned op_xor (unsigned a, unsigned b)
 
BMFORCEINLINE unsigned op_or (unsigned a, unsigned b)
 
BMFORCEINLINE unsigned op_and (unsigned a, unsigned b)
 
template<class Func >
bm::id_t sse4_bit_count_op (const __m128i *BMRESTRICT block, const __m128i *BMRESTRICT block_end, const __m128i *BMRESTRICT mask_block, Func sse2_func)
 
bool sse4_is_all_zero (const __m128i *BMRESTRICT block, const __m128i *BMRESTRICT block_end)
 check if block is all zero bits More...
 
bool sse4_is_all_one (const __m128i *BMRESTRICT block, const __m128i *BMRESTRICT block_end)
 check if block is all zero bits More...
 
bm::id_t sse4_bit_block_calc_count_change (const __m128i *BMRESTRICT block, const __m128i *BMRESTRICT block_end, unsigned *BMRESTRICT bit_count)
 
unsigned sse4_gap_find (const bm::gap_word_t *BMRESTRICT pbuf, const bm::gap_word_t pos, const unsigned size)
 
bm::id_t sse2_bit_count (const __m128i *block, const __m128i *block_end)
 
template<class Func >
bm::id_t sse2_bit_count_op (const __m128i *BMRESTRICT block, const __m128i *BMRESTRICT block_end, const __m128i *BMRESTRICT mask_block, Func sse2_func)
 
bm::id_t sse2_bit_block_calc_count_change (const __m128i *BMRESTRICT block, const __m128i *BMRESTRICT block_end, unsigned *BMRESTRICT bit_count)
 
unsigned sse2_gap_find (const bm::gap_word_t *BMRESTRICT pbuf, const bm::gap_word_t pos, const unsigned size)
 
template<class BV , class Func >
void for_each_bit (const BV &bv, Func &bit_functor)
 bit-vector visitor scanner to traverse each 1 bit using C++ visitor More...
 
template<class BV >
void visit_each_bit (const BV &bv, void *handle_ptr, bit_visitor_callback_type callback_ptr)
 bit-vector visitor scanner to traverse each 1 bit using C callback More...
 
distance_metric operation2metric (set_operation op)
 Convert set operation into compatible distance metric. More...
 
void combine_count_operation_with_block (const bm::word_t *blk, const bm::word_t *arg_blk, distance_metric_descriptor *dmit, distance_metric_descriptor *dmit_end)
 Internal function computes different distance metrics. More...
 
unsigned combine_count_and_operation_with_block (const bm::word_t *blk, const bm::word_t *arg_blk)
 Internal function computes AND distance. More...
 
void combine_any_operation_with_block (const bm::word_t *blk, unsigned gap, const bm::word_t *arg_blk, int arg_gap, distance_metric_descriptor *dmit, distance_metric_descriptor *dmit_end)
 Internal function computes different existense of distance metric. More...
 
unsigned combine_count_operation_with_block (const bm::word_t *blk, const bm::word_t *arg_blk, distance_metric metric)
 
unsigned combine_any_operation_with_block (const bm::word_t *blk, unsigned gap, const bm::word_t *arg_blk, int arg_gap, distance_metric metric)
 
void distance_stage (const distance_metric_descriptor *dmit, const distance_metric_descriptor *dmit_end, bool *is_all_and)
 Staging function for distance operation. More...
 
template<class BV >
void distance_operation (const BV &bv1, const BV &bv2, distance_metric_descriptor *dmit, distance_metric_descriptor *dmit_end)
 Distance computing template function. More...
 
template<class BV >
unsigned distance_and_operation (const BV &bv1, const BV &bv2)
 Distance AND computing template function. More...
 
template<class BV >
void distance_operation_any (const BV &bv1, const BV &bv2, distance_metric_descriptor *dmit, distance_metric_descriptor *dmit_end)
 Distance screening template function. More...
 
template<class BV >
bm::id_t count_and (const BV &bv1, const BV &bv2)
 Computes bitcount of AND operation of two bitsets. More...
 
template<class BV >
bm::id_t any_and (const BV &bv1, const BV &bv2)
 Computes if there is any bit in AND operation of two bitsets. More...
 
template<class BV >
bm::id_t count_xor (const BV &bv1, const BV &bv2)
 Computes bitcount of XOR operation of two bitsets. More...
 
template<class BV >
bm::id_t any_xor (const BV &bv1, const BV &bv2)
 Computes if there is any bit in XOR operation of two bitsets. More...
 
template<class BV >
bm::id_t count_sub (const BV &bv1, const BV &bv2)
 Computes bitcount of SUB operation of two bitsets. More...
 
template<class BV >
bm::id_t any_sub (const BV &bv1, const BV &bv2)
 Computes if there is any bit in SUB operation of two bitsets. More...
 
template<class BV >
bm::id_t count_or (const BV &bv1, const BV &bv2)
 Computes bitcount of OR operation of two bitsets. More...
 
template<class BV >
bm::id_t any_or (const BV &bv1, const BV &bv2)
 Computes if there is any bit in OR operation of two bitsets. More...
 
template<class It >
It block_range_scan (It first, It last, unsigned nblock, unsigned *max_id)
 Internal algorithms scans the input for the block range limit. More...
 
template<class BV , class It >
void combine_or (BV &bv, It first, It last)
 OR Combine bitvector and the iterable sequence. More...
 
template<class BV , class It >
void combine_xor (BV &bv, It first, It last)
 XOR Combine bitvector and the iterable sequence. More...
 
template<class BV , class It >
void combine_sub (BV &bv, It first, It last)
 SUB Combine bitvector and the iterable sequence. More...
 
template<class BV , class It >
void combine_and_sorted (BV &bv, It first, It last)
 AND Combine bitvector and the iterable sequence. More...
 
template<class BV , class It >
void combine_and (BV &bv, It first, It last)
 AND Combine bitvector and the iterable sequence. More...
 
template<class BV >
bm::id_t count_intervals (const BV &bv)
 Compute number of bit intervals (GAPs) in the bitvector. More...
 
template<class BV , class It >
void export_array (BV &bv, It first, It last)
 Export bitset from an array of binary data representing the bit vector. More...
 
template<class Func >
void for_each_bit_blk (const bm::word_t *block, bm::id_t offset, Func &bit_functor)
 for-each visitor, calls a special visitor functor for each 1 bit group More...
 
template<typename T , typename Func >
void for_each_gap_blk (const T *buf, bm::id_t offset, Func &bit_functor)
 for-each visitor, calls a special visitor functor for each 1 bit range More...
 
template<typename T , unsigned BPC, unsigned BPS>
void vect_bit_transpose (const T *arr, unsigned arr_size, T tmatrix[BPC][BPS])
 Generic bit-array transposition function T - array type (any int) BPC - bit plain count BPS - bit plain size. More...
 
template<typename T , unsigned BPC, unsigned BPS>
void vect_bit_trestore (const T tmatrix[BPC][BPS], T *arr)
 Restore bit array from the transposition matrix T - array type (any int) BPC - bit plain count BPS - bit plain size. More...
 
template<typename T , unsigned BPC, unsigned BPS>
void tmatrix_distance (const T tmatrix[BPC][BPS], unsigned distance[BPC][BPC])
 Compute pairwise Row x Row Humming distances on plains(rows) of the transposed bit block. More...
 
template<typename T , unsigned BPC, unsigned BPS>
void bit_iblock_make_pcv (const unsigned distance[BPC][BPC], unsigned char *pc_vector)
 !< ibpc limiter More...
 
void bit_iblock_pcv_stat (const unsigned char *BMRESTRICT pc_vector, const unsigned char *BMRESTRICT pc_vector_end, unsigned *BMRESTRICT pc_vector_stat)
 Compute number of ibpc codes in pc_vector. More...
 
void bit_iblock_reduce (const unsigned tmatrix[bm::set_block_plain_cnt][bm::set_block_plain_size], const unsigned char *BMRESTRICT pc_vector, const unsigned char *BMRESTRICT pc_vector_end, unsigned tmatrix_out[bm::set_block_plain_cnt][bm::set_block_plain_size])
 Matrix reduction based on transformation pc vector. More...
 
template<class TMatrix >
void tmatrix_reduce (TMatrix &tmatrix, const unsigned char *pc_vector, const unsigned effective_cols)
 Transposed Matrix reduction based on transformation pc vector. More...
 
template<class TMatrix >
void tmatrix_restore (TMatrix &tmatrix, const unsigned char *pc_vector, const unsigned effective_cols)
 Transposed Matrix restore based on transformation pc vector. More...
 
template<typename GT , typename BT >
void gap_2_bitblock (const GT *BMRESTRICT gap_buf, BT *BMRESTRICT block, unsigned block_size)
 Copy GAP block body to bit block with DGap transformation. More...
 
template<class TMatrix >
void compute_tmatrix_rstat (const TMatrix &tmatrix, const unsigned char *pc_vector, typename TMatrix::rstat *rstat, unsigned effective_cols)
 Compute t-matrix rows statistics used for compression. More...
 
template<typename TM >
unsigned find_effective_columns (const TM &tmatrix)
 Compute effective right column border of the t-matrix. More...
 
template<typename T >
bit_scan_fwd (T v)
 
template<typename T >
min_value (T v1, T v2)
 Get minimum of 2 values. More...
 
template<typename T >
ilog2 (T x)
 Fast loop-less function to find LOG2. More...
 
template<>
bm::gap_word_t ilog2 (gap_word_t x)
 
template<typename T >
ilog2_LUT (T x)
 Lookup table based integer LOG2. More...
 
template<>
bm::gap_word_t ilog2_LUT< bm::gap_word_t > (bm::gap_word_t x)
 Lookup table based short integer LOG2. More...
 
template<class BV >
unsigned serialize (const BV &bv, unsigned char *buf, bm::word_t *temp_block=0, unsigned serialization_flags=0)
 Saves bitvector into memory. More...
 
template<class BV >
unsigned serialize (BV &bv, unsigned char *buf, unsigned serialization_flags=0)
 Saves bitvector into memory. Allocates temporary memory block for bvector. More...
 
template<class BV >
unsigned deserialize (BV &bv, const unsigned char *buf, bm::word_t *temp_block=0)
 Bitvector deserialization from memory. More...
 
template<class SV >
void dynamic_range_clip_high (SV &svect, unsigned high_bit)
 Clip dynamic range for signal higher than specified. More...
 
template<class SV >
void dynamic_range_clip_low (SV &svect, unsigned low_bit)
 Clip dynamic range for signal lower than specified (boost) More...
 
template<class SV >
void compute_nonzero_bvector (const SV &svect, typename SV::bvector_type &bvect)
 Compute bit-vector of non-zero elements. More...
 
template<class SV >
void sparse_vector_serialize (const SV &sv, sparse_vector_serial_layout< SV > &sv_layout, bm::word_t *temp_block=0)
 Serialize sparse vector into a memory buffer(s) structure. More...
 
template<class SV >
int sparse_vector_deserialize (SV &sv, const unsigned char *buf, bm::word_t *temp_block=0)
 Deserialize svector<> More...
 

Variables

const unsigned short set_bitscan_wave_size = 2
 
const unsigned id_max = 0xFFFFFFFF
 
const unsigned set_block_size = 2048u
 
const unsigned set_block_shift = 16u
 
const unsigned set_block_mask = 0xFFFFu
 
const unsigned set_blkblk_mask = 0xFFFFFFu
 
const unsigned set_block_plain_size = set_block_size / 32u
 
const unsigned set_block_plain_cnt = (unsigned)(sizeof(bm::word_t) * 8u)
 
const unsigned set_word_shift = 5u
 
const unsigned set_word_mask = 0x1Fu
 
const unsigned gap_max_buff_len = 1280
 
const unsigned gap_max_bits = 65536
 
const unsigned gap_equiv_len
 
const unsigned gap_levels = 4
 
const unsigned gap_max_level = bm::gap_levels - 1
 
const unsigned set_array_size = 256u
 
const unsigned set_array_shift = 8u
 
const unsigned set_array_mask = 0xFFu
 
const unsigned set_total_blocks = (bm::set_array_size * bm::set_array_size)
 
const unsigned bits_in_block = bm::set_block_size * (unsigned)(sizeof(bm::word_t) * 8)
 
const unsigned bits_in_array = bm::bits_in_block * bm::set_array_size
 
const id64_t all_bits_mask = 0xffffffffffffffff
 
const unsigned set_block_size_op = bm::set_block_size / 2
 
const unsigned char ibpc_uncompr = 0
 
const unsigned char ibpc_all_zero = 1
 !< plain uncompressed More...
 
const unsigned char ibpc_all_one = 2
 !< plain ALL ZERO More...
 
const unsigned char ibpc_equiv = 3
 !< plain ALL ONE More...
 
const unsigned char ibpc_close = 4
 !< plain is equal to plain M More...
 
const unsigned char ibpc_end = 8
 !< plain is close to plain M More...
 
const unsigned char set_block_end = 0
 End of serialization. More...
 
const unsigned char set_block_1zero = 1
 One all-zero block. More...
 
const unsigned char set_block_1one = 2
 One block all-set (1111...) More...
 
const unsigned char set_block_8zero = 3
 Up to 256 zero blocks. More...
 
const unsigned char set_block_8one = 4
 Up to 256 all-set blocks. More...
 
const unsigned char set_block_16zero = 5
 Up to 65536 zero blocks. More...
 
const unsigned char set_block_16one = 6
 UP to 65536 all-set blocks. More...
 
const unsigned char set_block_32zero = 7
 Up to 4G zero blocks. More...
 
const unsigned char set_block_32one = 8
 UP to 4G all-set blocks. More...
 
const unsigned char set_block_azero = 9
 All other blocks zero. More...
 
const unsigned char set_block_aone = 10
 All other blocks one. More...
 
const unsigned char set_block_bit = 11
 Plain bit block. More...
 
const unsigned char set_block_sgapbit = 12
 SGAP compressed bitblock. More...
 
const unsigned char set_block_sgapgap = 13
 SGAP compressed GAP block. More...
 
const unsigned char set_block_gap = 14
 Plain GAP block. More...
 
const unsigned char set_block_gapbit = 15
 GAP compressed bitblock. More...
 
const unsigned char set_block_arrbit = 16
 List of bits ON. More...
 
const unsigned char set_block_bit_interval = 17
 Interval block. More...
 
const unsigned char set_block_arrgap = 18
 List of bits ON (GAP block) More...
 
const unsigned char set_block_bit_1bit = 19
 Bit block with 1 bit ON. More...
 
const unsigned char set_block_gap_egamma = 20
 Gamma compressed GAP block. More...
 
const unsigned char set_block_arrgap_egamma = 21
 Gamma compressed delta GAP array. More...
 
const unsigned char set_block_bit_0runs = 22
 Bit block with encoded zero intervals. More...
 
const unsigned char set_block_arrgap_egamma_inv = 23
 Gamma compressed inverted delta GAP array. More...
 
const unsigned char set_block_arrgap_inv = 24
 List of bits OFF (GAP block) More...
 

Typedef Documentation

◆ bit_operation_count_func_type

typedef bm::id_t(* bm::bit_operation_count_func_type) (const bm::word_t *BMRESTRICT, const bm::word_t *BMRESTRICT, const bm::word_t *BMRESTRICT)

Definition at line 5454 of file bmfunc.h.

◆ gap_operation_func_type

typedef gap_word_t*(* bm::gap_operation_func_type) (const gap_word_t *BMRESTRICT, const gap_word_t *BMRESTRICT, gap_word_t *BMRESTRICT, unsigned &)

Definition at line 5448 of file bmfunc.h.

◆ gap_operation_to_bitset_func_type

typedef void(* bm::gap_operation_to_bitset_func_type) (unsigned *, const gap_word_t *)

Definition at line 5444 of file bmfunc.h.

◆ gap_word_t

typedef unsigned short bm::gap_word_t

Definition at line 60 of file bmconst.h.

◆ id64_t

typedef unsigned long long int bm::id64_t

Definition at line 30 of file bmconst.h.

◆ id_t

typedef unsigned int bm::id_t

Definition at line 34 of file bmconst.h.

◆ short_t

typedef unsigned short bm::short_t

Definition at line 36 of file bmconst.h.

◆ word_t

typedef unsigned int bm::word_t
Examples:
sample6.cpp.

Definition at line 35 of file bmconst.h.

◆ wordop_t

Definition at line 83 of file bmconst.h.

Enumeration Type Documentation

◆ ByteOrder

Byte orders recognized by the library.

Enumerator
BigEndian 
LittleEndian 

Definition at line 389 of file bmfunc.h.

◆ operation

Bit operations enumeration.

Enumerator
BM_AND 
BM_OR 
BM_SUB 
BM_XOR 

Definition at line 260 of file bmfunc.h.

◆ serialization_header_mask

Enumerator
BM_HM_DEFAULT 
BM_HM_RESIZE 

resized vector

BM_HM_ID_LIST 

id list stored

BM_HM_NO_BO 

no byte-order

BM_HM_NO_GAPL 

no GAP levels

Definition at line 90 of file bmserial.h.

◆ set_operation

Nomenclature of set operations.

Enumerator
set_AND 
set_OR 
set_SUB 
set_XOR 
set_ASSIGN 
set_COUNT 
set_COUNT_AND 
set_COUNT_XOR 
set_COUNT_OR 
set_COUNT_SUB_AB 
set_COUNT_SUB_BA 
set_COUNT_A 
set_COUNT_B 
set_END 

Definition at line 231 of file bmfunc.h.

◆ set_representation

set representation variants

Enumerator
set_bitset 

Simple bitset.

set_gap 

GAP-RLE compression.

set_array1 

array of set 1 values

set_array0 

array of 0 values

Definition at line 113 of file bmconst.h.

◆ simd_codes

codes for supported SIMD optimizations

Enumerator
simd_none 
simd_sse2 

!< No SIMD or any other optimization

simd_sse42 

!< Intel SSE2

simd_avx2 

!< Intel SSE4.2

Definition at line 276 of file bmconst.h.

Function Documentation

◆ and_op()

BMFORCEINLINE unsigned bm::and_op ( unsigned  v1,
unsigned  v2 
)

◆ bit_count_change32()

void bm::bit_count_change32 ( const bm::word_t block,
const bm::word_t block_end,
unsigned *  bit_count,
unsigned *  gap_count 
)
inline

Function calculates number of times when bit value changed

Definition at line 2989 of file bmfunc.h.

References BM_ASSERT, and BM_INCWORD_BITCOUNT.

Referenced by bit_block_calc_count_change(), and compute_tmatrix_rstat().

◆ bit_iblock_pcv_stat()

void bm::bit_iblock_pcv_stat ( const unsigned char *BMRESTRICT  pc_vector,
const unsigned char *BMRESTRICT  pc_vector_end,
unsigned *BMRESTRICT  pc_vector_stat 
)
inline

Compute number of ibpc codes in pc_vector.

Definition at line 479 of file bmtrans.h.

References BM_ASSERT.

Referenced by bm::gap_transpose_engine< GT, BT, BLOCK_SIZE >::compute_distance_matrix().

◆ bit_iblock_reduce()

void bm::bit_iblock_reduce ( const unsigned  tmatrix[bm::set_block_plain_cnt][bm::set_block_plain_size],
const unsigned char *BMRESTRICT  pc_vector,
const unsigned char *BMRESTRICT  pc_vector_end,
unsigned  tmatrix_out[bm::set_block_plain_cnt][bm::set_block_plain_size] 
)
inline

Matrix reduction based on transformation pc vector.

Definition at line 499 of file bmtrans.h.

References BM_ASSERT, ibpc_all_one, ibpc_all_zero, ibpc_close, ibpc_equiv, ibpc_uncompr, bm::tmatrix< T, ROWS, COLS >::row(), set_block_plain_cnt, and set_block_plain_size.

◆ bit_recomb()

template<class It1 , class It2 , class BinaryOp , class Encoder >
void bm::bit_recomb ( It1 &  it1,
It2 &  it2,
BinaryOp &  op,
Encoder &  enc,
unsigned  block_size = bm::set_block_size 
)

◆ bit_scan_fwd()

template<typename T >
T bm::bit_scan_fwd ( v)

Definition at line 37 of file bmutil.h.

Referenced by bm::bit_in< TDecoder >::gamma(), and sse2_gap_find().

◆ bitcount64_4way()

unsigned bm::bitcount64_4way ( bm::id64_t  x,
bm::id64_t  y,
bm::id64_t  u,
bm::id64_t  v 
)
inline

◆ bitscan()

template<typename V , typename B >
unsigned short bm::bitscan ( w,
B *  bits 
)

◆ block_range_scan()

template<class It >
It bm::block_range_scan ( It  first,
It  last,
unsigned  nblock,
unsigned *  max_id 
)

Internal algorithms scans the input for the block range limit.

Definition at line 1118 of file bmalgo_impl.h.

References BM_ASSERT, id_max, and set_block_shift.

Referenced by combine_or(), combine_sub(), and combine_xor().

◆ bmfor_each()

template<class T , class F >
F bm::bmfor_each ( first,
last,
f 
)

Special BM optimized analog of STL for_each

Definition at line 737 of file bmfunc.h.

◆ combine_any_operation_with_block() [1/2]

void bm::combine_any_operation_with_block ( const bm::word_t blk,
unsigned  gap,
const bm::word_t arg_blk,
int  arg_gap,
distance_metric_descriptor dmit,
distance_metric_descriptor dmit_end 
)
inline

◆ combine_any_operation_with_block() [2/2]

unsigned bm::combine_any_operation_with_block ( const bm::word_t blk,
unsigned  gap,
const bm::word_t arg_blk,
int  arg_gap,
distance_metric  metric 
)
inline

Convenience internal function to compute combine any for one metric

Definition at line 644 of file bmalgo_impl.h.

References combine_any_operation_with_block(), and bm::distance_metric_descriptor::result.

◆ combine_count_and_operation_with_block()

unsigned bm::combine_count_and_operation_with_block ( const bm::word_t blk,
const bm::word_t arg_blk 
)
inline

Internal function computes AND distance.

Definition at line 332 of file bmalgo_impl.h.

References bit_operation_and_count(), BM_IS_GAP, BMGAP_PTR, gap_bitset_and_count(), gap_count_and(), and set_block_size.

Referenced by distance_and_operation().

◆ combine_count_operation_with_block() [1/2]

void bm::combine_count_operation_with_block ( const bm::word_t blk,
const bm::word_t arg_blk,
distance_metric_descriptor dmit,
distance_metric_descriptor dmit_end 
)
inline

◆ combine_count_operation_with_block() [2/2]

unsigned bm::combine_count_operation_with_block ( const bm::word_t blk,
const bm::word_t arg_blk,
distance_metric  metric 
)
inline

Convenience internal function to compute combine count for one metric

Definition at line 622 of file bmalgo_impl.h.

References combine_count_operation_with_block(), and bm::distance_metric_descriptor::result.

◆ compute_tmatrix_rstat()

template<class TMatrix >
void bm::compute_tmatrix_rstat ( const TMatrix &  tmatrix,
const unsigned char *  pc_vector,
typename TMatrix::rstat *  rstat,
unsigned  effective_cols 
)

Compute t-matrix rows statistics used for compression.

Parameters
tmatrix- transposed matrix
pc_vector- row content vector
rstat- output row vector
effective_cols- effective columns

Definition at line 688 of file bmtrans.h.

References best_representation(), bm::tmatrix< T, ROWS, COLS >::rstat::bit_count, bit_count_change32(), BM_ASSERT, bm::tmatrix< T, ROWS, COLS >::cols(), bm::tmatrix< T, ROWS, COLS >::rstat::gap_count, ibpc_all_one, ibpc_all_zero, ibpc_close, ibpc_equiv, ibpc_uncompr, bm::tmatrix< T, ROWS, COLS >::rows(), and set_bitset.

Referenced by bm::gap_transpose_engine< GT, BT, BLOCK_SIZE >::reduce().

◆ dgap_2_gap()

template<typename T >
void bm::dgap_2_gap ( const T *  dgap_buf,
T *  gap_buf,
gap_header = 0 
)

Convert D-GAP buffer into GAP buffer.

GAP representation is GAP[N] = DGAP[N] + DGAP[N-1]

Parameters
dgap_buf- Delta-GAP buffer
gap_header- GAP header word
gap_buf- GAP buffer

Definition at line 1017 of file bmfunc.h.

References BMREGISTER.

◆ distance_stage()

void bm::distance_stage ( const distance_metric_descriptor dmit,
const distance_metric_descriptor dmit_end,
bool *  is_all_and 
)
inline

Staging function for distance operation.

Returns
temp block allocated (or NULL)

Definition at line 665 of file bmalgo_impl.h.

References COUNT_AND.

Referenced by distance_operation(), and distance_operation_any().

◆ find_effective_columns()

template<typename TM >
unsigned bm::find_effective_columns ( const TM &  tmatrix)

Compute effective right column border of the t-matrix.

Definition at line 746 of file bmtrans.h.

References bm::tmatrix< T, ROWS, COLS >::row().

Referenced by bm::gap_transpose_engine< GT, BT, BLOCK_SIZE >::transpose().

◆ for_each_block()

template<class T , class F >
void bm::for_each_block ( T ***  root,
unsigned  size1,
F &  f 
)

For each block executes supplied function.

Definition at line 708 of file bmfunc.h.

References set_array_size.

Referenced by count_intervals(), and bm::bvector<>::invert().

◆ for_each_dgap()

template<class T , class Func >
void bm::for_each_dgap ( const T *  gap_buf,
Func &  func 
)

D-GAP block for_each algorithm

D-Gap Functor is called for each element but last one.

Parameters
gap_buf- GAP buffer
func- functor object

Definition at line 951 of file bmfunc.h.

Referenced by bm::serializer< bvector_type >::gamma_gap_block().

◆ for_each_nzblock()

template<class T , class F >
void bm::for_each_nzblock ( T ***  root,
unsigned  size1,
F &  f 
)

For each non-zero block executes supplied function.

Definition at line 619 of file bmfunc.h.

References set_array_size.

Referenced by bm::bvector<>::count_blocks(), bm::bvector<>::optimize(), and bm::bvector<>::set_gap_levels().

◆ for_each_nzblock2()

template<class T , class F >
void bm::for_each_nzblock2 ( T ***  root,
unsigned  size1,
F &  f 
)

For each non-zero block executes supplied function.

Definition at line 655 of file bmfunc.h.

References set_array_size.

Referenced by bm::bvector<>::count().

◆ for_each_nzblock_if()

template<class T , class F >
bool bm::for_each_nzblock_if ( T ***  root,
unsigned  size1,
F &  f 
)

For each non-zero block executes supplied function-predicate. Function returns if function-predicate returns true

Definition at line 684 of file bmfunc.h.

References set_array_size.

Referenced by bm::bvector<>::any().

◆ gap_2_bitblock()

template<typename GT , typename BT >
void bm::gap_2_bitblock ( const GT *BMRESTRICT  gap_buf,
BT *BMRESTRICT  block,
unsigned  block_size 
)

Copy GAP block body to bit block with DGap transformation.

Definition at line 660 of file bmtrans.h.

Referenced by bm::gap_transpose_engine< GT, BT, BLOCK_SIZE >::transpose().

◆ gap_2_dgap()

template<typename T >
T* bm::gap_2_dgap ( const T *  gap_buf,
T *  dgap_buf,
bool  copy_head = true 
)

Convert GAP buffer into D-GAP buffer.

Delta GAP representation is DGAP[N] = GAP[N] - GAP[N-1]

Parameters
gap_buf- GAP buffer
dgap_buf- Delta-GAP buffer
copy_head- flag to copy GAP header

Definition at line 992 of file bmfunc.h.

References bm::d_copy_func< T >::dgap_buf_.

◆ gap_bfind()

template<typename T >
unsigned bm::gap_bfind ( const T *  buf,
unsigned  pos,
unsigned *  is_set 
)

◆ gap_buff_op()

template<typename T , class F >
void bm::gap_buff_op ( T *BMRESTRICT  dest,
const T *BMRESTRICT  vect1,
unsigned  vect1_mask,
const T *BMRESTRICT  vect2,
unsigned  vect2_mask,
F &  f,
unsigned &  dlen 
)

Abstract operation for GAP buffers. Receives functor F as a template argument.

Parameters
dest- destination memory buffer.
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.
dlen- destination length after the operation
Note
Internal function.

Definition at line 1124 of file bmfunc.h.

References BMREGISTER, and gap_max_bits.

Referenced by gap_operation_and(), gap_operation_or(), gap_operation_sub(), and gap_operation_xor().

◆ ilog2() [1/2]

template<typename T >
T bm::ilog2 ( x)

Fast loop-less function to find LOG2.

Definition at line 57 of file bmutil.h.

◆ ilog2() [2/2]

template<>
bm::gap_word_t bm::ilog2 ( gap_word_t  x)
inline

Definition at line 70 of file bmutil.h.

◆ ilog2_LUT()

template<typename T >
T bm::ilog2_LUT ( x)

Lookup table based integer LOG2.

Definition at line 101 of file bmutil.h.

Referenced by bm::bit_out< TEncoder >::gamma().

◆ ilog2_LUT< bm::gap_word_t >()

Lookup table based short integer LOG2.

Definition at line 120 of file bmutil.h.

References BMFORCEINLINE.

◆ is_const_set_operation()

bool bm::is_const_set_operation ( set_operation  op)
inline

Returns true if set operation is constant (bitcount)

Definition at line 252 of file bmfunc.h.

References set_COUNT.

Referenced by bm::iterator_deserializer< BV, SerialIterator >::deserialize(), and operation2metric().

◆ min_value()

template<typename T >
T bm::min_value ( v1,
v2 
)

Get minimum of 2 values.

Definition at line 47 of file bmutil.h.

Referenced by distance_and_operation().

◆ op_and()

BMFORCEINLINE unsigned bm::op_and ( unsigned  a,
unsigned  b 
)

Definition at line 98 of file bmsse4.h.

◆ op_or()

BMFORCEINLINE unsigned bm::op_or ( unsigned  a,
unsigned  b 
)

Definition at line 89 of file bmsse4.h.

References BMFORCEINLINE.

◆ op_xor()

BMFORCEINLINE unsigned bm::op_xor ( unsigned  a,
unsigned  b 
)

Definition at line 79 of file bmsse4.h.

References BMFORCEINLINE.

◆ operator &()

template<class Alloc >
bvector<Alloc> bm::operator& ( const bvector< Alloc > &  v1,
const bvector< Alloc > &  v2 
)
inline

Definition at line 1911 of file bm.h.

References bm::bvector< Alloc >::bit_and().

◆ operator-()

template<class Alloc >
bvector<Alloc> bm::operator- ( const bvector< Alloc > &  v1,
const bvector< Alloc > &  v2 
)
inline

Definition at line 1956 of file bm.h.

References bm::bvector< Alloc >::bit_sub().

◆ operator^()

template<class Alloc >
bvector<Alloc> bm::operator^ ( const bvector< Alloc > &  v1,
const bvector< Alloc > &  v2 
)
inline

Definition at line 1941 of file bm.h.

References bm::bvector< Alloc >::bit_xor().

◆ operator|()

template<class Alloc >
bvector<Alloc> bm::operator| ( const bvector< Alloc > &  v1,
const bvector< Alloc > &  v2 
)
inline

Definition at line 1926 of file bm.h.

References bm::bvector< Alloc >::bit_or().

◆ or_op()

BMFORCEINLINE unsigned bm::or_op ( unsigned  v1,
unsigned  v2 
)

GAP or functor.

Definition at line 3475 of file bmfunc.h.

Referenced by gap_count_or().

◆ parallel_popcnt_32()

int bm::parallel_popcnt_32 ( unsigned int  n)
inline

Definition at line 139 of file bmfunc.h.

References BMFORCEINLINE.

◆ setop2op()

bm::operation bm::setop2op ( bm::set_operation  op)
inline

Convert set operation to operation.

Definition at line 272 of file bmfunc.h.

References BM_ASSERT, set_AND, set_OR, set_SUB, and set_XOR.

Referenced by bm::iterator_deserializer< BV, SerialIterator >::deserialize().

◆ sse2_and()

BMFORCEINLINE __m128i bm::sse2_and ( __m128i  a,
__m128i  b 
)

Definition at line 383 of file bmsse_util.h.

References BMFORCEINLINE.

◆ sse2_bit_block_calc_count_change()

bm::id_t bm::sse2_bit_block_calc_count_change ( const __m128i *BMRESTRICT  block,
const __m128i *BMRESTRICT  block_end,
unsigned *BMRESTRICT  bit_count 
)
inline

Definition at line 230 of file bmsse2.h.

References BM_ALIGN16, BM_ALIGN16ATTR, BM_INCWORD_BITCOUNT, and BMRESTRICT.

Referenced by bit_block_calc_count_change().

◆ sse2_bit_count_op()

template<class Func >
bm::id_t bm::sse2_bit_count_op ( const __m128i *BMRESTRICT  block,
const __m128i *BMRESTRICT  block_end,
const __m128i *BMRESTRICT  mask_block,
Func  sse2_func 
)

Definition at line 118 of file bmsse2.h.

References BM_ALIGN16, and BM_ALIGN16ATTR.

◆ sse2_gap_find()

unsigned bm::sse2_gap_find ( const bm::gap_word_t *BMRESTRICT  pbuf,
const bm::gap_word_t  pos,
const unsigned  size 
)
inline

SSE4.2 check for one to two (variable len) 128 bit SSE lines for gap search results (8 elements)

Definition at line 388 of file bmsse2.h.

References bit_scan_fwd(), BM_ASSERT, and BMRESTRICT.

Referenced by gap_test_unr().

◆ sse2_gap_sum_arr()

const bm::gap_word_t* bm::sse2_gap_sum_arr ( const bm::gap_word_t *BMRESTRICT  pbuf,
unsigned  sse_vect_waves,
unsigned *  sum 
)
inline

Gap block population count (array sum) utility.

Parameters
pbuf- unrolled, aligned to 1-start GAP buffer
sse_vect_waves- number of SSE vector lines to process
sum- result acumulator
Returns
tail pointer

Definition at line 418 of file bmsse_util.h.

Referenced by gap_bit_count_unr().

◆ sse2_or()

BMFORCEINLINE __m128i bm::sse2_or ( __m128i  a,
__m128i  b 
)

Definition at line 389 of file bmsse_util.h.

References BMFORCEINLINE.

◆ sse2_sub()

BMFORCEINLINE __m128i bm::sse2_sub ( __m128i  a,
__m128i  b 
)

Definition at line 402 of file bmsse_util.h.

◆ sse2_xor()

BMFORCEINLINE __m128i bm::sse2_xor ( __m128i  a,
__m128i  b 
)

Definition at line 396 of file bmsse_util.h.

References BMFORCEINLINE.

◆ sse4_bit_count_op()

template<class Func >
bm::id_t bm::sse4_bit_count_op ( const __m128i *BMRESTRICT  block,
const __m128i *BMRESTRICT  block_end,
const __m128i *BMRESTRICT  mask_block,
Func  sse2_func 
)

Definition at line 105 of file bmsse4.h.

◆ sse4_gap_find()

unsigned bm::sse4_gap_find ( const bm::gap_word_t *BMRESTRICT  pbuf,
const bm::gap_word_t  pos,
const unsigned  size 
)
inline

SSE4.2 check for one to two (variable len) 128 bit SSE lines for gap search results (8 elements)

Definition at line 353 of file bmsse4.h.

References BM_ASSERT, and BMRESTRICT.

Referenced by gap_test_unr().

◆ sub_op()

BMFORCEINLINE unsigned bm::sub_op ( unsigned  v1,
unsigned  v2 
)

GAP or functor.

Definition at line 3481 of file bmfunc.h.

References BMFORCEINLINE.

Referenced by gap_count_sub().

◆ sum_arr()

template<class T >
T bm::sum_arr ( T *  first,
T *  last 
)

Computes SUM of all elements of the sequence

Definition at line 749 of file bmfunc.h.

◆ tmatrix_reduce()

template<class TMatrix >
void bm::tmatrix_reduce ( TMatrix &  tmatrix,
const unsigned char *  pc_vector,
const unsigned  effective_cols 
)

Transposed Matrix reduction based on transformation pc vector.

Definition at line 554 of file bmtrans.h.

References BM_ASSERT, bm::tmatrix< T, ROWS, COLS >::cols(), ibpc_all_one, ibpc_all_zero, ibpc_close, ibpc_equiv, ibpc_uncompr, and bm::tmatrix< T, ROWS, COLS >::row().

Referenced by bm::gap_transpose_engine< GT, BT, BLOCK_SIZE >::reduce().

◆ tmatrix_restore()

template<class TMatrix >
void bm::tmatrix_restore ( TMatrix &  tmatrix,
const unsigned char *  pc_vector,
const unsigned  effective_cols 
)

Transposed Matrix restore based on transformation pc vector.

Definition at line 601 of file bmtrans.h.

References BM_ASSERT, bm::tmatrix< T, ROWS, COLS >::cols(), ibpc_all_one, ibpc_all_zero, ibpc_close, ibpc_equiv, ibpc_uncompr, and bm::tmatrix< T, ROWS, COLS >::row().

Referenced by bm::gap_transpose_engine< GT, BT, BLOCK_SIZE >::restore().

◆ vect_bit_transpose()

template<typename T , unsigned BPC, unsigned BPS>
void bm::vect_bit_transpose ( const T *  arr,
unsigned  arr_size,
tmatrix[BPC][BPS] 
)

Generic bit-array transposition function T - array type (any int) BPC - bit plain count BPS - bit plain size.

Parameters
arr- source array start
arr_size- source array size
tmatrix- destination bit matrix

Definition at line 295 of file bmtrans.h.

References BM_ASSERT, bm::bit_grabber< T, BPC >::get(), and bm::tmatrix< T, ROWS, COLS >::row().

◆ vect_bit_trestore()

template<typename T , unsigned BPC, unsigned BPS>
void bm::vect_bit_trestore ( const T  tmatrix[BPC][BPS],
T *  arr 
)

Restore bit array from the transposition matrix T - array type (any int) BPC - bit plain count BPS - bit plain size.

Parameters
arr- dest array
tmatrix- source bit-slice matrix

Definition at line 328 of file bmtrans.h.

References bm::bit_trans_grabber< T, BPC, BPS >::get().

◆ xor_op()

BMFORCEINLINE unsigned bm::xor_op ( unsigned  v1,
unsigned  v2 
)

GAP xor functor.

Definition at line 3468 of file bmfunc.h.

Referenced by gap_count_xor(), gap_operation_any_xor(), and gap_operation_xor().

◆ xor_swap()

template<typename W >
void bm::xor_swap ( W &  x,
W &  y 
)

XOR swap two scalar variables.

Definition at line 324 of file bmfunc.h.

References BM_ASSERT.

Referenced by bm::sparse_vector< unsigned, bm::bvector<> >::swap(), and bm::bvector<>::swap().

Variable Documentation

◆ all_bits_mask

const id64_t bm::all_bits_mask = 0xffffffffffffffff

Definition at line 84 of file bmconst.h.

Referenced by bm::bvector<>::combine_operation(), and is_bits_one().

◆ bits_in_array

const unsigned bm::bits_in_array = bm::bits_in_block * bm::set_array_size

◆ bits_in_block

const unsigned bm::bits_in_block = bm::set_block_size * (unsigned)(sizeof(bm::word_t) * 8)

◆ gap_equiv_len

const unsigned bm::gap_equiv_len
Initial value:
= (unsigned)
((sizeof(bm::word_t) * bm::set_block_size) / sizeof(gap_word_t))
const unsigned set_block_size
Definition: bmconst.h:44
unsigned int word_t
Definition: bmconst.h:35
unsigned short gap_word_t
Definition: bmconst.h:60

Definition at line 64 of file bmconst.h.

Referenced by bm::bvector<>::combine_operation(), bm::iterator_deserializer< BV, SerialIterator >::deserialize(), bm::serializer< bvector_type >::encode_gap_block(), and bm::serializer< bvector_type >::serialize().

◆ gap_levels

const unsigned bm::gap_levels = 4

◆ gap_max_bits

const unsigned bm::gap_max_bits = 65536

◆ gap_max_buff_len

const unsigned bm::gap_max_buff_len = 1280

Definition at line 62 of file bmconst.h.

Referenced by combine_any_operation_with_block(), and improve_gap_levels().

◆ gap_max_level

const unsigned bm::gap_max_level = bm::gap_levels - 1

Definition at line 67 of file bmconst.h.

◆ ibpc_all_one

const unsigned char bm::ibpc_all_one = 2

!< plain ALL ZERO

Definition at line 391 of file bmtrans.h.

Referenced by bit_iblock_make_pcv(), bit_iblock_reduce(), compute_tmatrix_rstat(), tmatrix_reduce(), and tmatrix_restore().

◆ ibpc_all_zero

const unsigned char bm::ibpc_all_zero = 1

!< plain uncompressed

Definition at line 390 of file bmtrans.h.

Referenced by bit_iblock_make_pcv(), bit_iblock_reduce(), compute_tmatrix_rstat(), tmatrix_reduce(), and tmatrix_restore().

◆ ibpc_close

const unsigned char bm::ibpc_close = 4

!< plain is equal to plain M

Definition at line 393 of file bmtrans.h.

Referenced by bit_iblock_reduce(), compute_tmatrix_rstat(), tmatrix_reduce(), and tmatrix_restore().

◆ ibpc_end

const unsigned char bm::ibpc_end = 8

!< plain is close to plain M

Definition at line 395 of file bmtrans.h.

◆ ibpc_equiv

const unsigned char bm::ibpc_equiv = 3

!< plain ALL ONE

Definition at line 392 of file bmtrans.h.

Referenced by bit_iblock_reduce(), compute_tmatrix_rstat(), tmatrix_reduce(), and tmatrix_restore().

◆ ibpc_uncompr

const unsigned char bm::ibpc_uncompr = 0

◆ id_max

const unsigned bm::id_max = 0xFFFFFFFF

◆ set_array_mask

const unsigned bm::set_array_mask = 0xFFu

◆ set_array_shift

const unsigned bm::set_array_shift = 8u

◆ set_array_size

const unsigned bm::set_array_size = 256u

◆ set_bitscan_wave_size

const unsigned short bm::set_bitscan_wave_size = 2

◆ set_blkblk_mask

const unsigned bm::set_blkblk_mask = 0xFFFFFFu

Definition at line 47 of file bmconst.h.

Referenced by bm::bvector<>::find().

◆ set_block_16one

const unsigned char bm::set_block_16one = 6

UP to 65536 all-set blocks.

Definition at line 67 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_16zero

const unsigned char bm::set_block_16zero = 5

Up to 65536 zero blocks.

Definition at line 66 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_1one

const unsigned char bm::set_block_1one = 2

One block all-set (1111...)

Definition at line 63 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_1zero

const unsigned char bm::set_block_1zero = 1

One all-zero block.

Definition at line 62 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_32one

const unsigned char bm::set_block_32one = 8

UP to 4G all-set blocks.

Definition at line 69 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_32zero

const unsigned char bm::set_block_32zero = 7

Up to 4G zero blocks.

Definition at line 68 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_8one

const unsigned char bm::set_block_8one = 4

Up to 256 all-set blocks.

Definition at line 65 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_8zero

const unsigned char bm::set_block_8zero = 3

Up to 256 zero blocks.

Definition at line 64 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_aone

const unsigned char bm::set_block_aone = 10

All other blocks one.

Definition at line 71 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_arrbit

const unsigned char bm::set_block_arrbit = 16

◆ set_block_arrgap

const unsigned char bm::set_block_arrgap = 18

◆ set_block_arrgap_egamma

const unsigned char bm::set_block_arrgap_egamma = 21

◆ set_block_arrgap_egamma_inv

const unsigned char bm::set_block_arrgap_egamma_inv = 23

◆ set_block_arrgap_inv

const unsigned char bm::set_block_arrgap_inv = 24

◆ set_block_azero

const unsigned char bm::set_block_azero = 9

All other blocks zero.

Definition at line 70 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_bit

const unsigned char bm::set_block_bit = 11

◆ set_block_bit_0runs

const unsigned char bm::set_block_bit_0runs = 22

◆ set_block_bit_1bit

const unsigned char bm::set_block_bit_1bit = 19

◆ set_block_bit_interval

const unsigned char bm::set_block_bit_interval = 17

◆ set_block_end

const unsigned char bm::set_block_end = 0

End of serialization.

Definition at line 61 of file bmserial.h.

Referenced by bm::deserializer< BV, DEC >::deserialize(), and bm::serial_stream_iterator< DEC >::next().

◆ set_block_gap

const unsigned char bm::set_block_gap = 14

◆ set_block_gap_egamma

const unsigned char bm::set_block_gap_egamma = 20

◆ set_block_gapbit

const unsigned char bm::set_block_gapbit = 15

◆ set_block_mask

const unsigned bm::set_block_mask = 0xFFFFu

◆ set_block_plain_cnt

const unsigned bm::set_block_plain_cnt = (unsigned)(sizeof(bm::word_t) * 8u)

Definition at line 50 of file bmconst.h.

Referenced by bit_iblock_reduce().

◆ set_block_plain_size

const unsigned bm::set_block_plain_size = set_block_size / 32u

Definition at line 49 of file bmconst.h.

Referenced by bit_iblock_reduce().

◆ set_block_sgapbit

const unsigned char bm::set_block_sgapbit = 12

SGAP compressed bitblock.

Definition at line 73 of file bmserial.h.

◆ set_block_sgapgap

const unsigned char bm::set_block_sgapgap = 13

SGAP compressed GAP block.

Definition at line 74 of file bmserial.h.

◆ set_block_shift

const unsigned bm::set_block_shift = 16u

◆ set_block_size

const unsigned bm::set_block_size = 2048u

Definition at line 44 of file bmconst.h.

Referenced by bm::bv_statistics::add_bit_block(), bm::mem_alloc< BA, PA >::alloc_bit_block(), bit_block_and(), bit_block_copy(), bit_block_or(), bit_block_rotate_left_1(), bit_block_rotate_left_1_unr(), bit_block_set(), bit_block_sub(), bit_block_xor(), bit_find_in_block(), bit_operation_or(), bm::bvector<>::calc_stat(), combine_any_operation_with_block(), combine_count_and_operation_with_block(), combine_count_operation_with_block(), bm::bvector<>::combine_operation(), bm::bvector<>::compare(), bm::deserializer< BV, DEC >::deserialize(), bm::serializer< bvector_type >::encode_bit_interval(), export_array(), for_each_bit_blk(), bm::mem_alloc< BA, PA >::free_bit_block(), bm::serial_stream_iterator< DEC >::get_bit_block_AND(), bm::serial_stream_iterator< DEC >::get_bit_block_ASSIGN(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_A(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_AND(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_OR(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_SUB_AB(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_SUB_BA(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_XOR(), bm::serial_stream_iterator< DEC >::get_bit_block_OR(), bm::serial_stream_iterator< DEC >::get_bit_block_SUB(), bm::serial_stream_iterator< DEC >::get_bit_block_XOR(), bm::bvector< Alloc >::enumerator::go_to(), bm::random_subset< BV >::sample(), and bm::serializer< bvector_type >::serialize().

◆ set_block_size_op

const unsigned bm::set_block_size_op = bm::set_block_size / 2

Definition at line 85 of file bmconst.h.

Referenced by bm::bvector<>::compare().

◆ set_total_blocks

const unsigned bm::set_total_blocks = (bm::set_array_size * bm::set_array_size)

◆ set_word_mask

const unsigned bm::set_word_mask = 0x1Fu

◆ set_word_shift

const unsigned bm::set_word_shift = 5u