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 | Protected Attributes
sdsl::rank_support Class Reference

The base class of classes supporting rank_queries for a sdsl::bit_vector in constant time. More...

#include <rank_support.hpp>

Inherited by sdsl::rank_support_v5<>, sdsl::rank_support_v<>, sdsl::rank_support_jmc, sdsl::rank_support_v< b, pattern_len >, and sdsl::rank_support_v5< b, pattern_len >.

List of all members.

Public Types

typedef int_vector< 1 >::size_type size_type

Public Member Functions

 rank_support (const int_vector< 1 > *v=NULL)
 Constructor.
 rank_support (const rank_support &rs)
 Copy constructor.
virtual ~rank_support ()
 Destructor.
virtual void init (const int_vector< 1 > *v=NULL)=0
 Initializes the data structure.
virtual const size_type rank (size_type i) const =0
 Answers rank queries for the supported bit_vector if init() was called before.
virtual const size_type operator() (size_type idx) const =0
 Alias for rank(i)
virtual size_type serialize (std::ostream &out, structure_tree_node *v, std::string name) const =0
 Serializes rank_support.
virtual void load (std::istream &in, const int_vector< 1 > *v=NULL)=0
 Loads the rank_support.
virtual void set_vector (const int_vector< 1 > *v=NULL)=0
 Sets the supported bit_vector to the given pointer.

Protected Attributes

const int_vector< 1 > * m_v
 Pointer to the rank supported bit_vector.

Detailed Description

The base class of classes supporting rank_queries for a sdsl::bit_vector in constant time.


Constructor & Destructor Documentation

sdsl::rank_support::rank_support ( const int_vector< 1 > *  v = NULL) [inline]

Constructor.

Parameters:
vThe supported bit_vector.

Member Function Documentation

virtual void sdsl::rank_support::init ( const int_vector< 1 > *  v = NULL) [pure 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

Implemented in sdsl::rank_support_v< b, pattern_len >, sdsl::rank_support_v<>, sdsl::rank_support_v5< b, pattern_len >, sdsl::rank_support_v5<>, and sdsl::rank_support_jmc.

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

Loads the rank_support.

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

Implemented in sdsl::rank_support_v< b, pattern_len >, sdsl::rank_support_v<>, sdsl::rank_support_v5< b, pattern_len >, sdsl::rank_support_v5<>, and sdsl::rank_support_jmc.

virtual const size_type sdsl::rank_support::rank ( size_type  i) const [pure 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

Implemented in sdsl::rank_support_v< b, pattern_len >, sdsl::rank_support_v<>, sdsl::rank_support_v5< b, pattern_len >, sdsl::rank_support_v5<>, and sdsl::rank_support_jmc.

virtual size_type sdsl::rank_support::serialize ( std::ostream &  out,
structure_tree_node v,
std::string  name 
) const [pure virtual]
virtual void sdsl::rank_support::set_vector ( const int_vector< 1 > *  v = NULL) [pure 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

Implemented in sdsl::rank_support_v< b, pattern_len >, sdsl::rank_support_v<>, sdsl::rank_support_v5< b, pattern_len >, sdsl::rank_support_v5<>, and sdsl::rank_support_jmc.


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