Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions | Friends
indexes::stringology::CompressedBitParallelIndex< SymbolType > Class Template Referencefinal

Compressed bit parallel string index. Stores a bit vector for each symbol of the alphabet. The bit vector of symbol a contains true on index i if symbol a is on i-th position in the indexed string. The class does not check whether the bit vectors actually represent valid index. The bit vectors are compressed with run length encoding packing runs of false values. More...

#include <CompressedBitParallelIndex.h>

Inheritance diagram for indexes::stringology::CompressedBitParallelIndex< SymbolType >:
[legend]
Collaboration diagram for indexes::stringology::CompressedBitParallelIndex< SymbolType >:
[legend]

Public Member Functions

 CompressedBitParallelIndex (ext::set< SymbolType > alphabet, ext::map< SymbolType, common::SparseBoolVector > vectors)
 
const ext::map< SymbolType, common::SparseBoolVector > & getData () const &
 
ext::map< SymbolType, common::SparseBoolVector > && getData () &&
 
ext::vector< SymbolType > getString () const
 
const ext::set< SymbolType > & getAlphabet () const &
 
ext::set< SymbolType > && getAlphabet () &&
 
void setCompressedBitVectorForSymbol (SymbolType symbol, common::SparseBoolVector data)
 
bool removeSymbolFromAlphabet (const SymbolType &symbol)
 
auto operator<=> (const CompressedBitParallelIndex &other) const
 
auto operator== (const CompressedBitParallelIndex &other) const
 
- Public Member Functions inherited from core::Components< CompressedBitParallelIndex< DefaultSymbolType >, ext::set< DefaultSymbolType >, component::Set, GeneralAlphabet >
void accessComponent ()
 

Friends

ext::ostreamoperator<< (ext::ostream &out, const CompressedBitParallelIndex &instance)
 

Additional Inherited Members

- Static Public Member Functions inherited from core::Components< CompressedBitParallelIndex< DefaultSymbolType >, ext::set< DefaultSymbolType >, component::Set, GeneralAlphabet >
static void registerComponent ()
 
static void unregisterComponent ()
 

Detailed Description

template<class SymbolType = DefaultSymbolType>
class indexes::stringology::CompressedBitParallelIndex< SymbolType >

Compressed bit parallel string index. Stores a bit vector for each symbol of the alphabet. The bit vector of symbol a contains true on index i if symbol a is on i-th position in the indexed string. The class does not check whether the bit vectors actually represent valid index. The bit vectors are compressed with run length encoding packing runs of false values.

Template Parameters
SymbolTypetype of symbols of indexed string

Constructor & Destructor Documentation

◆ CompressedBitParallelIndex()

template<class SymbolType >
indexes::stringology::CompressedBitParallelIndex< SymbolType >::CompressedBitParallelIndex ( ext::set< SymbolType >  alphabet,
ext::map< SymbolType, common::SparseBoolVector vectors 
)
explicit

Creates a new instance of the index with concrete alphabet and bit vectors.

Parameters
alphabetthe alphabet of indexed string
vectorsthe compressed bit vectors

Member Function Documentation

◆ getAlphabet() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::set< SymbolType > && indexes::stringology::CompressedBitParallelIndex< SymbolType >::getAlphabet ( ) &&
inline

Getter of the alphabet of the indexed string.

Returns
the alphabet of the indexed string
Here is the call graph for this function:

◆ getAlphabet() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::set< SymbolType > & indexes::stringology::CompressedBitParallelIndex< SymbolType >::getAlphabet ( ) const &
inline

Getter of the alphabet of the indexed string.

Returns
the alphabet of the indexed string
Here is the caller graph for this function:

◆ getData() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::map< SymbolType, common::SparseBoolVector > && indexes::stringology::CompressedBitParallelIndex< SymbolType >::getData ( ) &&

Getter of the compressed bit vectors.

Returns
compressed bit vectors

◆ getData() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::map< SymbolType, common::SparseBoolVector > & indexes::stringology::CompressedBitParallelIndex< SymbolType >::getData ( ) const &

Getter of the compressed bit vectors.

Returns
compressed bit vectors
Here is the caller graph for this function:

◆ getString()

template<class SymbolType >
ext::vector< SymbolType > indexes::stringology::CompressedBitParallelIndex< SymbolType >::getString

Reconstructs the indexed string from bit vectors.

Returns
the original indexed string

◆ operator<=>()

template<class SymbolType = DefaultSymbolType>
auto indexes::stringology::CompressedBitParallelIndex< SymbolType >::operator<=> ( const CompressedBitParallelIndex< SymbolType > &  other) const
inline

The three way comparison implementation

Parameters
otherthe other instance
Returns
the ordering between this object and the other.
Here is the call graph for this function:

◆ operator==()

template<class SymbolType = DefaultSymbolType>
auto indexes::stringology::CompressedBitParallelIndex< SymbolType >::operator== ( const CompressedBitParallelIndex< SymbolType > &  other) const
inline

The equality comparison implementation.

Parameters
otherthe other object to compare with.
Returns
true if this and other objects are equal, false othervise
Here is the call graph for this function:

◆ removeSymbolFromAlphabet()

template<class SymbolType = DefaultSymbolType>
bool indexes::stringology::CompressedBitParallelIndex< SymbolType >::removeSymbolFromAlphabet ( const SymbolType &  symbol)
inline

Remover of a symbol from the alphabet. The symbol can be removed if it is not used in any of bit vector keys.

Parameters
symbola symbol to remove.

◆ setCompressedBitVectorForSymbol()

template<class SymbolType >
void indexes::stringology::CompressedBitParallelIndex< SymbolType >::setCompressedBitVectorForSymbol ( SymbolType  symbol,
common::SparseBoolVector  data 
)

Changes the bit vector for concrete symbol.

Parameters
symbolthe changed symbol
datathe new bit vector

Friends And Related Function Documentation

◆ operator<<

template<class SymbolType = DefaultSymbolType>
ext::ostream & operator<< ( ext::ostream out,
const CompressedBitParallelIndex< SymbolType > &  instance 
)
friend

Print this object as raw representation to ostream.

Parameters
outostream where to print
instanceobject to print
Returns
modified output stream

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