BitMagic-C++: bm::rank_compressor< BV > Class Template Reference

BitMagic-C++

Public Types | Public Member Functions
bm::rank_compressor< BV > Class Template Reference
BitMagic Library » bvector<> container » bvector<> algorithms

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

`#include <bmalgo.h>`

Inheritance diagram for bm::rank_compressor< BV >:
[legend]

## 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 407 of file bmalgo.h.

## Member Typedef Documentation

## ◆ bvector_type

template<typename BV >

typedef BV bm::rank_compressor< BV >::bvector_type

Definition at line 410 of file bmalgo.h.

## ◆ rs_index_type

template<typename BV >

typedef BV::rs_index_type bm::rank_compressor< BV >::rs_index_type

Definition at line 412 of file bmalgo.h.

## ◆ size_type

template<typename BV >

typedef BV::size_type bm::rank_compressor< BV >::size_type

Definition at line 411 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 413 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 452 of file bmalgo.h.

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

## ◆ 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 602 of file bmalgo.h.

## ◆ 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 525 of file bmalgo.h.

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

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

- bmalgo.h