Sux
Public Member Functions | Protected Attributes | List of all members
sux::bits::Rank9< AT > Class Template Reference

#include <Rank9.hpp>

Inheritance diagram for sux::bits::Rank9< AT >:
sux::Rank sux::bits::Rank9Sel< AT >

Public Member Functions

 Rank9 (const uint64_t *const bits, const uint64_t num_bits)
 
uint64_t rank (const size_t k)
 
size_t bitCount () const
 
size_t size () const
 
- Public Member Functions inherited from sux::Rank
virtual ~Rank ()=default
 
virtual uint64_t rank (std::size_t pos)=0
 
uint64_t rank (std::size_t from, std::size_t to)
 
virtual uint64_t rankZero (std::size_t pos)
 
uint64_t rankZero (std::size_t from, std::size_t to)
 

Protected Attributes

const size_t num_bits
 
size_t num_ones
 
const uint64_t * bits
 
util::Vector< uint64_t, AT > counts
 

Detailed Description

template<util::AllocType AT = util::AllocType::MALLOC>
class sux::bits::Rank9< AT >

A class implementing Rank9, a ranking structure using 25% additional space and providing very fast ranking.

The constructors of this class only store a reference to a provided bit vector. Should the content of the bit vector change, the results will be unpredictable.

Warning: if you plan an calling rank(size_t) with argument size(), you must have at least one additional free bit at the end of the provided bit vector.

Template Parameters
ATa type of memory allocation out of sux::util::AllocType.

Constructor & Destructor Documentation

◆ Rank9()

template<util::AllocType AT = util::AllocType::MALLOC>
sux::bits::Rank9< AT >::Rank9 ( const uint64_t *const  bits,
const uint64_t  num_bits 
)
inline

Creates a new instance using a given bit vector.

Note that this constructor only stores a reference to the provided bit vector. Should the content of the bit vector change, the results will be unpredictable.

Warning: if you plan an calling rank(size_t) with argument size(), you must have at least one additional free bit at the end of the provided bit vector.

Parameters
bitsa bit vector of 64-bit words.
num_bitsthe length (in bits) of the bit vector.

Member Function Documentation

◆ bitCount()

template<util::AllocType AT = util::AllocType::MALLOC>
size_t sux::bits::Rank9< AT >::bitCount ( ) const
inline

Returns an estimate of the size in bits of this structure.

◆ rank()

template<util::AllocType AT = util::AllocType::MALLOC>
uint64_t sux::bits::Rank9< AT >::rank ( const size_t  k)
inline

◆ size()

template<util::AllocType AT = util::AllocType::MALLOC>
size_t sux::bits::Rank9< AT >::size ( ) const
inlinevirtual

Returns the size in bits of the underlying bit vector.

Implements sux::Rank.

Member Data Documentation

◆ bits

template<util::AllocType AT = util::AllocType::MALLOC>
const uint64_t* sux::bits::Rank9< AT >::bits
protected

◆ counts

template<util::AllocType AT = util::AllocType::MALLOC>
util::Vector<uint64_t, AT> sux::bits::Rank9< AT >::counts
protected

◆ num_bits

template<util::AllocType AT = util::AllocType::MALLOC>
const size_t sux::bits::Rank9< AT >::num_bits
protected

◆ num_ones

template<util::AllocType AT = util::AllocType::MALLOC>
size_t sux::bits::Rank9< AT >::num_ones
protected

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