#ifndef ANUBIS_SEARCHER_HDR #define ANUBIS_SEARCHER_HDR #include #include "concordia/common/config.hpp" #include "concordia/common/utils.hpp" #include "concordia/substring_occurence.hpp" #include "concordia/concordia_exception.hpp" #include "concordia/concordia_config.hpp" #include "concordia/anubis_search_result.hpp" #include "concordia/tm_matches.hpp" #include #include /*! Class for searching using Anubis algorithm. */ class AnubisSearcher { public: explicit AnubisSearcher(); /*! Destructor. */ virtual ~AnubisSearcher(); std::vector anubisSearch( boost::shared_ptr config, boost::shared_ptr > T, boost::shared_ptr > markers, boost::shared_ptr > SA, const std::vector & pattern) throw(ConcordiaException); boost::shared_ptr getTmMatches( boost::shared_ptr > T, boost::shared_ptr > markers, boost::shared_ptr > SA, const std::vector & pattern) throw(ConcordiaException); std::vector lcpSearch( boost::shared_ptr > T, boost::shared_ptr > markers, boost::shared_ptr > SA, const std::vector & pattern, SUFFIX_MARKER_TYPE & length) throw(ConcordiaException); private: void _collectResults(std::vector & result, boost::shared_ptr > markers, boost::shared_ptr > SA, saidx_t left, saidx_t size); void _addToMap(boost::shared_ptr > SA, boost::shared_ptr > markers, boost::shared_ptr tmMatchesMap, saidx_t sa_pos, SUFFIX_MARKER_TYPE totalPatternLength, SUFFIX_MARKER_TYPE matchedFragmentLength, SUFFIX_MARKER_TYPE patternOffset); bool _getOccurenceFromSA(boost::shared_ptr > SA, boost::shared_ptr > markers, saidx_t sa_pos, SubstringOccurence & occurence); void _addOccurenceToMap(boost::shared_ptr tmMatchesMap, SubstringOccurence & occurence, SUFFIX_MARKER_TYPE totalPatternLength, SUFFIX_MARKER_TYPE matchedFragmentLength, SUFFIX_MARKER_TYPE patternOffset); }; #endif