pasta_bit_vector  1.0.1
Bit Vector with Compact and Fast Rank and Select Support
Loading...
Searching...
No Matches
pasta::WideRank< optimized_for, VectorType > Class Template Reference

Rank support for BitVector that can be used as an alternative to Rank for bit vectors up to length 2^40. More...

#include <wide_rank.hpp>

Public Member Functions

 WideRank ()=default
 Default constructor w/o parameter.
 
 WideRank (VectorType &bv)
 Constructor. Creates the auxiliary information for efficient rank queries.
 
size_t rank0 (size_t index) const
 Computes rank of zeros.
 
size_t rank1 (size_t index) const
 Computes rank of ones.
 
virtual size_t space_usage () const
 Estimate for the space usage.
 

Friends

template<OptimizedFor o, FindL2WideWith f, typename v >
class WideRankSelect
 Friend class, using internal information l12_.
 

Detailed Description

template<OptimizedFor optimized_for = OptimizedFor::DONT_CARE, typename VectorType = BitVector>
class pasta::WideRank< optimized_for, VectorType >

Rank support for BitVector that can be used as an alternative to Rank for bit vectors up to length 2^40.

The rank support is an extended and engineered version of the popcount rank support by Zhou et al. [2]. This flat rank support hoverer removes the highest utility array (L0) and also groups twice as many L2-blocks in a single L1-block. This allows us to store more information—most importantly the number of ones w.r.t. the beginning of the L1-block—in the L2-blocks. For the L1/2-block layout see BigL12Type.

Template Parameters
OptimizedForCompile time option to optimize data structure for either 0, 1, or no specific type of query.
VectorTypeType of the vector the rank data structure is constructed for, e.g., plain BitVector or a compressed bit vector.

Constructor & Destructor Documentation

◆ WideRank()

template<OptimizedFor optimized_for = OptimizedFor::DONT_CARE, typename VectorType = BitVector>
pasta::WideRank< optimized_for, VectorType >::WideRank ( VectorType & bv)
inline

Constructor. Creates the auxiliary information for efficient rank queries.

Parameters
bvVector of type VectorType the rank structure is created for.

Member Function Documentation

◆ rank0()

template<OptimizedFor optimized_for = OptimizedFor::DONT_CARE, typename VectorType = BitVector>
size_t pasta::WideRank< optimized_for, VectorType >::rank0 ( size_t index) const
inlinenodiscard

Computes rank of zeros.

Parameters
indexIndex the rank of zeros is computed for.
Returns
Number of zeros (rank) before position index.

◆ rank1()

template<OptimizedFor optimized_for = OptimizedFor::DONT_CARE, typename VectorType = BitVector>
size_t pasta::WideRank< optimized_for, VectorType >::rank1 ( size_t index) const
inlinenodiscard

Computes rank of ones.

Parameters
indexIndex the rank of ones is computed for.
Returns
Number of ones (rank) before position index.

◆ space_usage()

template<OptimizedFor optimized_for = OptimizedFor::DONT_CARE, typename VectorType = BitVector>
virtual size_t pasta::WideRank< optimized_for, VectorType >::space_usage ( ) const
inlinenodiscardvirtual

Estimate for the space usage.

Returns
Number of bytes used by this data structure.

Reimplemented in pasta::WideRankSelect< optimized_for, find_with, VectorType >.


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