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

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

#include <select_support.hpp>

Inherited by sdsl::select_support_bs< RankSupport >, sdsl::select_support_dummy, and sdsl::select_support_mcl< b, pattern_len >.

List of all members.

Public Types

typedef int_vector< 1 >::size_type size_type

Public Member Functions

 select_support (const int_vector< 1 > *f_v=NULL)
 Constructor of select_support.
 select_support (const select_support &f_v)
 Copy constructor.
virtual ~select_support ()
 Destructor of select_support.
virtual void init (const int_vector< 1 > *v=NULL)=0
 Initalization method for select_support.
virtual const size_type select (size_type i) const =0
 Select returns the index of the i-th 1-bit in the supported bit_vector.
virtual const size_type operator() (size_type i) const =0
 Alias for select.
virtual size_type serialize (std::ostream &out, structure_tree_node *v, std::string name) const =0
 Serialize the select_support to an out file stream.
virtual void load (std::istream &in, const int_vector< 1 > *v=NULL)=0
 Load the select_support from an in file stream.
virtual void set_vector (const int_vector< 1 > *v=NULL)=0
 This method sets the supported bit_vector.

Public Attributes

const bit_vectorv

Protected Attributes

const int_vector< 1 > * m_v
 Pointer to the select supported sdsl::bit_vector.

Detailed Description

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

Abstract base class for classes supporting select queries.


Constructor & Destructor Documentation

sdsl::select_support::select_support ( const int_vector< 1 > *  f_v = NULL) [inline]

Constructor of select_support.

Parameters:
vThe bit_vector to support rank queries.

Copy constructor.

Copy the whole select_support including the pointer to the supported bit_vector.


Member Function Documentation

virtual void sdsl::select_support::init ( const int_vector< 1 > *  v = NULL) [pure virtual]

Initalization method for select_support.

Init takes no arguments and should be called before the first call to the select method if not

  • load is called to initialize the select_support or
  • the constructor is called with the pointer to the supported bit_vector.
    See also:
    select, load.

Implemented in sdsl::select_support_mcl< b, pattern_len >, sdsl::select_support_dummy, and sdsl::select_support_bs< RankSupport >.

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

Load the select_support from an in file stream.

Load an previously serialized select_support from a std::istream. This method could replace the call of init before the first call of the select method.

Parameters:
inThe std::istream to load the select_support.
vThe bit_vector to be supported.
See also:
init, select.

Implemented in sdsl::select_support_mcl< b, pattern_len >, sdsl::select_support_dummy, and sdsl::select_support_bs< RankSupport >.

virtual const size_type sdsl::select_support::select ( size_type  i) const [pure virtual]

Select returns the index of the i-th 1-bit in the supported bit_vector.

Parameters:
iArgument to calculate the index of the i-th 1-bit in the supported bit_vector.
Returns:
The index $\in [0..v.size()-1]$ of the i-th 1-bit in the supported bit_vector. Call init or load to initialize the data structure before the first call of this method.
See also:
init, load.

Implemented in sdsl::select_support_mcl< b, pattern_len >, sdsl::select_support_dummy, and sdsl::select_support_bs< RankSupport >.

virtual void sdsl::select_support::set_vector ( const int_vector< 1 > *  v = NULL) [pure virtual]

This method sets the supported bit_vector.

Note:
Call the init function before you call select the first time after you changed the supported bit_vector.

Implemented in sdsl::select_support_mcl< b, pattern_len >, sdsl::select_support_dummy, and sdsl::select_support_bs< RankSupport >.


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