gatb.core-API-1.4.2
rank_vector Class Reference

#include <rank_vector.hpp>

Public Member Functions

 rank_vector ()
 
 ~rank_vector ()
 
void push_back (uint64_t bit)
 
uint64_t get_bit (uint64_t pos) const
 
uint64_t rank (uint64_t pos) const
 
uint64_t size () const
 
void swap (rank_vector &rv)
 

Detailed Description

Bit Vector supporing Rank operation

Constructor & Destructor Documentation

rank_vector ( )
inline

Constructor

~rank_vector ( )
inline

Destructor

Member Function Documentation

uint64_t get_bit ( uint64_t  pos) const
inline

Get the pos-th bit

Parameters
posthe index
Returns
the pos-th bit
void push_back ( uint64_t  bit)
inline

Add bit to the end of the vector

Parameters
bita bit to be added
uint64_t rank ( uint64_t  pos) const
inline

Calculate the number of ones in bits_[0...pos-1] in O(1) time.

Parameters
posthe position in the bit array
Returns
the number of ones in bits_[0...pos-1]
uint64_t size ( ) const
inline

Return the size of bit array in bits.

Returns
the number of bits
void swap ( rank_vector rv)
inline

Swap the content in bit vector

Parameters
rvthe rank_vector to be swapped

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