SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
|
rank_support for the rrr_vector class More...
#include <rrr_vector.hpp>
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_support & | operator= (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. |
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
sdsl::rrr_rank_support< b, block_size, wt_type >::rrr_rank_support | ( | const bit_vector_type * | v = NULL | ) | [inline, explicit] |
Standard constructor.
v | Pointer to the rrr_vector, which should be supported |
const size_type sdsl::rrr_rank_support< b, block_size, wt_type >::rank | ( | size_type | i | ) | const [inline] |
Answers rank queries.
i | Argument for the length of the prefix v[0..i-1], with . |