Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Position heap string index. Tree like representation of all suffixes. The suffixes are themselves represented by their prefixes. The prefix of each suffix needs to be unique from all representants (prefixes again) of shorter suffixes. Nodes of the trie contain index of the suffix. The parent child relationship of nodes is represented by single symbol. The class does not checks whether the trie structure actually is position heap. More...
#include <PositionHeap.h>
Public Member Functions | |
PositionHeap (ext::trie< SymbolType, unsigned > trie, string::LinearString< SymbolType > string) | |
const ext::trie< SymbolType, unsigned > & | getRoot () const & |
ext::trie< SymbolType, unsigned > && | getRoot () && |
const string::LinearString< SymbolType > & | getString () const & |
string::LinearString< SymbolType > && | getString () && |
const ext::set< SymbolType > & | getAlphabet () const & |
ext::set< SymbolType > && | getAlphabet () && |
void | setTree (ext::trie< SymbolType, unsigned > trie) |
bool | removeSymbolFromEdgeAlphabet (const SymbolType &symbol) |
auto | operator<=> (const PositionHeap &other) const |
bool | operator== (const PositionHeap &other) const |
Friends | |
ext::ostream & | operator<< (ext::ostream &out, const PositionHeap &instance) |
Position heap string index. Tree like representation of all suffixes. The suffixes are themselves represented by their prefixes. The prefix of each suffix needs to be unique from all representants (prefixes again) of shorter suffixes. Nodes of the trie contain index of the suffix. The parent child relationship of nodes is represented by single symbol. The class does not checks whether the trie structure actually is position heap.
Also the size of the structure is exactly linear.
SymbolType | type of symbols of indexed string |
|
explicit |
Creates a new instance of the index based on constructed position heap and original indexed string.
trie | the raw data of the index - the position heap |
string | the indexed string |
|
inline |
Getter of the alphabet of the indexed string.
|
inline |
Getter of the alphabet of the indexed string.
ext::trie< SymbolType, unsigned > && indexes::stringology::PositionHeap< SymbolType >::getRoot | ( | ) | && |
Getter of the raw position heap.
const ext::trie< SymbolType, unsigned > & indexes::stringology::PositionHeap< SymbolType >::getRoot | ( | ) | const & |
Getter of the raw position heap.
string::LinearString< SymbolType > && indexes::stringology::PositionHeap< SymbolType >::getString | ( | ) | && |
Getter of the indexed string.
const string::LinearString< SymbolType > & indexes::stringology::PositionHeap< 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.
symbol | a symbol to remove. |
void indexes::stringology::PositionHeap< SymbolType >::setTree | ( | ext::trie< SymbolType, unsigned > | trie | ) |
Sets the root node of the suffix trie
tree | root node to set |
|
friend |
Print this object as raw representation to ostream.
out | ostream where to print |
instance | object to print |