Skip to content
Snippets Groups Projects
Unverified Commit e5ce6461 authored by Tomáš Pecka's avatar Tomáš Pecka
Browse files

algo: rename border array identifier in tree KMP

parent 17c05dfe
No related branches found
No related tags found
2 merge requests!195registry: overload documentation,!194algo: Add tree::properties::BorderArray for PrefixRankedExtendedPattern
Pipeline #158273 failed
......@@ -59,7 +59,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedBarTree
template < class SymbolType >
ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedBarTree < SymbolType > & subject, const tree::PrefixRankedBarPattern < SymbolType > & pattern ) {
ext::set < unsigned > occ;
ext::vector < size_t > construct = tree::properties::BorderArray::construct ( pattern );
ext::vector < size_t > borderArray = tree::properties::BorderArray::construct ( pattern );
 
//measurements::start("Algorithm", measurements::Type::MAIN);
 
......@@ -87,7 +87,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedBarTree
if ( j == 0 ) {
i += 1;
} else {
unsigned shift = j - construct [ j ];
unsigned shift = j - borderArray [ j ];
// shift heuristics
i += shift;
j = std::min ( Spos, j ) - shift;
......@@ -102,7 +102,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedBarTree
template < class SymbolType >
ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedBarTree < SymbolType > & subject, const tree::PrefixRankedBarNonlinearPattern < SymbolType > & pattern ) {
ext::set < unsigned > occ;
ext::vector < size_t > construct = tree::properties::BorderArray::construct ( pattern );
ext::vector < size_t > borderArray = tree::properties::BorderArray::construct ( pattern );
 
//measurements::start("Algorithm", measurements::Type::MAIN);
 
......@@ -131,7 +131,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedBarTree
if ( j == 0 ) {
i += 1;
} else {
unsigned shift = j - construct [ j ];
unsigned shift = j - borderArray [ j ];
// shift heuristics
i += shift;
j = std::min ( Spos, j ) - shift;
......@@ -156,7 +156,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedTree < S
template < class SymbolType >
ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedTree < SymbolType > & subject, const tree::PrefixRankedExtendedPattern < SymbolType > & pattern ) {
ext::set < unsigned > occ;
ext::vector < size_t > construct = tree::properties::BorderArrayNaive::construct ( pattern );
ext::vector < size_t > borderArray = tree::properties::BorderArrayNaive::construct ( pattern );
 
//measurements::start("Algorithm", measurements::Type::MAIN);
 
......@@ -184,7 +184,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedTree < S
if ( j == 0 ) {
i += 1;
} else {
unsigned shift = j - construct [ j ];
unsigned shift = j - borderArray [ j ];
// shift heuristics
i += shift;
j = std::min ( Spos, j ) - shift;
......@@ -199,7 +199,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedTree < S
template < class SymbolType >
ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedTree < SymbolType > & subject, const tree::PrefixRankedNonlinearPattern < SymbolType > & pattern ) {
ext::set < unsigned > occ;
ext::vector < size_t > construct = tree::properties::BorderArray::construct ( pattern );
ext::vector < size_t > borderArray = tree::properties::BorderArray::construct ( pattern );
 
//measurements::start("Algorithm", measurements::Type::MAIN);
 
......@@ -228,7 +228,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedTree < S
if ( j == 0 ) {
i += 1;
} else {
unsigned shift = j - construct [ j ];
unsigned shift = j - borderArray [ j ];
// shift heuristics
i += shift;
j = std::min ( Spos, j ) - shift;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment