diff --git a/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp b/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp index 5678acaab7f630475b4d24e4fcb2f5e317265a1f..7cb4981b8b37077df1e0bd5ca67a950d9d59de25 100644 --- a/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp +++ b/alib2algo/src/stringology/exact/BoyerMooreHorspool.cpp @@ -13,6 +13,7 @@ #include <alphabet/Symbol.h> #include <map> +#include <measure> namespace stringology { @@ -25,8 +26,12 @@ std::set<unsigned> BoyerMooreHorspool::match(const string::String& subject, cons std::set<unsigned> BoyerMooreHorspool::match(const string::LinearString& string, const string::LinearString& pattern) { std::set<unsigned> occ; + + measurements::start ( "Preprocess", measurements::Type::PREPROCESS ); std::map<alphabet::Symbol, size_t> bcs = BadCharacterShiftTable::bcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern + measurements::end ( ); + measurements::start ( "Algorithm", measurements::Type::ALGORITHM ); size_t haystack_offset = 0; while(haystack_offset + pattern.getContent().size() <= string.getContent().size()) { size_t i = pattern.getContent().size(); @@ -39,6 +44,8 @@ std::set<unsigned> BoyerMooreHorspool::match(const string::LinearString& string, haystack_offset += bcs[string.getContent()[haystack_offset + pattern.getContent().size() - 1]]; //std::cout << haystack_offset << std::endl; } + measurements::end ( ); + return occ; }