Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Full and linear tree index. The index serves as a adaptor of string index so that searching for tree patterns is possible. The representation of the index stores a string index and a subtree jump table. The implementation since parametrized with the string index represents a family of indexes. The index is supposed to be able to provide data to search for nonlinear tree patterns. Therefore it also contains representation of subtree repeats. More...
#include <NonlinearFullAndLinearIndex.h>
Public Member Functions | |
NonlinearFullAndLinearIndex (StringIndex< common::ranked_symbol< SymbolType > > stringIndex, ext::vector< int > jumpTable, ext::vector< unsigned > repeats) | |
const StringIndex< common::ranked_symbol< SymbolType > > & | getStringIndex () const & |
StringIndex< common::ranked_symbol< SymbolType > > && | getStringIndex () && |
const ext::vector< int > & | getJumps () const & |
ext::vector< int > && | getJumps () && |
const ext::vector< unsigned > & | getRepeats () const & |
ext::vector< unsigned > && | getRepeats () && |
const ext::set< common::ranked_symbol< SymbolType > > & | getAlphabet () const & |
ext::set< common::ranked_symbol< SymbolType > > && | getAlphabet () && |
void | setStringIndex (StringIndex< common::ranked_symbol< SymbolType > > stringIndex) |
bool | removeSymbolFromAlphabet (const common::ranked_symbol< SymbolType > &symbol) |
auto | operator<=> (const NonlinearFullAndLinearIndex &other) const |
bool | operator== (const NonlinearFullAndLinearIndex &other) const |
Friends | |
ext::ostream & | operator<< (ext::ostream &out, const NonlinearFullAndLinearIndex &instance) |
Full and linear tree index. The index serves as a adaptor of string index so that searching for tree patterns is possible. The representation of the index stores a string index and a subtree jump table. The implementation since parametrized with the string index represents a family of indexes. The index is supposed to be able to provide data to search for nonlinear tree patterns. Therefore it also contains representation of subtree repeats.
The actual notation of used tree is irelevant. The index, as fas as the data structure is concerned, is not different. Of course tree in postfix notation must be queried with patterns in postfix notation, etc.
SymbolType | used for the symbol part of the ranked symbol |
StringIndex | a template parameter representing a type of the string index |
|
explicit |
Creates a new instance of the index with concrete alphabet, bit vectors, subtree jump table, and subtree repeats.
stringIndex | the concrete underlying string index. |
jumpTable | the subtree jump table |
repeats | the subtree repeats table |
|
inline |
Getter of the alphabet of the indexed tree.
|
inline |
Getter of the alphabet of the indexed tree.
ext::vector< int > && indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getJumps | ( | ) | && |
Getter of the subtree jump table
const ext::vector< int > & indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getJumps | ( | ) | const & |
Getter of the subtree jump table
ext::vector< unsigned > && indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getRepeats | ( | ) | && |
Getter of the subtree repeats table
const ext::vector< unsigned > & indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getRepeats | ( | ) | const & |
Getter of the subtree repeats table
StringIndex< common::ranked_symbol< SymbolType > > && indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getStringIndex | ( | ) | && |
Getter of the underlying string index.
const StringIndex< common::ranked_symbol< SymbolType > > & indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getStringIndex | ( | ) | const & |
Getter of the underlying string index.
|
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. The symbol can be removed if it is not used in any of bit vector keys.
symbol | a symbol to remove. |
void indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::setStringIndex | ( | StringIndex< common::ranked_symbol< SymbolType > > | stringIndex | ) |
Changes the underlying string index.
stringIndex | new string index |
|
friend |
Print this object as raw representation to ostream.
out | ostream where to print |
instance | object to print |