Sux
Public Member Functions | List of all members
sux::Rank Class Referenceabstract

#include <Rank.hpp>

Inheritance diagram for sux::Rank:
sux::bits::EliasFano< AT > sux::bits::Rank9< AT > sux::bits::StrideDynRankSel< SPS, WORDS, AT > sux::bits::WordDynRankSel< SPS, AT > sux::bits::Rank9Sel< AT >

Public Member Functions

virtual ~Rank ()=default
 
virtual uint64_t rank (std::size_t pos)=0
 
uint64_t rank (std::size_t from, std::size_t to)
 
virtual uint64_t rankZero (std::size_t pos)
 
uint64_t rankZero (std::size_t from, std::size_t to)
 
virtual std::size_t size () const =0
 

Detailed Description

An interface specifying ranking primitives.

This inferface specifies primitives both on ones and on zeroes because ranking on ones automatically makes it possible ranking on zeros, and viceversa. This interface provides template methods for rank(std::size_t, std::size_t), rankZero(std::size_t) and rankZero(std::size_t,std::size_t) using just rank(std::size_t).

Constructor & Destructor Documentation

◆ ~Rank()

virtual sux::Rank::~Rank ( )
virtualdefault

Member Function Documentation

◆ rank() [1/2]

uint64_t sux::Rank::rank ( std::size_t  from,
std::size_t  to 
)
inline

Returns the number of ones between two given positions.

Parameters
fromA starting position from 0 to size() (included).
toAn ending position from from to size() (included).
Returns
the number of ones from the starting position (included) to the ending position (excluded).

◆ rank() [2/2]

virtual uint64_t sux::Rank::rank ( std::size_t  pos)
pure virtual

Returns the number of ones before the given posistion.

Parameters
posA position from 0 to size() (included).
Returns
the number of ones from the start of the bit vector up to the given position (excluded).

◆ rankZero() [1/2]

uint64_t sux::Rank::rankZero ( std::size_t  from,
std::size_t  to 
)
inline

Returns the number of zeros between two given positions.

Parameters
fromA starting position from 0 to size() (included).
toAn ending position from from to size() (included).
Returns
the number of zeros from the starting position (included) to the ending position (excluded).

◆ rankZero() [2/2]

virtual uint64_t sux::Rank::rankZero ( std::size_t  pos)
inlinevirtual

Returns the number of zeros before the given posistion.

Parameters
posA position from 0 to size() (included).
Returns
the number of zeros from the start of the bit vector up to the given position (excluded).

◆ size()

virtual std::size_t sux::Rank::size ( ) const
pure virtual

Returns the length (in bits) of the underlying bit vector.

Implemented in sux::bits::EliasFano< AT >, sux::bits::StrideDynRankSel< SPS, WORDS, AT >, sux::bits::WordDynRankSel< SPS, AT >, and sux::bits::Rank9< AT >.


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