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 | Friends
sdsl::gap_vector< b > Class Template Reference

A bit vector which compresses very sparse populated bit vectors by representing the 1 or 0 by gap encoding. More...

#include <gap_vector.hpp>

List of all members.

Public Types

typedef bit_vector::size_type size_type
typedef size_type value_type
typedef gap_rank_support< true > rank_1_type
typedef gap_select_support< true > select_1_type

Public Member Functions

 gap_vector (const bit_vector &bv)
void swap (gap_vector &v)
 Swap method.
value_type operator[] (size_type i) const
 Accessing the i-th element of the original bit_vector.
size_type size () const
 Returns the size of the original bit vector.
size_type serialize (std::ostream &out, structure_tree_node *v=NULL, std::string name="") const
 Serializes the data structure into the given ostream.
void load (std::istream &in)
 Loads the data structure from the given istream.

Friends

class gap_rank_support< true >
class gap_select_support< true >

Detailed Description

template<bool b = true>
class sdsl::gap_vector< b >

A bit vector which compresses very sparse populated bit vectors by representing the 1 or 0 by gap encoding.


Member Function Documentation

template<bool b = true>
value_type sdsl::gap_vector< b >::operator[] ( size_type  i) const [inline]

Accessing the i-th element of the original bit_vector.

Parameters:
iAn index i with $ 0 \leq i < size() $.
Returns:
The i-th bit of the original bit_vector
Time complexity
$ \Order{\log m} $, where m equals the number of zeros

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