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

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. More...

#include <BitParallelIndex.h>

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

Public Member Functions

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

Friends

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

Additional Inherited Members

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

Detailed Description

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

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.

Template Parameters
SymbolTypetype of symbols of indexed string

Constructor & Destructor Documentation

◆ BitParallelIndex()

template<class SymbolType >
indexes::stringology::BitParallelIndex< SymbolType >::BitParallelIndex ( ext::set< SymbolType >  alphabet,
ext::map< SymbolType, ext::vector< bool > >  vectors 
)
explicit

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

Parameters
alphabetthe alphabet of indexed string
vectorsthe bit vectors

Member Function Documentation

◆ getAlphabet() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::set< SymbolType > && indexes::stringology::BitParallelIndex< 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::BitParallelIndex< 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, ext::vector< bool > > && indexes::stringology::BitParallelIndex< SymbolType >::getData ( ) &&

Getter of the bit vectors.

Returns
bit vectors

◆ getData() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::map< SymbolType, ext::vector< bool > > & indexes::stringology::BitParallelIndex< SymbolType >::getData ( ) const &

Getter of the bit vectors.

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

◆ getString()

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

Reconstructs the indexed string from bit vectors.

Returns
the original indexed string

◆ operator<=>()

template<class SymbolType = DefaultSymbolType>
auto indexes::stringology::BitParallelIndex< SymbolType >::operator<=> ( const BitParallelIndex< 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>
bool indexes::stringology::BitParallelIndex< SymbolType >::operator== ( const BitParallelIndex< 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::BitParallelIndex< 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.

◆ setBitVectorForSymbol()

template<class SymbolType >
void indexes::stringology::BitParallelIndex< SymbolType >::setBitVectorForSymbol ( SymbolType  symbol,
ext::vector< bool >  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 BitParallelIndex< 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: