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

Suffix automaton string index. Automaton representation of all suffixes. The automaton is general deterministic automaton. The class does not checks whether the automaton actually is a suffix automaton. The index alphabet is stored within the automaton. More...

#include <SuffixAutomaton.h>

Public Member Functions

 SuffixAutomaton (automaton::DFA< SymbolType, unsigned > automaton, unsigned backboneLength)
 
const automaton::DFA< SymbolType, unsigned > & getAutomaton () const &
 
automaton::DFA< SymbolType, unsigned > && getAutomaton () &&
 
const ext::set< SymbolType > & getAlphabet () const &
 
ext::set< SymbolType > && getAlphabet () &&
 
bool removeSymbolFromAlphabet (const SymbolType &symbol)
 
unsigned getBackboneLength () const
 
auto operator<=> (const SuffixAutomaton &other) const
 
bool operator== (const SuffixAutomaton &other) const
 
 operator automaton::DFA< SymbolType, unsigned > () const
 

Friends

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

Detailed Description

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

Suffix automaton string index. Automaton representation of all suffixes. The automaton is general deterministic automaton. The class does not checks whether the automaton actually is a suffix automaton. The index alphabet is stored within the automaton.

Template Parameters
SymbolTypetype of symbols of indexed string

Constructor & Destructor Documentation

◆ SuffixAutomaton()

template<class SymbolType >
indexes::stringology::SuffixAutomaton< SymbolType >::SuffixAutomaton ( automaton::DFA< SymbolType, unsigned >  automaton,
unsigned  backboneLength 
)
explicit

Creates a new instance of the index with concrete suffix automaton and backbone length.

Parameters
automatonthe suffix automaton representing the index
backbonethe length of the indexed string or the longest path in the automaton.

Member Function Documentation

◆ getAlphabet() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::set< SymbolType > && indexes::stringology::SuffixAutomaton< SymbolType >::getAlphabet ( ) &&
inline

Getter of the alphabet of the indexed string.

Returns
the alphabet of the indexed string

◆ getAlphabet() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::set< SymbolType > & indexes::stringology::SuffixAutomaton< SymbolType >::getAlphabet ( ) const &
inline

Getter of the alphabet of the indexed string.

Returns
the alphabet of the indexed string

◆ getAutomaton() [1/2]

template<class SymbolType = DefaultSymbolType>
automaton::DFA< SymbolType, unsigned > && indexes::stringology::SuffixAutomaton< SymbolType >::getAutomaton ( ) &&

Getter of the underlying suffix automaton.

Returns
raw automatn representing the index.

◆ getAutomaton() [2/2]

template<class SymbolType = DefaultSymbolType>
const automaton::DFA< SymbolType, unsigned > & indexes::stringology::SuffixAutomaton< SymbolType >::getAutomaton ( ) const &

Getter of the underlying suffix automaton.

Returns
raw automatn representing the index.
Here is the caller graph for this function:

◆ getBackboneLength()

template<class SymbolType = DefaultSymbolType>
unsigned indexes::stringology::SuffixAutomaton< SymbolType >::getBackboneLength ( ) const
inline

Getter of the backbone length.

Returns
the backbone length of the automaton
Here is the caller graph for this function:

◆ operator automaton::DFA< SymbolType, unsigned >()

template<class SymbolType >
indexes::stringology::SuffixAutomaton< SymbolType >::operator automaton::DFA< SymbolType, unsigned >
explicit

Cast operator to the raw automaton.

Returns
the underlying raw deterministic automaton.

◆ operator<=>()

template<class SymbolType = DefaultSymbolType>
auto indexes::stringology::SuffixAutomaton< SymbolType >::operator<=> ( const SuffixAutomaton< 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::SuffixAutomaton< SymbolType >::operator== ( const SuffixAutomaton< 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::SuffixAutomaton< SymbolType >::removeSymbolFromAlphabet ( const SymbolType &  symbol)
inline

Remover of a symbol from the alphabet.

Parameters
symbola symbol to remove.

Friends And Related Function Documentation

◆ operator<<

template<class SymbolType = DefaultSymbolType>
ext::ostream & operator<< ( ext::ostream out,
const SuffixAutomaton< 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: