<
typenameBVAlloc>
96 const unsigned* bcount,
165 const unsigned char _lut[65536] = {0, };
169 #if defined(BM64_SSE4) || defined(BM64_AVX2) || defined(BM64_AVX512) 172 const unsignedcutoff_bias = 0;
175 for(
unsignednbit_right = 0; nbit_right < 65536; ++nbit_right)
255 const_cast<unsigned char*
>(
_lut),
256nbit_right, (
unsigned char)sub);
273 template<
typenameBVAlloc>
282 template<
typenameBVAlloc>
285sblock_count_.resize(0);
286sblock_row_idx_.resize(0);
287block_matr_.resize(0, 0,
false);
288sub_block_matr_.resize(0, 0,
false);
290total_blocks_ = sblock_rows_ = max_sblock_ = 0;
295 template<
typenameBVAlloc>
301 BM_ASSERT(sblock_count == (new_size / 256) + 3);
302sblock_count_.resize(sblock_count);
303sblock_row_idx_.resize(sblock_count);
308 template<
typenameBVAlloc>
323 template<
typenameBVAlloc>
326 if(nb >= total_blocks_)
329 size_typesb_count = get_super_block_count(
i);
338 unsignedrow_idx = sblock_row_idx_[
i+1];
339 const unsigned*
row= block_matr_.row(row_idx);
342bc = (!j) ?
row[j] :
row[j] -
row[j-1];
348 template<
typenameBVAlloc>
354 returnsblock_count_[max_sblock_ + 1];
359 template<
typenameBVAlloc>
364 size_typesb_rcount =
i? get_super_block_rcount(
i-1) :
i;
366 unsignedsb_count = get_super_block_count(
i);
374sb_rcount += sb_count;
378 unsignedrow_idx = sblock_row_idx_[
i+1];
379 const unsigned*
row= block_matr_.row(row_idx);
380 unsignedbc =
row[j];
388 template<
typenameBVAlloc>
397 template<
typenameBVAlloc>
403 unsignedsub_cnt = unsigned(sub);
404 unsigned first= sub_cnt & 0xFFFF;
405 unsignedsecond = sub_cnt >> 16;
423 template<
typenameBVAlloc>
429 unsigned i= find_super_block(rank);
451 unsignedrow_idx = sblock_row_idx_[
i+1];
452 const unsigned*
row= block_matr_.row(row_idx);
463 template<
typenameBVAlloc>
466 if(nb >= total_blocks_)
470 size_typesb_count = get_super_block_count(
i);
480 return(aux0 << 32) | (aux1 << 48) | (second << 16) |
first;
483 unsignedrow_idx = sblock_row_idx_[
i+1];
484 const bm::id64_t* sub_row = sub_block_matr_.row(row_idx);
491 template<
typenameBVAlloc>
500 unsigned i= find_super_block(*rank);
501 if(
i> max_sblock_)
546 unsignedrow_idx = sblock_row_idx_[
i+1];
547 const unsigned*
row= block_matr_.row(row_idx);
555 const bm::id64_t* sub_row = sub_block_matr_.row(row_idx);
556 unsigned first= sub_row[j] & 0xFFFF;
557 unsignedsecond = (sub_row[j] >> 16) & 0xFFFF;
585 template<
typenameBVAlloc>
588 if(
i> max_sblock_)
590sblock_count_[
i+1] = sblock_count_[
i];
591sblock_row_idx_[
i+1] = 0
U;
596 template<
typenameBVAlloc>
604 template<
typenameBVAlloc>
607 if(
i> max_sblock_)
610sblock_count_[
i+1] = sblock_count_[
i] + bcount;
613sblock_row_idx_[
i+1] = 0;
617sblock_row_idx_[
i+1] = sblock_rows_;
624 template<
typenameBVAlloc>
627 if(
i> max_sblock_)
633 returnunsigned(
cnt);
638 template<
typenameBVAlloc>
642 if(
i> max_sblock_)
644 returnsblock_count_[
i+1];
649 template<
typenameBVAlloc>
665 template<
typenameBVAlloc>
672 returnmax_sblock_ + 1;
678 template<
typenameBVAlloc>
687 template<
typenameBVAlloc>
689 const unsigned* bcount,
695 if(
i> max_sblock_)
699sblock_row_idx_[
i+1] = sblock_rows_;
700 unsigned*
row= block_matr_.row(sblock_rows_);
701 bm::id64_t* sub_row = sub_block_matr_.row(sblock_rows_);
709sub_row[j] = sub_count_in[j];
714sblock_count_[
i+1] = sblock_count_[
i] + bc;
Rank-Select acceleration index.
sblock_count_vector_type sblock_count_
super-block accumulated counts
void init() BMNOEXCEPT
init arrays to zeros
bm::id64_t sub_count(block_idx_type nb) const BMNOEXCEPT
return sub-clock counts (64-bit for additional information)
size_type super_block_size() const BMNOEXCEPT
return number of super-blocks
unsigned get_super_block_count(unsigned i) const BMNOEXCEPT
return bit-count in super-block
bm::heap_vector< unsigned, bv_allocator_type, false > sblock_row_vector_type
bm::dynamic_heap_matrix< bm::id64_t, bv_allocator_type > blocks_matrix64_type
void set_super_block(unsigned i, size_type bcount) BMNOEXCEPT
set super block count
blocks_matrix_type block_matr_
blocks within super-blocks (matrix)
static unsigned find_sub_range(unsigned block_bit_pos) BMNOEXCEPT
determine the sub-range within a bit-block
size_type get_super_block_rcount(unsigned i) const BMNOEXCEPT
return running bit-count in super-block
bm::pair< bm::gap_word_t, bm::gap_word_t > sb_pair_type
bm::id_t sblock_count_type
size_type rcount(block_idx_type nb) const
return running bit-count for specified block
blocks_matrix64_type sub_block_matr_
sub-block counts
size_type count() const
return total bit-count for the index
void resize(block_idx_type new_size)
reserve the capacity for block count
unsigned find_super_block(size_type rank) const BMNOEXCEPT
Find super-block with specified rank.
void resize_effective_super_blocks(size_type sb_eff)
set size of true super-blocks (not NULL and not FFFFF)
bm::heap_vector< sblock_count_type, bv_allocator_type, false > sblock_count_vector_type
void set_full_super_block(unsigned i) BMNOEXCEPT
set FULL (all bits set super-block)
void copy_from(const rs_index &rsi)
copy rs index
bm::dynamic_heap_matrix< unsigned, bv_allocator_type > blocks_matrix_type
sblock_row_vector_type sblock_row_idx_
super-block row numbers
size_type total_blocks_
total bit-blocks in the index
bm::gap_word_t select_sub_range(block_idx_type nb, size_type &rank) const BMNOEXCEPT
determine block sub-range for rank search
size_type get_total() const
get total blocks
unsigned max_sblock_
max. superblock index
bool find(size_type *rank, block_idx_type *nb, bm::gap_word_t *sub_range) const
find block position and sub-range for the specified rank
void set_null_super_block(unsigned i) BMNOEXCEPT
set empty (no bits set super-block)
BVAlloc bv_allocator_type
void set_total(size_type t)
set total blocks
void register_super_block(unsigned i, const unsigned *bcount, const bm::id64_t *sub_count)
Add block list belonging to one super block.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
const unsigned set_array_mask
const unsigned set_block_mask
const unsigned set_sub_array_size
const unsigned rs3_half_span
void set_nibble(unsigned char *arr, unsigned idx, unsigned char v) noexcept
set nibble in the array
unsigned char get_nibble(const unsigned char *arr, unsigned idx) noexcept
get nibble from the array
unsigned long long int id64_t
const unsigned rs3_border0_1
const unsigned rs3_border1
unsigned lower_bound_u32(const unsigned *arr, unsigned target, unsigned from, unsigned to) noexcept
Hybrid, binary-linear lower bound search in unsigned array.
const unsigned set_array_shift
unsigned short gap_word_t
const unsigned rs3_border1_1
const unsigned rs3_border0
const unsigned gap_max_bits
unsigned lower_bound_u64(const unsigned long long *arr, unsigned long long target, unsigned from, unsigned to) noexcept
Hybrid, binary-linear lower bound search in unsigned LONG array.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
#define row(bind, expected)
const unsigned char _lut[65536]
Precalculated decision table fdr interval selection.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4