From e5ce64617c78f55b677b3c663e4b3a026a4b48cb Mon Sep 17 00:00:00 2001 From: Tomas Pecka <peckato1@fit.cvut.cz> Date: Thu, 11 Nov 2021 10:05:12 +0100 Subject: [PATCH] algo: rename border array identifier in tree KMP --- alib2algo/src/arbology/exact/KnuthMorrisPratt.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/alib2algo/src/arbology/exact/KnuthMorrisPratt.h b/alib2algo/src/arbology/exact/KnuthMorrisPratt.h index 75db9d77e5..f9d37094e7 100644 --- a/alib2algo/src/arbology/exact/KnuthMorrisPratt.h +++ b/alib2algo/src/arbology/exact/KnuthMorrisPratt.h @@ -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; -- GitLab