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

Bit set string index. Stores a bit set for each symbol of the alphabet. The bit set 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 sets actually represent valid index. More...

#include <BitSetIndex.h>

Inheritance diagram for indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >:
[legend]
Collaboration diagram for indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >:
[legend]

Public Member Functions

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

Friends

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

Additional Inherited Members

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

Detailed Description

template<class SymbolType = DefaultSymbolType, size_t BitmaskBitCount = 64>
class indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >

Bit set string index. Stores a bit set for each symbol of the alphabet. The bit set 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 sets actually represent valid index.

Template Parameters
SymbolTypetype of symbols of indexed string

Constructor & Destructor Documentation

◆ BitSetIndex()

template<class SymbolType , size_t BitmaskBitCount>
indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::BitSetIndex ( ext::map< SymbolType, ext::bitset< BitmaskBitCount > >  vectors,
string::LinearString< SymbolType >  string 
)
explicit

Creates a new instance of the index with concrete bit sets and original indexed string.

Parameters
vectorsthe bit sets
stringthe original indexed string

Member Function Documentation

◆ getAlphabet() [1/2]

template<class SymbolType = DefaultSymbolType, size_t BitmaskBitCount = 64>
ext::set< SymbolType > && indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::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, size_t BitmaskBitCount = 64>
const ext::set< SymbolType > & indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::getAlphabet ( ) const &
inline

Getter of the alphabet of the indexed string.

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

◆ getData() [1/2]

template<class SymbolType = DefaultSymbolType, size_t BitmaskBitCount = 64>
ext::map< SymbolType, ext::bitset< BitmaskBitCount > > && indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::getData ( ) &&

Getter of the bit sets.

Returns
bit sets

◆ getData() [2/2]

template<class SymbolType = DefaultSymbolType, size_t BitmaskBitCount = 64>
const ext::map< SymbolType, ext::bitset< BitmaskBitCount > > & indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::getData ( ) const &

Getter of the bit sets.

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

◆ getString() [1/2]

template<class SymbolType = DefaultSymbolType, size_t BitmaskBitCount = 64>
string::LinearString< SymbolType > && indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::getString ( ) &&

Getter of the original indexed string.

Returns
the original indexed string

◆ getString() [2/2]

template<class SymbolType = DefaultSymbolType, size_t BitmaskBitCount = 64>
const string::LinearString< SymbolType > & indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::getString ( ) const &

Getter of the original indexed string.

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

◆ operator<=>()

template<class SymbolType = DefaultSymbolType, size_t BitmaskBitCount = 64>
auto indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::operator<=> ( const BitSetIndex< SymbolType, BitmaskBitCount > &  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, size_t BitmaskBitCount = 64>
bool indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::operator== ( const BitSetIndex< SymbolType, BitmaskBitCount > &  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, size_t BitmaskBitCount = 64>
bool indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::removeSymbolFromAlphabet ( const SymbolType &  symbol)
inline

Remover of a symbol from the alphabet of the indexed string. 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 , size_t BitmaskBitCount>
void indexes::stringology::BitSetIndex< SymbolType, BitmaskBitCount >::setBitVectorForSymbol ( SymbolType  symbol,
ext::bitset< BitmaskBitCount >  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, size_t BitmaskBitCount = 64>
ext::ostream & operator<< ( ext::ostream out,
const BitSetIndex< SymbolType, BitmaskBitCount > &  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: