Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Suffix array string index. Linear representation of all suffixes ordered lexicographically. Suffixes are represented as indexes to the indexed string and alphabet is stored within the string as well. Therefore the string is stored allong with Tree like representation of all suffixes. The class does not checks whether the suffixes order is correct. More...
#include <SuffixArray.h>
Public Member Functions | |
SuffixArray (ext::vector< unsigned > data, string::LinearString< SymbolType > string) | |
const ext::vector< unsigned > & | getData () const & |
ext::vector< unsigned > && | getData () && |
const string::LinearString< SymbolType > & | getString () const & |
string::LinearString< SymbolType > && | getString () && |
const ext::set< SymbolType > & | getAlphabet () const & |
ext::set< SymbolType > && | getAlphabet () && |
void | setData (ext::vector< unsigned > data) |
bool | removeSymbolFromAlphabet (const SymbolType &symbol) |
auto | operator<=> (const SuffixArray &other) const |
bool | operator== (const SuffixArray &other) const |
Friends | |
ext::ostream & | operator<< (ext::ostream &out, const SuffixArray &instance) |
Suffix array string index. Linear representation of all suffixes ordered lexicographically. Suffixes are represented as indexes to the indexed string and alphabet is stored within the string as well. Therefore the string is stored allong with Tree like representation of all suffixes. The class does not checks whether the suffixes order is correct.
SymbolType | type of symbols of indexed string |
|
explicit |
Creates a new instance of the index with concrete sorted indexes and indexed string.
data | the sorted indexes to the indexed string |
string | the indexed string |
|
inline |
Getter of the alphabet of the indexed string.
|
inline |
Getter of the alphabet of the indexed string.
ext::vector< unsigned > && indexes::stringology::SuffixArray< SymbolType >::getData | ( | ) | && |
Getter of the sorted indexes.
const ext::vector< unsigned > & indexes::stringology::SuffixArray< SymbolType >::getData | ( | ) | const & |
Getter of the sorted indexes.
string::LinearString< SymbolType > && indexes::stringology::SuffixArray< SymbolType >::getString | ( | ) | && |
Getter of the indexed string.
const string::LinearString< SymbolType > & indexes::stringology::SuffixArray< SymbolType >::getString | ( | ) | const & |
Getter of the indexed string.
|
inline |
The three way comparison implementation
other | the other instance |
other
.
|
inline |
The equality comparison implementation.
other | the other object to compare with. |
|
inline |
Remover of a symbol from the alphabet of indexed string.
symbol | a symbol to remove. |
void indexes::stringology::SuffixArray< SymbolType >::setData | ( | ext::vector< unsigned > | data | ) |
Sets the vector of sorted indexes to the indexed string.
data | new vector of indexes |
|
friend |
Print this object as raw representation to ostream.
out | ostream where to print |
instance | object to print |