SDSL  3.0.0
Succinct Data Structure Library
sdsl::rank_support Class Referenceabstract

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

#include <rank_support.hpp>

Inheritance diagram for sdsl::rank_support:
sdsl::rank_support_v5< 10, 2 > sdsl::rank_support_scan< t_b, t_pat_len > sdsl::rank_support_v< t_b, t_pat_len > sdsl::rank_support_v5< t_b, t_pat_len >

Public Types

typedef bit_vector::size_type size_type
 

Public Member Functions

 rank_support (const bit_vector *v=nullptr)
 Constructor. More...
 
 rank_support (const rank_support &)=default
 Copy constructor. More...
 
 rank_support (rank_support &&)=default
 
rank_supportoperator= (const rank_support &)=default
 
rank_supportoperator= (rank_support &&)=default
 
virtual ~rank_support ()
 Destructor. More...
 
virtual size_type rank (size_type i) const =0
 Answers rank queries for the supported bit_vector. More...
 
virtual size_type operator() (size_type idx) const =0
 Alias for rank(i) More...
 
virtual size_type serialize (std::ostream &out, structure_tree_node *v, std::string name) const =0
 Serializes rank_support. More...
 
virtual void load (std::istream &in, const bit_vector *v=nullptr)=0
 Loads the rank_support. More...
 
virtual void set_vector (const bit_vector *v=nullptr)=0
 Sets the supported bit_vector to the given pointer. More...
 

Protected Attributes

const bit_vectorm_v
 Pointer to the rank supported bit_vector. More...
 

Detailed Description

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

Definition at line 24 of file rank_support.hpp.

Member Typedef Documentation

◆ size_type

Constructor & Destructor Documentation

◆ rank_support() [1/3]

sdsl::rank_support::rank_support ( const bit_vector v = nullptr)
inline

Constructor.

Parameters
vThe supported bit_vector.

Definition at line 69 of file rank_support.hpp.

◆ rank_support() [2/3]

sdsl::rank_support::rank_support ( const rank_support )
default

Copy constructor.

◆ rank_support() [3/3]

sdsl::rank_support::rank_support ( rank_support &&  )
default

◆ ~rank_support()

virtual sdsl::rank_support::~rank_support ( )
inlinevirtual

Destructor.

Definition at line 41 of file rank_support.hpp.

Member Function Documentation

◆ load()

virtual void sdsl::rank_support::load ( std::istream &  in,
const bit_vector v = nullptr 
)
pure virtual

◆ operator()()

virtual size_type sdsl::rank_support::operator() ( size_type  idx) const
pure virtual

◆ operator=() [1/2]

rank_support& sdsl::rank_support::operator= ( const rank_support )
default

◆ operator=() [2/2]

rank_support& sdsl::rank_support::operator= ( rank_support &&  )
default

◆ rank()

virtual size_type sdsl::rank_support::rank ( size_type  i) const
pure virtual

Answers rank queries for the supported bit_vector.

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_v5< t_b, t_pat_len >, sdsl::rank_support_v5< 10, 2 >, and sdsl::rank_support_v< t_b, t_pat_len >.

◆ serialize()

virtual size_type sdsl::rank_support::serialize ( std::ostream &  out,
structure_tree_node v,
std::string  name 
) const
pure virtual

◆ set_vector()

virtual void sdsl::rank_support::set_vector ( const bit_vector v = nullptr)
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_v5< t_b, t_pat_len >, sdsl::rank_support_v5< 10, 2 >, sdsl::rank_support_v< t_b, t_pat_len >, and sdsl::rank_support_scan< t_b, t_pat_len >.

Member Data Documentation

◆ m_v

const bit_vector* sdsl::rank_support::m_v
protected

Pointer to the rank supported bit_vector.

Definition at line 27 of file rank_support.hpp.


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