SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
 All Classes Namespaces Files Functions Variables Typedefs Friends
Public Types | Public Member Functions
sdsl::rrr_rank_support< b, block_size, wt_type > Class Template Reference

rank_support for the rrr_vector class More...

#include <rrr_vector.hpp>

List of all members.

Public Types

typedef rrr_vector< block_size,
wt_type > 
bit_vector_type
typedef bit_vector_type::size_type size_type
typedef
bit_vector_type::rrr_helper_type 
rrr_helper_type
typedef
rrr_helper_type::number_type 
number_type

Public Member Functions

 rrr_rank_support (const bit_vector_type *v=NULL)
 Standard constructor.
void init (const bit_vector_type *v=NULL)
 Initialize the data structure with a rrr_vector, which should be supported.
const size_type rank (size_type i) const
 Answers rank queries.
const size_type operator() (size_type i) const
 Short hand for rank(i)
const size_type size () const
 Returns the size of the original vector.
void set_vector (const bit_vector_type *v=NULL)
 Set the supported vector.
rrr_rank_supportoperator= (const rrr_rank_support &rs)
void swap (rrr_rank_support &rs)
bool operator== (const rrr_rank_support &rs) const
bool operator!= (const rrr_rank_support &rs) const
void load (std::istream &in, const bit_vector_type *v=NULL)
 Load the data structure from a stream and set the supported vector.
size_type serialize (std::ostream &out, structure_tree_node *v=NULL, std::string name="") const
 Serializes the data structure into a stream.

Detailed Description

template<uint8_t b, uint16_t block_size, class wt_type>
class sdsl::rrr_rank_support< b, block_size, wt_type >

rank_support for the rrr_vector class

The first template parameter is the bit pattern of size one. The second one the block size and the third the array type that is used to store the block types. TODO: Test if the binary search can be speed up by saving the (n/2)-th rank value in T[0], the (n/4)-th in T[1], the (3n/4)-th in T[2],... for small number of rank values is this called hinted binary search??? or is this called


Constructor & Destructor Documentation

template<uint8_t b, uint16_t block_size, class wt_type >
sdsl::rrr_rank_support< b, block_size, wt_type >::rrr_rank_support ( const bit_vector_type v = NULL) [inline, explicit]

Standard constructor.

Parameters:
vPointer to the rrr_vector, which should be supported

Member Function Documentation

template<uint8_t b, uint16_t block_size, class wt_type >
const size_type sdsl::rrr_rank_support< b, block_size, wt_type >::rank ( size_type  i) const [inline]

Answers rank queries.

Parameters:
iArgument for the length of the prefix v[0..i-1], with $0\leq i \leq size()$.
Returns:
Number of 1-bits in the prefix [0..i-1] of the original bit_vector.
Time complexity
$ \Order{ sample\_rate of the rrr\_vector} $

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