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::rank_support_jmc Class Reference

A class supporting rank queries in constant time. The implementation is a lightweight version of the data structure proposed by Jacobson (1989), Munro (1996), and Clark (1996). More...

#include <rank_support_jmc.hpp>

Inherits sdsl::rank_support.

List of all members.

Public Types

typedef bit_vector bit_vector_type

Public Member Functions

 rank_support_jmc (const int_vector< 1 > *v=NULL)
 rank_support_jmc (const rank_support_jmc &rs)
void init (const int_vector< 1 > *v=NULL)
 Initializes the data structure.
const size_type rank (size_type idx) const
 Answers rank queries for the supported bit_vector if init() was called before.
const size_type operator() (size_type idx) const
 Alias for rank(i)
size_type serialize (std::ostream &out, structure_tree_node *v=NULL, std::string name="") const
 Serializes rank_support.
void load (std::istream &in, const int_vector< 1 > *v=NULL)
 Loads the rank_support.
void set_vector (const int_vector< 1 > *v)
 Sets the supported bit_vector to the given pointer.
rank_support_jmcoperator= (const rank_support_jmc &rs)
 Assign Operator.
void swap (rank_support_jmc &rs)
 swap Operator
bool operator== (const rank_support_jmc &rs) const
 Equality Operator.
bool operator!= (const rank_support_jmc &rs) const
 Unequality Operator.

Detailed Description

A class supporting rank queries in constant time. The implementation is a lightweight version of the data structure proposed by Jacobson (1989), Munro (1996), and Clark (1996).


Member Function Documentation

void sdsl::rank_support_jmc::init ( const int_vector< 1 > *  v = NULL) [inline, virtual]

Initializes the data structure.

Parameters:
vThe supported bit_vector. If v equals NULL the previous set bit_vector is supported. Otherwise v will be supported.
Note:
Call this function before the first call of rank.
See also:
rank

Implements sdsl::rank_support.

void sdsl::rank_support_jmc::load ( std::istream &  in,
const int_vector< 1 > *  v = NULL 
) [inline, virtual]

Loads the rank_support.

Parameters:
inIn-Stream to load the rank_support data from.
vThe supported bit_vector.

Implements sdsl::rank_support.

bool sdsl::rank_support_jmc::operator!= ( const rank_support_jmc rs) const [inline]

Unequality Operator.

Two rank_support_jmcs are not equal if any member variable are not equal.

Required for the Equality Comparable Concept of the STL.

See also:
operator==
rank_support_jmc & sdsl::rank_support_jmc::operator= ( const rank_support_jmc rs) [inline]

Assign Operator.

Required for the Assignable Concept of the STL.

bool sdsl::rank_support_jmc::operator== ( const rank_support_jmc rs) const [inline]

Equality Operator.

Two rank_support_jmcs are equal if all member variables are equal.

Required for the Equality Comparable Concept of the STL.

See also:
operator!=
const rank_support_jmc::size_type sdsl::rank_support_jmc::rank ( size_type  i) const [inline, virtual]

Answers rank queries for the supported bit_vector if init() was called before.

Parameters:
iArgument for the length of the prefix v[0..i-1].
Returns:
Number of 1-bits in the prefix [0..i-1] of the supported bit_vector.
Note:
Method init has to be called before the first call of rank.
See also:
init

Implements sdsl::rank_support.

rank_support_jmc::size_type sdsl::rank_support_jmc::serialize ( std::ostream &  out,
structure_tree_node v = NULL,
std::string  name = "" 
) const [inline, virtual]

Serializes rank_support.

Parameters:
outOut-Stream to serialize the data to.

Implements sdsl::rank_support.

void sdsl::rank_support_jmc::set_vector ( const int_vector< 1 > *  v) [inline, virtual]

Sets the supported bit_vector to the given pointer.

Parameters:
vThe new bit_vector to support.
Note:
Method init has to be called before the next call of rank.
See also:
init, rank

Implements sdsl::rank_support.

swap Operator

Swap two rank_support_jmc in constant time. Required for the Container Concept of the STL.


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