BitMagic-C++
Data Structures | Typedefs | Enumerations | Functions | Variables
bm Namespace Reference

Data Structures

struct  _copyright
 Internal structure. More...
 
class  aggregator
 Algorithms for fast aggregation of a group of bit-vectors. More...
 
struct  all_set
 Structure carries pointer on bit block with all bits 1. More...
 
class  alloc_pool
 Allocation pool object. More...
 
class  base_sparse_vector
 Base class for bit-transposed sparse vector construction. More...
 
class  basic_bmatrix
 Basic dense bit-matrix class. More...
 
struct  bit_AND
 Bit AND functor. More...
 
struct  bit_ASSIGN
 Bit ASSIGN functor. More...
 
struct  bit_block_t
 bit-block array wrapped into union for correct interpretation of 32-bit vs 64-bit access vs SIMD 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_decode_cache
 bit-decode cache structure 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 memory allocation footprint, serialization projection, number of vectors. 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 bit-vector for auxiliary purposes. More...
 
class  bvps_addr_resolver
 Bit-bector prefix sum address resolver using bit-vector prefix sum as a space compactor. More...
 
class  chrono_taker
 Utility class to collect performance measurements and statistics. More...
 
class  compressed_buffer_collection
 Compressed (sparse collection of objects) More...
 
class  compressed_collection
 Compressed (sparse collection of objects) 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
 DeBruijn majic table. More...
 
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...
 
struct  lzcnt_table
 Structure for LZCNT constants (4-bit) 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
 
struct  pair
 Pair type. More...
 
class  pointer_pool_array
 Pool of pointers to buffer cyclic allocations. More...
 
class  ptr_allocator
 Default malloc based bitblock allocator class. More...
 
class  ptr_guard
 Mini auto-pointer for internal memory management. More...
 
union  ptr_payload_t
 helper union to interpret pointer as integers More...
 
class  random_subset
 
class  rank_compressor
 Algorithms for rank compression of bit-vector. More...
 
class  rsc_sparse_vector
 Rank-Select compressed sparse vector. More...
 
class  serial_stream_iterator
 Serialization stream iterator. More...
 
class  serializer
 Bit-vector serialization class. More...
 
class  set2set_11_transform
 Integer set to set transformation (functional image in groups theory) https://en.wikipedia.org/wiki/Image_(mathematics) More...
 
struct  similarity_batch
 
class  similarity_descriptor
 
class  sparse_vector
 sparse vector with runtime compression using bit transposition method More...
 
class  sparse_vector_deserializer
 sparse vector de-serializer More...
 
class  sparse_vector_scanner
 algorithms for sparse_vector scan/seach More...
 
struct  sparse_vector_serial_layout
 layout class for serialization buffer structure More...
 
class  sparse_vector_serializer
 Serialize sparse vector into a memory buffer(s) structure. More...
 
class  sse_empty_guard
 SSE2 reinitialization guard class. More...
 
class  str_sparse_vector
 sparse vector for strings with compression using bit transposition method More...
 
class  sv_addr_resolver
 sparse vector based address resolver (no space compactor, just bit-plane compressors provided by sparse_vector) More...
 
struct  tmatrix
 Mini-matrix for bit transposition purposes. More...
 
struct  tzcnt_table
 Structure for TZCNT constants. 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)
 
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 bm::alloc_pool< block_allocator, ptr_allocatorstandard_alloc_pool
 
typedef bm::mem_alloc< block_allocator, ptr_allocator, standard_alloc_poolstandard_allocator
 

Enumerations

enum  strategy { BM_BIT = 0, BM_GAP = 1 }
 Block allocation strategies. More...
 
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
}
 Codes of set operations. More...
 
enum  operation { BM_AND = set_AND, BM_OR = set_OR, BM_SUB = set_SUB, BM_XOR = set_XOR }
 Bit operations. More...
 
enum  sort_order { BM_UNSORTED = 0, BM_SORTED = 1, BM_SORTED_UNIFORM = 2, BM_UNKNOWN = 3 }
 Sort order declaration. More...
 
enum  set_representation { set_bitset = 0, set_gap = 1, set_array1 = 2, set_array0 = 3 }
 set representation variants More...
 
enum  null_support { use_null = 0, no_null = 1 }
 NULL-able value support. More...
 
enum  simd_codes {
  simd_none = 0, simd_sse2 = 1, simd_sse42 = 2, simd_avx2 = 5,
  simd_avx512 = 6
}
 codes for supported SIMD optimizations More...
 
enum  ByteOrder { BigEndian = 0, LittleEndian = 1 }
 Byte orders recognized by the library. 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), BM_HM_64_BIT = (1 << 5)
}
 
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 > &bv1, const bvector< Alloc > &bv2)
 
template<class Alloc >
bvector< Alloc > operator| (const bvector< Alloc > &bv1, const bvector< Alloc > &bv2)
 
template<class Alloc >
bvector< Alloc > operator^ (const bvector< Alloc > &bv1, const bvector< Alloc > &bv2)
 
template<class Alloc >
bvector< Alloc > operator- (const bvector< Alloc > &bv1, const bvector< Alloc > &bv2)
 
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)
 
template<typename BI_TYPE >
void get_block_coord (BI_TYPE nb, unsigned &i, unsigned &j)
 Recalc linear bvector block index into 2D matrix coordinates. More...
 
template<class T >
unsigned bit_scan_reverse (T value)
 
BMFORCEINLINE bm::id_t word_bitcount (bm::id_t w)
 
int parallel_popcnt_32 (unsigned int n)
 
BMFORCEINLINE unsigned 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)
 
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 (T w, B *bits)
 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 short offs)
 Unpacks word into list of ON bit indexes using popcnt method. More...
 
template<typename B >
unsigned short bitscan_popcnt (bm::id_t w, B *bits)
 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)
 
unsigned word_select64_linear (bm::id64_t w, unsigned rank)
 word find index of the rank-th bit set by bit-testing More...
 
unsigned word_select64_bitscan (bm::id64_t w, unsigned rank)
 word find index of the rank-th bit set by bit-testing More...
 
unsigned word_select64 (bm::id64_t w, unsigned rank)
 word find index of the rank-th bit set by bit-testing More...
 
BMFORCEINLINE bm::id64_t widx_to_digest_mask (unsigned w_idx)
 Compute digest mask for word address in block. More...
 
BMFORCEINLINE bm::id64_t digest_mask (unsigned from, unsigned to)
 Compute digest mask for [from..to] positions. More...
 
bool check_zero_digest (bm::id64_t digest, unsigned bitpos_from, unsigned bitpos_to)
 check if all digest bits for the range [from..to] are 0 More...
 
void block_init_digest0 (bm::word_t *const block, bm::id64_t digest)
 Init block with 000111000 pattren based on digest. More...
 
bm::id64_t calc_block_digest0 (const bm::word_t *const block)
 Compute digest for 64 non-zero areas. More...
 
bm::id64_t update_block_digest0 (const bm::word_t *const block, bm::id64_t digest)
 Compute digest for 64 non-zero areas based on existing digest (function revalidates zero areas) More...
 
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 N >
bool find_not_null_ptr (bm::word_t ***arr, N start, N size, N *pos)
 
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...
 
bool bit_is_all_zero (const bm::word_t *BMRESTRICT start)
 Returns "true" if all bits in the block are 0. More...
 
BMFORCEINLINE bool gap_is_all_zero (const bm::gap_word_t *buf)
 Checks if GAP block is all-zero. More...
 
BMFORCEINLINE bool gap_is_all_one (const bm::gap_word_t *buf)
 Checks if GAP block is all-one. More...
 
BMFORCEINLINE bm::gap_word_t gap_length (const bm::gap_word_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 >
gap_level (const T *buf)
 Returs GAP blocks capacity level. More...
 
template<typename T >
unsigned gap_find_last (const T *buf, unsigned *last)
 GAP block find the last set bit. More...
 
template<typename T >
unsigned gap_find_first (const T *buf, unsigned *first)
 GAP block find the first set bit. 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<typename T , typename N , typename F >
void for_each_nzblock_range (T ***root, N top_size, N nb_from, N nb_to, F &f)
 
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<typename T , typename BI , typename F >
bool for_each_nzblock_if (T ***root, BI size1, F &f)
 
template<class T , class F , typename BLOCK_IDX >
void for_each_block (T ***root, unsigned size1, F &f, BLOCK_IDX start)
 
template<class T , class F >
bmfor_each (T first, T last, F f)
 
template<typename T >
bm::id64_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, unsigned left, unsigned right)
 Counts 1 bits in GAP buffer in the closed [left, right] range. More...
 
template<typename T , typename SIZE_TYPE >
SIZE_TYPE gap_find_rank (const T *const block, SIZE_TYPE rank, unsigned nbit_from, unsigned &nbit_pos)
 GAP block find position for the rank. 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 >
bool gap_shift_r1 (T *buf, unsigned co_flag, unsigned *new_len)
 Right shift GAP block by 1 bit. More...
 
template<typename T >
bool gap_shift_l1 (T *buf, unsigned co_flag, unsigned *new_len)
 Left shift GAP block by 1 bit. 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 >
unsigned gap_block_find (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 void clear_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 *pcurr)
 SUB (AND NOT) GAP block to bitblock. More...
 
template<typename T >
void gap_sub_to_bitset (unsigned *dest, const T *pcurr, bm::id64_t digest0)
 SUB (AND NOT) GAP block to bitblock with digest assist. More...
 
template<typename T >
void gap_xor_to_bitset (unsigned *dest, const T *pcurr)
 XOR GAP block to bitblock. More...
 
template<typename T >
void gap_add_to_bitset (unsigned *dest, const T *pcurr, unsigned len)
 Adds(OR) GAP block to bitblock. More...
 
template<typename T >
void gap_add_to_bitset (unsigned *dest, const T *pcurr)
 Adds(OR) GAP block to bitblock. More...
 
template<typename T >
void gap_and_to_bitset (unsigned *dest, const T *pcurr)
 ANDs GAP block to bitblock. More...
 
template<typename T >
void gap_and_to_bitset (unsigned *dest, const T *pcurr, bm::id64_t digest0)
 ANDs GAP block to bitblock with digest assist. More...
 
template<typename T >
bm::id_t gap_bitset_and_count (const unsigned *block, const T *pcurr)
 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 *pcurr)
 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 >
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)
 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 >
void set_gap_level (T *buf, int level)
 Sets GAP block capacity level. More...
 
template<typename T >
int gap_calc_level (unsigned 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...
 
unsigned bit_block_to_gap (gap_word_t *BMRESTRICT dest, const unsigned *BMRESTRICT block, unsigned dest_len)
 Converts bit block to GAP. More...
 
unsigned bit_to_gap (gap_word_t *BMRESTRICT dest, const unsigned *BMRESTRICT block, unsigned dest_len)
 
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_count (const bm::word_t *block)
 Bitcount for bit block. More...
 
bm::id_t bit_block_count (const bm::word_t *const block, bm::id64_t digest)
 Bitcount for bit block. 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)
 
unsigned bit_block_change32 (const bm::word_t *block)
 
void bit_block_change_bc32 (const bm::word_t *block, unsigned *gc, unsigned *bc)
 
unsigned bit_block_calc_change (const bm::word_t *block)
 
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)
 Unrolled cyclic rotation of bit-block left by 1 bit. More...
 
bm::word_t bit_block_insert (bm::word_t *block, unsigned bitpos, bool value)
 insert bit into position and shift the rest right with carryover More...
 
bool bit_block_shift_r1 (bm::word_t *block, bm::word_t *empty_acc, bm::word_t co_flag)
 Right bit-shift bitblock by 1 bit (reference) More...
 
bool bit_block_shift_r1_unr (bm::word_t *block, bm::word_t *empty_acc, bm::word_t co_flag)
 Right bit-shift of bit-block by 1 bit (loop unrolled) More...
 
bool bit_block_shift_l1 (bm::word_t *block, bm::word_t *empty_acc, bm::word_t co_flag)
 Left bit-shift bitblock by 1 bit (reference) More...
 
bool bit_block_shift_l1_unr (bm::word_t *block, bm::word_t *empty_acc, bm::word_t co_flag)
 Left bit-shift of bit-block by 1 bit (loop unrolled) More...
 
void bit_block_erase (bm::word_t *block, unsigned bitpos, bool carry_over)
 erase bit from position and shift the rest right with carryover More...
 
bool bit_block_shift_r1_and (bm::word_t *BMRESTRICT block, bm::word_t co_flag, const bm::word_t *BMRESTRICT mask_block, bm::id64_t *BMRESTRICT digest)
 Right bit-shift of bit-block by 1 bit (reference) + AND. More...
 
bool bit_block_shift_r1_and_unr (bm::word_t *BMRESTRICT block, bm::word_t co_flag, const bm::word_t *BMRESTRICT mask_block, bm::id64_t *BMRESTRICT digest)
 Right bit-shift bitblock by 1 bit (reference) + AND. More...
 
template<typename T >
void bit_invert (T *start)
 
bool is_bits_one (const bm::wordop_t *start)
 Returns "true" if all bits in the block are 1. 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_stream (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src)
 Bitblock copy/stream operation. More...
 
bm::id64_t 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...
 
bm::id64_t bit_block_and (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src, bm::id64_t digest)
 digest based bit-block AND More...
 
bm::id64_t bit_block_and_5way (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src0, const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src2, const bm::word_t *BMRESTRICT src3, bm::id64_t digest)
 digest based bit-block AND 5-way More...
 
bm::id64_t bit_block_and_2way (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src2, bm::id64_t digest)
 digest based bit-block AND More...
 
unsigned bit_block_and_count (const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT 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 *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 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 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 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 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 *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 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 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 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 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 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 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 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 src2)
 Performs bitblock OR operation test. More...
 
bool 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...
 
bool bit_block_or_2way (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src2)
 2 way (target := source1 | source2) bitblock OR operation. More...
 
bm::id64_t bit_block_xor_2way (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src2)
 2 way (target := source1 ^ source2) bitblock XOR operation. More...
 
bool bit_block_or_3way (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src2)
 3 way (target | source1 | source2) bitblock OR operation. Function does not analyse availability of source and destination blocks. More...
 
bool bit_block_or_5way (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src2, const bm::word_t *BMRESTRICT src3, const bm::word_t *BMRESTRICT src4)
 5 way (target, source1, source2) 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...
 
bm::id64_t 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::id64_t bit_block_sub (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src, bm::id64_t digest)
 digest based bitblock SUB (AND NOT) operation More...
 
bm::id64_t bit_block_sub_2way (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src1, const bm::word_t *BMRESTRICT src2, bm::id64_t digest)
 digest based bitblock SUB (AND NOT) operation (3 operand) More...
 
bm::word_tbit_operation_sub (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src)
 bitblock SUB operation. More...
 
bm::id64_t 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...
 
void bit_andnot_arr_ffmask (bm::word_t *BMRESTRICT dst, const bm::word_t *BMRESTRICT src)
 bitblock AND NOT with constant ~0 mask operation. 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 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 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...
 
unsigned bit_block_find (const bm::word_t *block, unsigned nbit, unsigned *pos)
 Searches for the next 1 bit in the BIT block. More...
 
unsigned bit_find_last (const bm::word_t *block, unsigned *last)
 BIT block find the last set bit (backward search) More...
 
unsigned bit_find_first (const bm::word_t *block, unsigned *first)
 BIT block find the first set bit. More...
 
unsigned bit_find_first (const bm::word_t *block, unsigned *first, bm::id64_t digest)
 BIT block find the first set bit. More...
 
bool bit_find_first_if_1 (const bm::word_t *block, unsigned *first, bm::id64_t digest)
 BIT block find the first set bit if only 1 bit is set. More...
 
template<typename SIZE_TYPE >
SIZE_TYPE bit_find_rank (const bm::word_t *const block, SIZE_TYPE rank, unsigned nbit_from, unsigned &nbit_pos)
 BIT block find position for the rank. More...
 
template<typename SIZE_TYPE >
SIZE_TYPE block_find_rank (const bm::word_t *const block, SIZE_TYPE rank, unsigned nbit_from, unsigned &nbit_pos)
 Find rank in block (GAP or BIT) 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...
 
bool check_block_zero (const bm::word_t *blk, bool deep_scan)
 Checks all conditions and returns true if block consists of only 0 bits. More...
 
bool check_block_one (const bm::word_t *blk, bool deep_scan)
 Checks if block has only 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 (Nx 32-bit words) More...
 
void bit_block_gather_scatter (unsigned *arr, const bm::word_t *blk, const unsigned *idx, unsigned size, unsigned start, unsigned bit_idx)
 bit index to word gather-scatter algorithm (SIMD) More...
 
template<typename TRGW , typename IDX , typename SZ >
void bit_block_gather_scatter (TRGW *arr, const bm::word_t *blk, const IDX *idx, SZ size, SZ start, unsigned bit_idx)
 bit index to word gather-scatter algorithm More...
 
bm::id64_t idx_arr_block_lookup_u64 (const bm::id64_t *idx, bm::id64_t size, bm::id64_t nb, bm::id64_t start)
 block boundaries look ahead U32 More...
 
unsigned idx_arr_block_lookup_u32 (const unsigned *idx, unsigned size, unsigned nb, unsigned start)
 block boundaries look ahead U32 More...
 
void set_block_bits_u64 (bm::word_t *BMRESTRICT block, const bm::id64_t *BMRESTRICT idx, bm::id64_t start, bm::id64_t stop)
 set bits in a bit-block using global index More...
 
void set_block_bits_u32 (bm::word_t *BMRESTRICT block, const unsigned *BMRESTRICT idx, unsigned start, unsigned stop)
 set bits in a bit-block using global index More...
 
bool block_ptr_array_range (bm::word_t **arr, unsigned &left, unsigned &right)
 array range detector More...
 
unsigned lower_bound_linear_u32 (const unsigned *arr, unsigned target, unsigned from, unsigned to)
 Linear lower bound search in unsigned array. More...
 
unsigned lower_bound_linear_u64 (const unsigned long long *arr, unsigned long long target, unsigned from, unsigned to)
 Linear lower bound search in unsigned LONG array. More...
 
unsigned lower_bound_u32 (const unsigned *arr, unsigned target, unsigned from, unsigned to)
 Hybrid, binary-linear lower bound search in unsigned array. More...
 
unsigned lower_bound_u64 (const unsigned long long *arr, unsigned long long target, unsigned from, unsigned to)
 Hybrid, binary-linear lower bound search in unsigned LONG array. More...
 
bm::id_t block_to_global_index (unsigned i, unsigned j, unsigned block_idx)
 calculate bvector<> global bit-index from block-local coords More...
 
bm::id64_t ptrp_test (ptr_payload_t ptr, bm::gap_word_t v)
 
int simd_version ()
 return SIMD optimization used for building BitMagic More...
 
template<typename T >
void gap_convert_to_bitset (unsigned *dest, const T *buf, unsigned dest_len)
 GAP block to bitblock conversion. More...
 
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...
 
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...
 
unsigned sse2_and_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 AND blocks2 dst &= *src. More...
 
unsigned sse2_and_arr_unal (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end)
 AND array elements against another array (unaligned) dst &= *src. More...
 
unsigned sse2_and_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end)
 
bool sse2_or_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 OR array elements against another array dst |= *src. More...
 
bool sse2_or_arr_unal (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src, const __m128i *BMRESTRICT src_end)
 OR array elements against another array (unaligned) dst |= *src. More...
 
bool sse2_or_block_2way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2)
 OR 2 blocks anc copy result to the destination dst = *src1 | src2. More...
 
bool sse2_or_block_3way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2)
 OR array elements against another 2 arrays dst |= *src1 | src2. More...
 
bool sse2_or_block_5way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2, const __m128i *BMRESTRICT src3, const __m128i *BMRESTRICT src4)
 OR array elements against another 2 arrays dst |= *src1 | src2 | src3 | src4. More...
 
unsigned sse2_xor_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 XOR block against another dst ^= *src. More...
 
unsigned sse2_xor_block_2way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2)
 3 operand XOR dst = *src1 ^ src2 More...
 
unsigned sse2_sub_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 AND-NOT (SUB) array elements against another array dst &= ~*src. More...
 
BMFORCEINLINE void sse2_set_block (__m128i *BMRESTRICT dst, bm::word_t value)
 SSE2 block memset dst = value. More...
 
BMFORCEINLINE void sse2_copy_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 SSE2 block copy dst = *src. More...
 
BMFORCEINLINE void sse2_stream_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 SSE2 block copy dst = *src. More...
 
void sse2_invert_block (__m128i *dst)
 Invert bit block 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)
 check if block is all zero bits More...
 
bool sse4_is_digest_zero (const __m128i *BMRESTRICT block)
 check if digest stride is all zero bits More...
 
void sse4_block_set_digest (__m128i *dst, unsigned value)
 set digest stride to 0xFF.. or 0x0 value More...
 
unsigned sse4_and_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 AND blocks2 dst &= *src. More...
 
bool sse4_and_digest (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 AND block digest stride dst &= *src. More...
 
bool sse4_and_digest_2way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2)
 AND block digest stride dst = *src1 & src2. More...
 
bool sse4_and_digest_5way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2, const __m128i *BMRESTRICT src3, const __m128i *BMRESTRICT src4)
 AND block digest stride. More...
 
bool sse4_sub_digest (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 SUB (AND NOT) block digest stride dst &= ~*src. More...
 
bool sse4_sub_digest_2way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2)
 2-operand SUB (AND NOT) block digest stride dst = src1 & ~*src2 More...
 
bool sse4_is_all_one (const __m128i *BMRESTRICT block)
 check if block is all zero bits More...
 
BMFORCEINLINE bool sse42_test_all_zero_wave (const void *ptr)
 check if wave of pointers is all NULL More...
 
BMFORCEINLINE bool sse42_test_all_zero_wave2 (const void *ptr0, const void *ptr1)
 check if 2 waves of pointers are all NULL More...
 
BMFORCEINLINE bool sse42_test_all_eq_wave2 (const void *ptr0, const void *ptr1)
 check if wave of 2 pointers are the same (null or FULL) More...
 
unsigned sse42_bit_block_calc_change (const __m128i *BMRESTRICT block)
 
void sse42_bit_block_calc_change_bc (const __m128i *BMRESTRICT block, unsigned *gc, unsigned *bc)
 
unsigned sse4_gap_find (const bm::gap_word_t *BMRESTRICT pbuf, const bm::gap_word_t pos, const unsigned size)
 
int sse42_cmpge_u32 (__m128i vect4, unsigned value)
 Experimental (test) function to do SIMD vector search (lower bound) in sorted, growing array. More...
 
unsigned sse4_lower_bound_scan_u32 (const unsigned *BMRESTRICT arr, unsigned target, unsigned from, unsigned to)
 lower bound (great or equal) linear scan in ascending order sorted array More...
 
unsigned sse42_idx_arr_block_lookup (const unsigned *idx, unsigned size, unsigned nb, unsigned start)
 
void sse42_set_block_bits (bm::word_t *BMRESTRICT block, const unsigned *BMRESTRICT idx, unsigned start, unsigned stop)
 
void sse4_bit_block_gather_scatter (unsigned *BMRESTRICT arr, const unsigned *BMRESTRICT blk, const unsigned *BMRESTRICT idx, unsigned size, unsigned start, unsigned bit_idx)
 
bool sse42_shift_l1 (__m128i *block, unsigned *empty_acc, unsigned co1)
 block shift left by 1 More...
 
bool sse42_shift_r1 (__m128i *block, unsigned *empty_acc, unsigned co1)
 block shift right by 1 More...
 
bool sse42_shift_r1_and (__m128i *block, bm::word_t co1, const __m128i *BMRESTRICT mask_block, bm::id64_t *digest)
 block shift right by 1 plus AND More...
 
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, unsigned 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)
 
bm::distance_metric_descriptor::size_type combine_any_operation_with_block (const bm::word_t *blk, unsigned gap, const bm::word_t *arg_blk, unsigned 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 >
BV::size_type 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 >
BV::size_type count_and (const BV &bv1, const BV &bv2)
 Computes bitcount of AND operation of two bitsets. More...
 
template<class BV >
BV::size_type 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::distance_metric_descriptor::size_type count_xor (const BV &bv1, const BV &bv2)
 Computes bitcount of XOR operation of two bitsets. More...
 
template<class BV >
BV::size_type any_xor (const BV &bv1, const BV &bv2)
 Computes if there is any bit in XOR operation of two bitsets. More...
 
template<class BV >
BV::size_type count_sub (const BV &bv1, const BV &bv2)
 Computes bitcount of SUB operation of two bitsets. More...
 
template<class BV >
BV::size_type any_sub (const BV &bv1, const BV &bv2)
 Computes if there is any bit in SUB operation of two bitsets. More...
 
template<class BV >
BV::size_type count_or (const BV &bv1, const BV &bv2)
 Computes bitcount of OR operation of two bitsets. More...
 
template<class BV >
BV::size_type any_or (const BV &bv1, const BV &bv2)
 Computes if there is any bit in OR operation of two bitsets. More...
 
template<typename It , typename SIZE_TYPE >
It block_range_scan (It first, It last, SIZE_TYPE nblock, SIZE_TYPE *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 >
BV::size_type count_intervals (const BV &bv)
 Compute number of bit intervals (GAPs) in the bitvector. More...
 
template<typename 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<typename Func , typename SIZE_TYPE >
void for_each_bit_blk (const bm::word_t *block, SIZE_TYPE offset, Func &bit_functor)
 for-each visitor, calls a special visitor functor for each 1 bit group More...
 
template<typename T , typename Func , typename SIZE_TYPE >
void for_each_gap_blk (const T *buf, SIZE_TYPE offset, Func &bit_functor)
 for-each visitor, calls a special visitor functor for each 1 bit range More...
 
template<class SIMBATCH , class SV >
void build_jaccard_similarity_batch (SIMBATCH &sbatch, const SV &sv)
 Utility function to build jaccard similarity batch for sparse_vector<> 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<typename TM >
unsigned find_effective_columns (const TM &tmatrix)
 Compute t-matrix rows statistics used for compression. More...
 
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)
 
unsigned count_leading_zeros (unsigned x)
 Portable LZCNT with (uses minimal LUT) More...
 
unsigned count_trailing_zeros (unsigned v)
 Portable TZCNT with (uses 37-LUT) More...
 
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<typename T >
bit_scan_fwd (T v)
 
unsigned bit_scan_reverse32 (unsigned value)
 
unsigned bit_scan_forward32 (unsigned value)
 
BMFORCEINLINE unsigned long long bmi_bslr_u64 (unsigned long long w)
 
BMFORCEINLINE unsigned long long bmi_blsi_u64 (unsigned long long w)
 
unsigned count_leading_zeros_u64 (bm::id64_t w)
 64-bit bit-scan reverse More...
 
unsigned count_trailing_zeros_u64 (bm::id64_t w)
 64-bit bit-scan fwd More...
 
template<typename Agg , typename It >
void aggregator_pipeline_execute (It first, It last)
 Experimental method ro run multiple aggregators in sync. More...
 
template<class BV >
size_t 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 >
size_t serialize (BV &bv, unsigned char *buf, unsigned serialization_flags=0)
 Saves bitvector into memory. Allocates temporary memory block for bvector. More...
 
template<class BV >
size_t deserialize (BV &bv, const unsigned char *buf, bm::word_t *temp_block=0)
 Bitvector deserialization from memory. More...
 
void * aligned_new_malloc (size_t size)
 Aligned malloc (unlike classic malloc it throws bad_alloc exception) More...
 
void aligned_free (void *ptr)
 Aligned free. More...
 
template<typename SV >
void dynamic_range_clip_high (SV &svect, unsigned high_bit)
 Clip dynamic range for signal higher than specified. More...
 
template<typename 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 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 sparse vector. More...
 

Variables

const unsigned short set_bitscan_wave_size = 2
 
const unsigned id_max32 = 0xFFFFFFFFu
 
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_alloc_size = bm::set_block_size * unsigned(sizeof(bm::word_t))
 
const unsigned set_block_plain_size = bm::set_block_size / 32u
 
const unsigned set_block_plain_cnt = (unsigned)(sizeof(bm::word_t) * 8u)
 
const unsigned set_block_digest_wave_size = bm::set_block_size / 64
 
const unsigned set_block_digest_pos_shift = 10
 
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_max_bits_cmrz = bm::gap_max_bits / 2
 
const unsigned gap_levels = 4
 
const unsigned gap_max_level = bm::gap_levels - 1
 
const unsigned bie_cut_off = 16384
 
const unsigned set_array_size32 = 256u
 
const unsigned set_sub_array_size = set_array_size32
 
const unsigned set_array_shift = 8u
 
const unsigned set_array_mask = 0xFFu
 
const unsigned set_total_blocks32 = (bm::set_array_size32 * bm::set_array_size32)
 
const unsigned id_max = bm::id_max32
 
const unsigned set_top_array_size = bm::set_array_size32
 
const unsigned set_total_blocks = bm::set_total_blocks32
 
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_size32
 
const unsigned rs3_border0 = 21824
 
const unsigned rs3_border1 = (rs3_border0 * 2)
 
const unsigned rs3_half_span = rs3_border0 / 2
 
const unsigned sub_block3_size = bm::gap_max_bits / 4
 
const id64_t all_bits_mask = 0xffffffffffffffffULL
 
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 set_compression_max = 5
 Maximum supported compression level. More...
 
const unsigned set_compression_default = 5
 Default compression level. 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...
 
const unsigned char set_block_64zero = 25
 lots of zero blocks More...
 
const unsigned char set_block_64one = 26
 lots of all-set blocks More...
 
const unsigned char set_block_gap_bienc = 27
 Interpolated GAP block. More...
 
const unsigned char set_block_arrgap_bienc = 28
 Interpolated GAP array. More...
 
const unsigned char set_block_arrgap_bienc_inv = 29
 Interpolated GAP array (inverted) More...
 
const unsigned char set_block_arrbit_inv = 30
 List of bits OFF. More...
 
const unsigned char set_block_arr_bienc = 31
 Interpolated block as int array. More...
 
const unsigned char set_block_arr_bienc_inv = 32
 Interpolated inverted block int array. More...
 
const unsigned char set_block_bitgap_bienc = 33
 Interpolated bit-block as GAPs. More...
 
const unsigned char set_block_bit_digest0 = 34
 H-compression with digest mask. 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)

Definition at line 7461 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 7455 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 7451 of file bmfunc.h.

◆ gap_word_t

typedef unsigned short bm::gap_word_t

Definition at line 76 of file bmconst.h.

◆ id64_t

typedef unsigned long long int bm::id64_t

Definition at line 34 of file bmconst.h.

◆ id_t

typedef unsigned int bm::id_t
Examples:
svsample06.cpp.

Definition at line 37 of file bmconst.h.

◆ short_t

typedef unsigned short bm::short_t

Definition at line 39 of file bmconst.h.

◆ word_t

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

Definition at line 38 of file bmconst.h.

◆ wordop_t

Definition at line 126 of file bmconst.h.

Enumeration Type Documentation

◆ ByteOrder

Byte orders recognized by the library.

Enumerator
BigEndian 
LittleEndian 

Definition at line 427 of file bmconst.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

BM_HM_64_BIT 

64-bit vector

Definition at line 675 of file bmserial.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 200 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

simd_avx512 

!< Intel AVX2

Definition at line 413 of file bmconst.h.

Function Documentation

◆ aligned_free()

void bm::aligned_free ( void *  ptr)
inline

◆ aligned_new_malloc()

void* bm::aligned_new_malloc ( size_t  size)
inline

Aligned malloc (unlike classic malloc it throws bad_alloc exception)

To allocate temp bit-block use: bm::aligned_new_malloc(bm::set_block_alloc_size);

Definition at line 401 of file bmalloc.h.

References BM_ALLOC_ALIGN.

Referenced by bm::aggregator< bvector_type >::aggregator(), bm::bvps_addr_resolver< bvector_type >::construct_rs_index(), and bm::rsc_sparse_vector< Val, SV >::decode().

◆ and_op()

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

◆ bit_block_change32()

unsigned bm::bit_block_change32 ( const bm::word_t block)
inline

Function calculates number of times when bit value changed

Definition at line 4151 of file bmfunc.h.

References BM_INCWORD_BITCOUNT, and set_block_size.

Referenced by bit_block_calc_change(), and bit_block_change_bc32().

◆ bit_block_change_bc32()

void bm::bit_block_change_bc32 ( const bm::word_t block,
unsigned *  gc,
unsigned *  bc 
)
inline

Function calculates basic bit-block statistics number of times when bit value changed (GAPS) and population count

Parameters
block- bit-block pointer
gc- [output] gap_count
bc- [output] bit count

Definition at line 4198 of file bmfunc.h.

References bit_block_change32(), bit_block_count(), BM_ASSERT, and VECT_BLOCK_CHANGE_BC.

Referenced by bm::serializer< bvector_type >::find_bit_best_encoding(), and bm::serializer< bvector_type >::find_bit_best_encoding_l5().

◆ 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 443 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 463 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_forward32()

unsigned bm::bit_scan_forward32 ( unsigned  value)
inline

◆ bit_scan_fwd()

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

Definition at line 283 of file bmutil.h.

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

◆ bit_scan_reverse32()

unsigned bm::bit_scan_reverse32 ( unsigned  value)
inline

◆ bit_to_gap()

unsigned bm::bit_to_gap ( gap_word_t *BMRESTRICT  dest,
const unsigned *BMRESTRICT  block,
unsigned  dest_len 
)
inline

◆ 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_find_rank()

template<typename SIZE_TYPE >
SIZE_TYPE bm::block_find_rank ( const bm::word_t *const  block,
SIZE_TYPE  rank,
unsigned  nbit_from,
unsigned &  nbit_pos 
)

Find rank in block (GAP or BIT)

Parameters
block- bit block buffer pointer
rank- rank to find (must be > 0)
nbit_from- start bit position in block
nbit_pos- found position
Returns
0 if position with rank was found, or the remaining rank (rank - population count)

Definition at line 6971 of file bmfunc.h.

References bit_find_rank(), BM_IS_GAP, BMGAP_PTR, and gap_find_rank().

Referenced by bm::bvector<>::find_rank(), and bm::bvector<>::select().

◆ block_ptr_array_range()

bool bm::block_ptr_array_range ( bm::word_t **  arr,
unsigned &  left,
unsigned &  right 
)
inline

array range detector

Definition at line 7759 of file bmfunc.h.

References BM_ASSERT, and set_sub_array_size.

◆ block_range_scan()

template<typename It , typename SIZE_TYPE >
It bm::block_range_scan ( It  first,
It  last,
SIZE_TYPE  nblock,
SIZE_TYPE *  max_id 
)

Internal algorithms scans the input for the block range limit.

Definition at line 1116 of file bmalgo_impl.h.

References BM_ASSERT, id_max, and set_block_shift.

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

◆ block_to_global_index()

bm::id_t bm::block_to_global_index ( unsigned  i,
unsigned  j,
unsigned  block_idx 
)
inline

calculate bvector<> global bit-index from block-local coords

Returns
bit index in linear bit-vector coordinates

Definition at line 7921 of file bmfunc.h.

References gap_max_bits, and set_sub_array_size.

Referenced by bm::aggregator< bvector_type >::find_first_and_sub(), and lower_bound_u64().

◆ 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 1744 of file bmfunc.h.

◆ bmi_blsi_u64()

BMFORCEINLINE unsigned long long bm::bmi_blsi_u64 ( unsigned long long  w)

◆ bmi_bslr_u64()

BMFORCEINLINE unsigned long long bm::bmi_bslr_u64 ( unsigned long long  w)

◆ build_jaccard_similarity_batch()

template<class SIMBATCH , class SV >
void bm::build_jaccard_similarity_batch ( SIMBATCH &  sbatch,
const SV &  sv 
)

Utility function to build jaccard similarity batch for sparse_vector<>

Definition at line 190 of file bmalgo_similarity.h.

References COUNT_AND, COUNT_OR, and bm::distance_metric_descriptor::metric.

◆ check_block_one()

bool bm::check_block_one ( const bm::word_t blk,
bool  deep_scan 
)
inline

Checks if block has only 1 bits.

Parameters
blk- Block's pointer
deep_scan- flag to do full bit block verification (scan) when deep scan is not requested result can be approximate
Returns
true if block consists of 1 bits.

Definition at line 7091 of file bmfunc.h.

References BM_IS_GAP, BMGAP_PTR, gap_is_all_one(), is_bits_one(), and IS_FULL_BLOCK.

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

◆ check_block_zero()

bool bm::check_block_zero ( const bm::word_t blk,
bool  deep_scan 
)
inline

Checks all conditions and returns true if block consists of only 0 bits.

Parameters
blk- Blocks's pointer
deep_scan- flag to do full bit block verification (scan) when deep scan is not requested result can be approximate
Returns
true if all bits are in the block are 0

Definition at line 7067 of file bmfunc.h.

References bit_is_all_zero(), BM_IS_GAP, BMGAP_PTR, gap_is_all_zero(), and IS_FULL_BLOCK.

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

◆ 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,
unsigned  arg_gap,
distance_metric_descriptor dmit,
distance_metric_descriptor dmit_end 
)
inline

◆ combine_any_operation_with_block() [2/2]

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

Convenience internal function to compute combine any for one metric

Definition at line 648 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 342 of file bmalgo_impl.h.

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

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 629 of file bmalgo_impl.h.

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

◆ count_leading_zeros_u64()

unsigned bm::count_leading_zeros_u64 ( bm::id64_t  w)
inline

64-bit bit-scan reverse

Definition at line 342 of file bmutil.h.

References bit_scan_reverse32(), and BM_ASSERT.

Referenced by gap_and_to_bitset(), and gap_sub_to_bitset().

◆ count_trailing_zeros_u64()

unsigned bm::count_trailing_zeros_u64 ( bm::id64_t  w)
inline

64-bit bit-scan fwd

Definition at line 370 of file bmutil.h.

References bit_scan_forward32(), and BM_ASSERT.

Referenced by gap_and_to_bitset(), and gap_sub_to_bitset().

◆ 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 2078 of file bmfunc.h.

◆ 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 669 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 t-matrix rows statistics used for compression.

Parameters
tmatrix- transposed matrix
pc_vector- row content vector
rstat- output row vector
effective_cols- effective columns Compute effective right column border of the t-matrix

Definition at line 714 of file bmtrans.h.

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

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

◆ find_not_null_ptr()

template<typename N >
bool bm::find_not_null_ptr ( bm::word_t ***  arr,
start,
size,
N *  pos 
)

Fini not NULL position

Returns
index of not NULL pointer

Definition at line 916 of file bmfunc.h.

References BM_ASSERT.

Referenced by bm::bvector<>::calc_stat(), bm::bvector<>::count(), and bm::bvector<>::erase().

◆ for_each_block()

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

For each block executes supplied function.

Definition at line 1709 of file bmfunc.h.

References FULL_BLOCK_FAKE_ADDR, and set_sub_array_size.

Referenced by count_intervals().

◆ 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 2012 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 1444 of file bmfunc.h.

References FULL_BLOCK_FAKE_ADDR, set_sub_array_size, and sse42_test_all_zero_wave().

Referenced by bm::bvector<>::count_blocks(), 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 1553 of file bmfunc.h.

References FULL_BLOCK_FAKE_ADDR, and set_sub_array_size.

◆ for_each_nzblock_if()

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

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

Definition at line 1675 of file bmfunc.h.

References FULL_BLOCK_FAKE_ADDR, and set_sub_array_size.

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

◆ for_each_nzblock_range()

template<typename T , typename N , typename F >
void bm::for_each_nzblock_range ( T ***  root,
top_size,
nb_from,
nb_to,
F &  f 
)

For each non-zero block in [from, to] executes supplied functor

Definition at line 1381 of file bmfunc.h.

References BM_ASSERT, FULL_BLOCK_FAKE_ADDR, gap_max_bits, set_array_mask, set_array_shift, and set_sub_array_size.

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

◆ gap_2_bitblock()

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

◆ 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 2053 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 2185 of file bmfunc.h.

References gap_max_bits.

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

◆ gap_convert_to_bitset()

template<typename T >
void bm::gap_convert_to_bitset ( unsigned *  dest,
const T *  buf,
unsigned  dest_len 
)

GAP block to bitblock conversion.

Parameters
dest- bitblock buffer pointer.
buf- GAP buffer pointer.
dest_len- length/size of the destination buffer.

Definition at line 47 of file bmvmin.h.

References gap_add_to_bitset().

◆ get_block_coord()

template<typename BI_TYPE >
void bm::get_block_coord ( BI_TYPE  nb,
unsigned &  i,
unsigned &  j 
)

◆ idx_arr_block_lookup_u32()

unsigned bm::idx_arr_block_lookup_u32 ( const unsigned *  idx,
unsigned  size,
unsigned  nb,
unsigned  start 
)
inline

block boundaries look ahead U32

Parameters
idx- array to look into
size- array size
nb- block number to look ahead
start- start offset in idx
Returns
block boundary offset end (no more match at the returned offset)

Definition at line 7668 of file bmfunc.h.

References BM_ASSERT, set_block_shift, and VECT_ARR_BLOCK_LOOKUP.

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

◆ idx_arr_block_lookup_u64()

bm::id64_t bm::idx_arr_block_lookup_u64 ( const bm::id64_t idx,
bm::id64_t  size,
bm::id64_t  nb,
bm::id64_t  start 
)
inline

block boundaries look ahead U32

Parameters
idx- array to look into
size- array size
nb- block number to look ahead
start- start offset in idx
Returns
block boundary offset end (no more match at the returned offset)

Definition at line 7643 of file bmfunc.h.

References BM_ASSERT, and set_block_shift.

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

◆ ilog2() [1/2]

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

Fast loop-less function to find LOG2.

Definition at line 112 of file bmutil.h.

◆ ilog2() [2/2]

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

Definition at line 125 of file bmutil.h.

◆ ilog2_LUT()

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

Lookup table based integer LOG2.

Definition at line 184 of file bmutil.h.

◆ ilog2_LUT< bm::gap_word_t >()

Lookup table based short integer LOG2.

Definition at line 203 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 810 of file bmfunc.h.

References set_COUNT.

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

◆ lower_bound_linear_u32()

unsigned bm::lower_bound_linear_u32 ( const unsigned *  arr,
unsigned  target,
unsigned  from,
unsigned  to 
)
inline

Linear lower bound search in unsigned array.

Definition at line 7793 of file bmfunc.h.

References BM_ASSERT, and VECT_LOWER_BOUND_SCAN_U32.

Referenced by lower_bound_u32().

◆ lower_bound_linear_u64()

unsigned bm::lower_bound_linear_u64 ( const unsigned long long *  arr,
unsigned long long  target,
unsigned  from,
unsigned  to 
)
inline

Linear lower bound search in unsigned LONG array.

Definition at line 7816 of file bmfunc.h.

References BM_ASSERT.

Referenced by lower_bound_u64().

◆ lower_bound_u32()

unsigned bm::lower_bound_u32 ( const unsigned *  arr,
unsigned  target,
unsigned  from,
unsigned  to 
)
inline

Hybrid, binary-linear lower bound search in unsigned array.

Definition at line 7840 of file bmfunc.h.

References BM_ASSERT, and lower_bound_linear_u32().

◆ lower_bound_u64()

unsigned bm::lower_bound_u64 ( const unsigned long long *  arr,
unsigned long long  target,
unsigned  from,
unsigned  to 
)
inline

Hybrid, binary-linear lower bound search in unsigned LONG array.

Definition at line 7875 of file bmfunc.h.

References block_to_global_index(), BM_ASSERT, gap_max_bits, lower_bound_linear_u64(), and set_sub_array_size.

◆ min_value()

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

Get minimum of 2 values.

Definition at line 102 of file bmutil.h.

Referenced by distance_and_operation().

◆ op_and()

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

Definition at line 126 of file bmsse4.h.

◆ op_or()

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

Definition at line 117 of file bmsse4.h.

References BMFORCEINLINE.

◆ op_xor()

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

Definition at line 107 of file bmsse4.h.

References BMFORCEINLINE.

◆ operator &()

template<class Alloc >
bvector<Alloc> bm::operator& ( const bvector< Alloc > &  bv1,
const bvector< Alloc > &  bv2 
)
inline

Definition at line 2382 of file bm.h.

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

◆ operator-()

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

Definition at line 2415 of file bm.h.

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

◆ operator^()

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

Definition at line 2404 of file bm.h.

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

◆ operator|()

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

Definition at line 2393 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 4850 of file bmfunc.h.

Referenced by gap_count_or().

◆ parallel_popcnt_32()

int bm::parallel_popcnt_32 ( unsigned int  n)
inline

Definition at line 233 of file bmfunc.h.

References BMFORCEINLINE.

◆ ptrp_test()

bm::id64_t bm::ptrp_test ( ptr_payload_t  ptr,
bm::gap_word_t  v 
)
inline

Test presense of value in payload pointer

Definition at line 7949 of file bmfunc.h.

References bm::ptr_payload_t::i16.

◆ set_block_bits_u32()

void bm::set_block_bits_u32 ( bm::word_t *BMRESTRICT  block,
const unsigned *BMRESTRICT  idx,
unsigned  start,
unsigned  stop 
)
inline

set bits in a bit-block using global index

Parameters
idx- array to look into
block- block pointer to set bits
start- index array start
stop- index array stop in a range [start..stop)
Returns
block boundary offset end (no more match at the returned offset)

Definition at line 7731 of file bmfunc.h.

References set_block_mask, set_word_mask, set_word_shift, and VECT_SET_BLOCK_BITS.

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

◆ set_block_bits_u64()

void bm::set_block_bits_u64 ( bm::word_t *BMRESTRICT  block,
const bm::id64_t *BMRESTRICT  idx,
bm::id64_t  start,
bm::id64_t  stop 
)
inline

set bits in a bit-block using global index

Parameters
idx- array to look into
block- block pointer to set bits
start- index array start
stop- index array stop in a range [start..stop)
Returns
block boundary offset end (no more match at the returned offset)

Definition at line 7700 of file bmfunc.h.

References set_block_mask, set_word_mask, and set_word_shift.

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

◆ setop2op()

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

Convert set operation to operation.

Definition at line 819 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 858 of file bmsse_util.h.

References BMFORCEINLINE.

◆ sse2_and_block()

unsigned bm::sse2_and_block ( __m128i *BMRESTRICT  dst,
const __m128i *BMRESTRICT  src,
const __m128i *BMRESTRICT  src_end 
)
inline

Definition at line 228 of file bmsse_util.h.

References BM_ALIGN16, and BM_ALIGN16ATTR.

◆ 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 187 of file bmsse2.h.

References BM_ALIGN16, BM_ALIGN16ATTR, BM_INCWORD_BITCOUNT, and BMRESTRICT.

◆ 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 123 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 345 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 894 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 864 of file bmsse_util.h.

References BMFORCEINLINE.

◆ sse2_sub()

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

Definition at line 877 of file bmsse_util.h.

◆ sse2_xor()

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

Definition at line 871 of file bmsse_util.h.

References BMFORCEINLINE.

◆ sse42_idx_arr_block_lookup()

unsigned bm::sse42_idx_arr_block_lookup ( const unsigned *  idx,
unsigned  size,
unsigned  nb,
unsigned  start 
)
inline

SSE4.2 index lookup to check what belongs to the same block (8 elements)

Definition at line 944 of file bmsse4.h.

References set_block_shift.

◆ sse42_set_block_bits()

void bm::sse42_set_block_bits ( bm::word_t *BMRESTRICT  block,
const unsigned *BMRESTRICT  idx,
unsigned  start,
unsigned  stop 
)
inline

SSE4.2 bulk bit set

Definition at line 981 of file bmsse4.h.

References BM_ALIGN16, BM_ALIGN16ATTR, set_block_mask, set_word_mask, and set_word_shift.

◆ sse4_bit_block_gather_scatter()

void bm::sse4_bit_block_gather_scatter ( unsigned *BMRESTRICT  arr,
const unsigned *BMRESTRICT  blk,
const unsigned *BMRESTRICT  idx,
unsigned  size,
unsigned  start,
unsigned  bit_idx 
)
inline

SSE4.2 bit block gather-scatter

Parameters
arr- destination array to set bits
blk- source bit-block
idx- gather index array
size- gather array size
start- gaher start index
bit_idx- bit to set in the target array

Definition at line 1065 of file bmsse4.h.

References BM_ALIGN16, BM_ALIGN16ATTR, set_block_mask, set_word_mask, and set_word_shift.

Referenced by bit_block_gather_scatter().

◆ 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 133 of file bmsse4.h.

◆ sub_op()

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

GAP or functor.

Definition at line 4856 of file bmfunc.h.

References BMFORCEINLINE.

Referenced by gap_count_sub().

◆ sum_arr()

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

Computes SUM of all elements of the sequence

Definition at line 1757 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 518 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 565 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 257 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 290 of file bmtrans.h.

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

◆ word_select64()

unsigned bm::word_select64 ( bm::id64_t  w,
unsigned  rank 
)
inline

word find index of the rank-th bit set by bit-testing

Parameters
w- 64-bit work to search
rank- rank to select (should be > 0)
Returns
selected value (inxed of bit set)

Definition at line 619 of file bmfunc.h.

References BMFORCEINLINE, and word_select64_bitscan().

Referenced by bit_find_rank().

◆ word_select64_bitscan()

unsigned bm::word_select64_bitscan ( bm::id64_t  w,
unsigned  rank 
)
inline

word find index of the rank-th bit set by bit-testing

Parameters
w- 64-bit work to search
rank- rank to select (should be > 0)
Returns
selected value (inxed of bit set)

Definition at line 592 of file bmfunc.h.

References BM_ASSERT, and word_bitcount64().

Referenced by word_select64().

◆ word_select64_linear()

unsigned bm::word_select64_linear ( bm::id64_t  w,
unsigned  rank 
)
inline

word find index of the rank-th bit set by bit-testing

Parameters
w- 64-bit work to search
rank- rank to select (should be > 0)
Returns
selected value (inxed of bit set)

Definition at line 569 of file bmfunc.h.

References BM_ASSERT.

◆ xor_op()

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

GAP xor functor.

Definition at line 4843 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 
)

Variable Documentation

◆ all_bits_mask

const id64_t bm::all_bits_mask = 0xffffffffffffffffULL

Definition at line 127 of file bmconst.h.

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

◆ bie_cut_off

const unsigned bm::bie_cut_off = 16384

◆ bits_in_array

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

◆ 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

◆ gap_levels

const unsigned bm::gap_levels = 4

◆ gap_max_bits

const unsigned bm::gap_max_bits = 65536

Definition at line 79 of file bmconst.h.

Referenced by bm::sparse_vector_scanner< SV >::bfind_eq_str(), bm::serializer< bvector_type >::bienc_arr_bit_block(), bm::serializer< bvector_type >::bienc_gap_bit_block(), bm::sparse_vector_scanner< SV >::bind(), bit_block_calc_count_range(), bit_operation_or_count(), bit_operation_sub_count(), bit_operation_xor_count(), block_to_global_index(), bm::bvector<>::combine_operation(), bm::bvector<>::copy_range(), bm::bvector<>::count(), bm::bvector<>::count_blocks(), bm::deserializer< typename SV::bvector_type, bm::decoder >::deserialize_gap(), bm::deserializer< typename SV::bvector_type, bm::decoder >::deserializer(), bm::serializer< bvector_type >::encode_bit_array(), bm::bvector<>::erase(), bm::bvector<>::find(), bm::serializer< bvector_type >::find_bit_best_encoding(), bm::serializer< bvector_type >::find_bit_best_encoding_l5(), bm::serializer< bvector_type >::find_gap_best_encoding(), bm::bvector<>::find_rank(), bm::bvector<>::find_reverse(), for_each_bit_blk(), for_each_nzblock_range(), bm::serializer< bvector_type >::gamma_arr_bit_block(), gap_add_value(), gap_bfind(), gap_block_find(), gap_buff_any_op(), gap_buff_count_op(), gap_buff_op(), gap_find_first(), gap_find_last(), gap_is_all_one(), gap_is_all_zero(), gap_set_array(), gap_set_value(), gap_shift_l1(), gap_shift_r1(), gap_test(), gap_test_unr(), bm::bvector< Alloc >::enumerator::go_to(), bm::bvector< Alloc >::enumerator::go_up(), bm::bvector<>::insert(), bm::serializer< bvector_type >::interpolated_arr_bit_block(), bm::serializer< bvector_type >::interpolated_gap_bit_block(), lower_bound_u64(), bm::deseriaizer_base< bm::decoder >::read_gap_block(), bm::random_subset< BV >::sample(), bm::bvector<>::select(), bm::serial_stream_iterator< DEC >::serial_stream_iterator(), bm::serializer< bvector_type >::serializer(), bm::bvector< Alloc >::enumerator::skip(), and bm::miniset< A, N >::swap().

◆ gap_max_bits_cmrz

const unsigned bm::gap_max_bits_cmrz = bm::gap_max_bits / 2

◆ gap_max_buff_len

const unsigned bm::gap_max_buff_len = 1280

◆ gap_max_level

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

Definition at line 84 of file bmconst.h.

◆ ibpc_all_one

const unsigned char bm::ibpc_all_one = 2

!< plain ALL ZERO

Definition at line 353 of file bmtrans.h.

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

◆ ibpc_all_zero

const unsigned char bm::ibpc_all_zero = 1

!< plain uncompressed

Definition at line 352 of file bmtrans.h.

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

◆ ibpc_close

const unsigned char bm::ibpc_close = 4

!< plain is equal to plain M

Definition at line 355 of file bmtrans.h.

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

◆ ibpc_end

const unsigned char bm::ibpc_end = 8

!< plain is close to plain M

Definition at line 357 of file bmtrans.h.

◆ ibpc_equiv

const unsigned char bm::ibpc_equiv = 3

!< plain ALL ONE

Definition at line 354 of file bmtrans.h.

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

◆ ibpc_uncompr

const unsigned char bm::ibpc_uncompr = 0

◆ id_max

const unsigned bm::id_max = bm::id_max32
Examples:
bvsample01_64.cpp.

Definition at line 107 of file bmconst.h.

Referenced by bm::sparse_vector< Val, BV >::const_iterator::advance(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::const_iterator::advance(), block_range_scan(), combine_or(), combine_sub(), combine_xor(), bm::sparse_vector< Val, BV >::const_iterator::const_iterator(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::const_iterator::const_iterator(), bm::bvector<>::copy_range(), bm::bvector<>::count_range(), bm::bvector<>::count_to(), bm::bvector<>::count_to_test(), bm::rsc_sparse_vector< Val, SV >::decode(), bm::operation_deserializer< BV >::deserialize(), bm::serializer< bvector_type >::encode_header(), bm::sparse_vector< unsigned, bm::bvector<> >::end(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::end(), bm::bvector<>::erase(), bm::bvector<>::extract_next(), bm::bvector<>::find(), bm::bvector<>::find_rank(), bm::sparse_vector_scanner< SV >::find_zero(), bm::sparse_vector< unsigned, bm::bvector<> >::get(), bm::bvector<>::get_next(), bm::sparse_vector< Val, BV >::const_iterator::go_to(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::const_iterator::go_to(), bm::bvector<>::insert(), bm::sparse_vector< Val, BV >::const_iterator::invalidate(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::const_iterator::invalidate(), bm::bvector< Alloc >::iterator_base::invalidate(), bm::sparse_vector_scanner< SV >::invert(), bm::bvector<>::invert(), main(), bm::bvector< Alloc >::insert_iterator::operator=(), bm::bvector< Alloc >::bulk_insert_iterator::operator=(), bm::bvector<>::operator[](), bm::sparse_vector< unsigned, bm::bvector<> >::push_back_null(), bm::aggregator< bvector_type >::reset(), bm::sparse_vector_scanner< SV >::reset_search_range(), bm::bvector<>::set_bit(), bm::bvector<>::set_bit_conditional(), bm::bvector<>::set_bit_no_check(), bm::bvector<>::set_range(), bm::sparse_vector< Val, BV >::const_iterator::skip_zero_values(), bm::sparse_vector_scanner< SV >::sparse_vector_scanner(), sse42_shift_r1_and(), bm::bvector<>::sync_size(), bm::sparse_vector< Val, BV >::const_iterator::valid(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::const_iterator::valid(), bm::bvector< Alloc >::iterator_base::valid(), and bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::const_iterator::value().

◆ id_max32

const unsigned bm::id_max32 = 0xFFFFFFFFu

Definition at line 49 of file bmconst.h.

◆ rs3_border0

const unsigned bm::rs3_border0 = 21824

Definition at line 117 of file bmconst.h.

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

◆ rs3_border1

const unsigned bm::rs3_border1 = (rs3_border0 * 2)

Definition at line 118 of file bmconst.h.

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

◆ rs3_half_span

const unsigned bm::rs3_half_span = rs3_border0 / 2

Definition at line 119 of file bmconst.h.

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

◆ set_array_mask

const unsigned bm::set_array_mask = 0xFFu

◆ set_array_shift

const unsigned bm::set_array_shift = 8u

◆ set_array_size32

const unsigned bm::set_array_size32 = 256u

Definition at line 92 of file bmconst.h.

◆ 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 57 of file bmconst.h.

◆ set_block_16one

const unsigned char bm::set_block_16one = 6

◆ set_block_16zero

const unsigned char bm::set_block_16zero = 5

◆ set_block_1one

const unsigned char bm::set_block_1one = 2

◆ set_block_1zero

const unsigned char bm::set_block_1zero = 1

◆ set_block_32one

const unsigned char bm::set_block_32one = 8

◆ set_block_32zero

const unsigned char bm::set_block_32zero = 7

◆ set_block_64one

const unsigned char bm::set_block_64one = 26

lots of all-set blocks

Definition at line 715 of file bmserial.h.

Referenced by bm::deserializer< typename SV::bvector_type, bm::decoder >::deserialize().

◆ set_block_64zero

const unsigned char bm::set_block_64zero = 25

lots of zero blocks

Definition at line 714 of file bmserial.h.

Referenced by bm::deserializer< typename SV::bvector_type, bm::decoder >::deserialize().

◆ set_block_8one

const unsigned char bm::set_block_8one = 4

◆ set_block_8zero

const unsigned char bm::set_block_8zero = 3

◆ set_block_alloc_size

const unsigned bm::set_block_alloc_size = bm::set_block_size * unsigned(sizeof(bm::word_t))

Definition at line 60 of file bmconst.h.

◆ set_block_aone

const unsigned char bm::set_block_aone = 10

◆ set_block_arr_bienc

const unsigned char bm::set_block_arr_bienc = 31

◆ set_block_arr_bienc_inv

const unsigned char bm::set_block_arr_bienc_inv = 32

◆ set_block_arrbit

const unsigned char bm::set_block_arrbit = 16

◆ set_block_arrbit_inv

const unsigned char bm::set_block_arrbit_inv = 30

◆ set_block_arrgap

const unsigned char bm::set_block_arrgap = 18

◆ set_block_arrgap_bienc

const unsigned char bm::set_block_arrgap_bienc = 28

◆ set_block_arrgap_bienc_inv

const unsigned char bm::set_block_arrgap_bienc_inv = 29

◆ 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

◆ 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_digest0

const unsigned char bm::set_block_bit_digest0 = 34

◆ set_block_bit_interval

const unsigned char bm::set_block_bit_interval = 17

◆ set_block_bitgap_bienc

const unsigned char bm::set_block_bitgap_bienc = 33

◆ set_block_digest_pos_shift

const unsigned bm::set_block_digest_pos_shift = 10

Definition at line 66 of file bmconst.h.

Referenced by digest_mask(), gap_and_to_bitset(), and gap_sub_to_bitset().

◆ set_block_digest_wave_size

const unsigned bm::set_block_digest_wave_size = bm::set_block_size / 64

◆ set_block_end

const unsigned char bm::set_block_end = 0

◆ set_block_gap

const unsigned char bm::set_block_gap = 14

◆ set_block_gap_bienc

const unsigned char bm::set_block_gap_bienc = 27

◆ 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 63 of file bmconst.h.

Referenced by bit_iblock_reduce().

◆ set_block_plain_size

const unsigned bm::set_block_plain_size = bm::set_block_size / 32u

Definition at line 62 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 701 of file bmserial.h.

◆ set_block_sgapgap

const unsigned char bm::set_block_sgapgap = 13

SGAP compressed GAP block.

Definition at line 702 of file bmserial.h.

◆ set_block_shift

const unsigned bm::set_block_shift = 16u

Definition at line 55 of file bmconst.h.

Referenced by bm::sparse_vector< Val, BV >::back_insert_iterator::back_insert_iterator(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::back_insert_iterator::back_insert_iterator(), bm::sparse_vector_scanner< SV >::bfind_eq_str(), bm::sparse_vector_scanner< SV >::bind(), block_range_scan(), bm::bvector<>::build_rs_index(), bm::bvector<>::combine_operation(), combine_or(), combine_sub(), combine_xor(), bm::sparse_vector_scanner< SV >::compare_str(), bm::bvector<>::copy_range(), bm::bvector<>::count_range(), bm::bvector<>::count_to(), bm::bvector<>::count_to_test(), bm::operation_deserializer< BV >::deserialize(), bm::bvector<>::erase(), bm::sparse_vector< unsigned, bm::bvector<> >::extract_range(), bm::aggregator< bvector_type >::find_first_and_sub(), bm::bvector<>::find_rank(), bm::sparse_vector< Val, BV >::back_insert_iterator::flush(), bm::str_sparse_vector< CharType, BV, MAX_STR_SIZE >::back_insert_iterator::flush(), bm::sparse_vector< unsigned, bm::bvector<> >::gather(), bm::bvector<>::get_bit(), bm::basic_bmatrix< bm::bvector<> >::get_half_octet(), bm::basic_bmatrix< bm::bvector<> >::get_octet(), bm::bvector< Alloc >::enumerator::go_to(), idx_arr_block_lookup_u32(), idx_arr_block_lookup_u64(), bm::bvector<>::import(), bm::bvector<>::import_block(), bm::bvector<>::inc(), bm::bvector<>::insert(), bm::aggregator< bvector_type >::process_bit_blocks_and(), bm::set2set_11_transform< SV >::remap(), bm::bvector<>::select(), bm::bvector<>::set_bit_no_check(), bm::sparse_vector< unsigned, bm::bvector<> >::set_value_no_null(), and sse42_idx_arr_block_lookup().

◆ set_block_size

const unsigned bm::set_block_size = 2048u

Definition at line 54 of file bmconst.h.

Referenced by bm::bv_statistics::add_bit_block(), bm::alloc_pool< BA, PA >::alloc_bit_block(), bm::mem_alloc< BA, PA, APool >::alloc_bit_block(), bm::serializer< bvector_type >::bienc_gap_bit_block(), bit_andnot_arr_ffmask(), bit_block_and(), bit_block_and_any(), bit_block_and_count(), bit_block_change32(), bit_block_copy(), bit_block_count(), bit_block_erase(), bit_block_find(), bit_block_insert(), bit_block_or(), bit_block_or_2way(), bit_block_or_3way(), bit_block_or_5way(), bit_block_or_any(), bit_block_or_count(), bit_block_rotate_left_1(), bit_block_rotate_left_1_unr(), bit_block_set(), bit_block_shift_l1(), bit_block_shift_r1(), bit_block_shift_r1_and(), bit_block_stream(), bit_block_sub(), bit_block_sub_any(), bit_block_sub_count(), bit_block_to_gap(), bit_block_xor(), bit_block_xor_2way(), bit_block_xor_any(), bit_block_xor_count(), bit_find_first(), bit_find_last(), bit_find_rank(), bit_invert(), bit_is_all_zero(), bit_operation_or(), bm::bvector< Alloc >::bulk_insert_iterator::buf_size_max(), bm::bvector<>::calc_stat(), combine_any_operation_with_block(), combine_count_operation_with_block(), bm::bvector<>::combine_operation(), bm::deserializer< typename SV::bvector_type, bm::decoder >::deserialize(), bm::serializer< bvector_type >::encode_bit_digest(), bm::serializer< bvector_type >::encode_bit_interval(), bm::bit_block_t::end(), bm::bvector<>::erase(), export_array(), bm::serializer< bvector_type >::find_bit_best_encoding(), bm::serializer< bvector_type >::find_bit_best_encoding_l5(), bm::bvector<>::find_rank(), for_each_bit_blk(), bm::alloc_pool< BA, PA >::free_bit_block(), bm::mem_alloc< BA, PA, APool >::free_bit_block(), bm::alloc_pool< BA, PA >::free_pools(), bm::serializer< bvector_type >::gamma_arr_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::bvector<>::import_block(), bm::bvector<>::insert(), bm::serializer< bvector_type >::interpolated_arr_bit_block(), is_bits_one(), bm::aggregator< bvector_type >::process_shift_right_and(), bm::random_subset< BV >::random_subset(), bm::deseriaizer_base< bm::decoder >::read_0runs_block(), bm::random_subset< BV >::sample(), bm::bvector<>::select(), bm::serializer< bvector_type >::serialize(), sse2_and_block(), sse2_copy_block(), sse2_invert_block(), sse2_or_block(), sse2_or_block_2way(), sse2_or_block_3way(), sse2_or_block_5way(), sse2_set_block(), sse2_stream_block(), sse2_sub_block(), sse2_xor_block(), sse2_xor_block_2way(), sse42_bit_block_calc_change(), sse42_bit_block_calc_change_bc(), sse42_shift_l1(), sse42_shift_r1(), sse4_and_block(), sse4_is_all_one(), and sse4_is_all_zero().

◆ set_block_size_op

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

Definition at line 128 of file bmconst.h.

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

◆ set_compression_default

const unsigned bm::set_compression_default = 5

Default compression level.

Definition at line 60 of file bmserial.h.

◆ set_compression_max

const unsigned bm::set_compression_max = 5

Maximum supported compression level.

Definition at line 59 of file bmserial.h.

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

◆ set_sub_array_size

const unsigned bm::set_sub_array_size = set_array_size32

Definition at line 93 of file bmconst.h.

Referenced by aggregator_pipeline_execute(), bm::all_set< T >::all_set_block::all_set_block(), bm::bvector<>::bit_and(), bm::bvector<>::bit_or(), bm::bvector<>::bit_sub(), bm::bvector<>::bit_xor(), block_ptr_array_range(), block_to_global_index(), bm::bvector<>::build_rs_index(), bm::bvector<>::calc_stat(), bm::aggregator< bvector_type >::combine_and(), bm::aggregator< bvector_type >::combine_and_sub(), bm::bvector<>::combine_operation(), bm::bvector<>::combine_operation_and(), bm::bvector<>::combine_operation_or(), bm::bvector<>::combine_operation_sub(), bm::bvector<>::combine_operation_xor(), bm::aggregator< bvector_type >::combine_or(), bm::aggregator< bvector_type >::combine_shift_right_and(), bm::bvector<>::compare(), bm::bvector<>::count(), bm::operation_deserializer< BV >::deserialize(), distance_and_operation(), distance_operation(), distance_operation_any(), bm::bvector<>::erase(), bm::bvector<>::find(), bm::aggregator< bvector_type >::find_effective_sub_block_size(), bm::aggregator< bvector_type >::find_first_and_sub(), bm::bvector<>::find_reverse(), for_each_bit(), for_each_block(), for_each_nzblock(), for_each_nzblock2(), for_each_nzblock_if(), for_each_nzblock_range(), bm::bvector< Alloc >::enumerator::go_first(), bm::bvector< Alloc >::enumerator::go_to(), bm::bvector<>::insert(), bm::bvector<>::invert(), lower_bound_u64(), bm::bvector<>::merge(), bm::bvector<>::optimize(), bm::aggregator< bvector_type >::run_step(), and bm::bvector<>::select().

◆ set_top_array_size

const unsigned bm::set_top_array_size = bm::set_array_size32

◆ set_total_blocks

const unsigned bm::set_total_blocks = bm::set_total_blocks32

◆ set_total_blocks32

const unsigned bm::set_total_blocks32 = (bm::set_array_size32 * bm::set_array_size32)

Definition at line 97 of file bmconst.h.

◆ set_word_mask

const unsigned bm::set_word_mask = 0x1Fu

◆ set_word_shift

const unsigned bm::set_word_shift = 5u

◆ sub_block3_size

const unsigned bm::sub_block3_size = bm::gap_max_bits / 4