BitMagic-C++
Public Types | Public Member Functions
bm::rank_compressor< BV > Class Template Reference

Algorithms for rank compression of bit-vector. More...

#include <bmalgo.h>

Public Types

enum  buffer_cap { n_buffer_cap = 1024 }
 
typedef BV bvector_type
 
typedef BV::size_type size_type
 
typedef BV::rs_index_type rs_index_type
 

Public Member Functions

void decompress (BV &bv_target, const BV &bv_idx, const BV &bv_src)
 Rank decompression. More...
 
void compress (BV &bv_target, const BV &bv_idx, const BV &bv_src)
 Rank compression algorithm based on two palallel iterators/enumerators set of source vector gets re-mapped in accord with the index/rank vector. More...
 
void compress_by_source (BV &bv_target, const BV &bv_idx, const rs_index_type &bc_idx, const BV &bv_src)
 Source vector priority + index based rank. More...
 

Detailed Description

template<typename BV>
class bm::rank_compressor< BV >

Algorithms for rank compression of bit-vector.

  1. Source vector (bv_src) is a subset of index vector (bv_idx)
  2. As a subset it can be collapsed using bit-rank method, where each position in the source vector is defined by population count (range) [0..index_position] (count_range()) As a result all integer set of source vector gets re-mapped in accord with the index vector.

Definition at line 452 of file bmalgo.h.

Member Enumeration Documentation

◆ buffer_cap

template<typename BV >
enum bm::rank_compressor::buffer_cap
Enumerator
n_buffer_cap 

Definition at line 458 of file bmalgo.h.

Member Function Documentation

◆ compress()

template<class BV >
void bm::rank_compressor< BV >::compress ( BV &  bv_target,
const BV &  bv_idx,
const BV &  bv_src 
)

Rank compression algorithm based on two palallel iterators/enumerators set of source vector gets re-mapped in accord with the index/rank vector.

Parameters
bv_target- target bit-vector
bv_idx- index (rank) vector used for address recalculation
bv_src- source vector for re-mapping

Definition at line 497 of file bmalgo.h.

References BM_ASSERT, and bm::BM_SORTED.

Referenced by bm::rsc_sparse_vector< Val, SV >::clear(), bm::rsc_sparse_vector< Val, SV >::load_from(), and bm::rsc_sparse_vector< Val, SV >::set_null().

◆ compress_by_source()

template<class BV >
void bm::rank_compressor< BV >::compress_by_source ( BV &  bv_target,
const BV &  bv_idx,
const rs_index_type bc_idx,
const BV &  bv_src 
)

Source vector priority + index based rank.

See also
compress

Rank compressor visitor (functor)

Definition at line 647 of file bmalgo.h.

References BM_ASSERT, and bm::for_each_bit().

◆ decompress()

template<class BV >
void bm::rank_compressor< BV >::decompress ( BV &  bv_target,
const BV &  bv_idx,
const BV &  bv_src 
)

Rank decompression.

Definition at line 570 of file bmalgo.h.

References BM_ASSERT, and bm::BM_SORTED.

Referenced by bm::rsc_sparse_vector< Val, SV >::load_to().


The documentation for this class was generated from the following file: