Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Data Structures | Public Member Functions | Static Protected Member Functions
stringology::cover::ApproximateEnhancedCoversCommon Class Referenceabstract

#include <ApproximateEnhancedCoversCommon.h>

Inheritance diagram for stringology::cover::ApproximateEnhancedCoversCommon:
[legend]

Data Structures

struct  Element
 
struct  State
 

Public Member Functions

virtual ~ApproximateEnhancedCoversCommon ()=0
 

Static Protected Member Functions

static unsigned distEnhCov (const State &q)
 
static void updateEnhCov (const State &state, ext::set< ext::pair< unsigned, unsigned > > &enhCovers, unsigned &h)
 
template<class SymbolType >
static State constrFirstState (const string::LinearString< SymbolType > &x, unsigned k, const SymbolType &symbol)
 
template<class SymbolType >
static State constrNextState (const string::LinearString< SymbolType > &x, const State &previousState, unsigned k, const SymbolType &symbol)
 
template<class SymbolType >
static bool isBorder (const State &state, const string::LinearString< SymbolType > &x, unsigned k)
 
template<class SymbolType >
static ext::set< string::LinearString< SymbolType > > getFactors (const string::LinearString< SymbolType > &x, ext::set< ext::pair< unsigned int, unsigned int > > &enhCovers)
 

Detailed Description

Auxiliary abstract class used to extract common functions used by both ApproximateEnhancedCoversComputation and RelaxedApproximateEnhancedCoversComputation.

Constructor & Destructor Documentation

◆ ~ApproximateEnhancedCoversCommon()

virtual stringology::cover::ApproximateEnhancedCoversCommon::~ApproximateEnhancedCoversCommon ( )
pure virtual

The purpose of this virtual destructor is to make the whole class abstract.

Member Function Documentation

◆ constrFirstState()

template<class SymbolType >
static State stringology::cover::ApproximateEnhancedCoversCommon::constrFirstState ( const string::LinearString< SymbolType > &  x,
unsigned  k,
const SymbolType &  symbol 
)
inlinestaticprotected

Constructs the first state of deterministic k-approximate suffix automaton obtained by reading symbol "symbol".

Parameters
xthe original string
kthe maximum number of allowed errors
symbolthe first read symbol
Returns
the first state of deterministic k-approximate suffix automaton
Here is the call graph for this function:
Here is the caller graph for this function:

◆ constrNextState()

template<class SymbolType >
static State stringology::cover::ApproximateEnhancedCoversCommon::constrNextState ( const string::LinearString< SymbolType > &  x,
const State previousState,
unsigned  k,
const SymbolType &  symbol 
)
inlinestaticprotected

Constructs the next state of deterministic k-approximate suffix automaton approachable by the previous state by reading the symbol "symbol".

Parameters
xthe original string
previousState
kthe maximum number of allowed errors
symbolread symbol
Returns
the next state of deterministic k-approximate suffix automaton
Here is the call graph for this function:
Here is the caller graph for this function:

◆ distEnhCov()

static unsigned stringology::cover::ApproximateEnhancedCoversCommon::distEnhCov ( const State q)
inlinestaticprotected

Computes the number of covered positions by the given state.

Parameters
qstate of the deterministic k-approximate suffix automaton
Returns
the number of covered positions
Here is the caller graph for this function:

◆ getFactors()

template<class SymbolType >
static ext::set< string::LinearString< SymbolType > > stringology::cover::ApproximateEnhancedCoversCommon::getFactors ( const string::LinearString< SymbolType > &  x,
ext::set< ext::pair< unsigned int, unsigned int > > &  enhCovers 
)
inlinestaticprotected

Makes actual set of (relaxed) approximate enhanced covers from the set of lfactors, so the set of pairs of end position of factor and length of factor

Parameters
xthe original string
enhCoversset of pairs of end position of factor and length of factor
Returns
the set of (relaxed) approximate enhanced covers
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isBorder()

template<class SymbolType >
static bool stringology::cover::ApproximateEnhancedCoversCommon::isBorder ( const State state,
const string::LinearString< SymbolType > &  x,
unsigned  k 
)
inlinestaticprotected

Checks if a string represented by the state of the k-approximate deterministic suffix automaton is an exact border.

Parameters
state
xthe original string
kmaximum number of allowed errors
Returns
true if state represents border, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateEnhCov()

static void stringology::cover::ApproximateEnhancedCoversCommon::updateEnhCov ( const State state,
ext::set< ext::pair< unsigned, unsigned > > &  enhCovers,
unsigned &  h 
)
inlinestaticprotected

Computes the number of covered positions by the given state and updates the set of found (relaxed) k-approximate enhanced covers if necessary.

Parameters
state
enhCoversset of lfactors representing all found (relaxed) k-approximate enhanced covers
hthe maximum number of covered position
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: