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

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::ostreamoperator<< (ext::ostream &out, const NonlinearFullAndLinearIndex &instance)
 

Detailed Description

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
class indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >

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.

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol
StringIndexa template parameter representing a type of the string index

Constructor & Destructor Documentation

◆ NonlinearFullAndLinearIndex()

template<class SymbolType , template< typename > class StringIndex>
indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::NonlinearFullAndLinearIndex ( StringIndex< common::ranked_symbol< SymbolType > >  stringIndex,
ext::vector< int >  jumpTable,
ext::vector< unsigned >  repeats 
)
explicit

Creates a new instance of the index with concrete alphabet, bit vectors, subtree jump table, and subtree repeats.

Parameters
stringIndexthe concrete underlying string index.
jumpTablethe subtree jump table
repeatsthe subtree repeats table

Member Function Documentation

◆ getAlphabet() [1/2]

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
ext::set< common::ranked_symbol< SymbolType > > && indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getAlphabet ( ) &&
inline

Getter of the alphabet of the indexed tree.

Returns
the alphabet of the indexed tree

◆ getAlphabet() [2/2]

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
const ext::set< common::ranked_symbol< SymbolType > > & indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getAlphabet ( ) const &
inline

Getter of the alphabet of the indexed tree.

Returns
the alphabet of the indexed tree

◆ getJumps() [1/2]

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
ext::vector< int > && indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getJumps ( ) &&

Getter of the subtree jump table

Returns
the subtree jump table

◆ getJumps() [2/2]

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
const ext::vector< int > & indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getJumps ( ) const &

Getter of the subtree jump table

Returns
the subtree jump table
Here is the caller graph for this function:

◆ getRepeats() [1/2]

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
ext::vector< unsigned > && indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getRepeats ( ) &&

Getter of the subtree repeats table

Returns
the subtree repeats table

◆ getRepeats() [2/2]

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
const ext::vector< unsigned > & indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getRepeats ( ) const &

Getter of the subtree repeats table

Returns
the subtree repeats table
Here is the caller graph for this function:

◆ getStringIndex() [1/2]

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
StringIndex< common::ranked_symbol< SymbolType > > && indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getStringIndex ( ) &&

Getter of the underlying string index.

Returns
underlying string index

◆ getStringIndex() [2/2]

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
const StringIndex< common::ranked_symbol< SymbolType > > & indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::getStringIndex ( ) const &

Getter of the underlying string index.

Returns
underlying string index
Here is the caller graph for this function:

◆ operator<=>()

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
auto indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::operator<=> ( const NonlinearFullAndLinearIndex< SymbolType, StringIndex > &  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, template< typename > class StringIndex = indexes::stringology::PositionHeap>
bool indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::operator== ( const NonlinearFullAndLinearIndex< SymbolType, StringIndex > &  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, template< typename > class StringIndex = indexes::stringology::PositionHeap>
bool indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::removeSymbolFromAlphabet ( const common::ranked_symbol< SymbolType > &  symbol)
inline

Remover of a symbol from the alphabet. The symbol can be removed if it is not used in any of bit vector keys.

Parameters
symbola symbol to remove.

◆ setStringIndex()

template<class SymbolType , template< typename > class StringIndex>
void indexes::arbology::NonlinearFullAndLinearIndex< SymbolType, StringIndex >::setStringIndex ( StringIndex< common::ranked_symbol< SymbolType > >  stringIndex)

Changes the underlying string index.

Parameters
stringIndexnew string index

Friends And Related Function Documentation

◆ operator<<

template<class SymbolType = DefaultSymbolType, template< typename > class StringIndex = indexes::stringology::PositionHeap>
ext::ostream & operator<< ( ext::ostream out,
const NonlinearFullAndLinearIndex< SymbolType, StringIndex > &  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: