From a09999c130b65e9b784025d854fdb816dbddabba Mon Sep 17 00:00:00 2001 From: rjawor Date: Wed, 15 Apr 2015 11:50:59 +0200 Subject: [PATCH] repaired tm matches Former-commit-id: ee2e73ab1e37db051b8be36b97bc503241c798c0 --- TODO.txt | 8 ++++---- concordia/tm_matches.cpp | 17 ++++++++++------- concordia/tm_matches.hpp | 15 +++++++++------ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/TODO.txt b/TODO.txt index c0c2581..f8054c0 100644 --- a/TODO.txt +++ b/TODO.txt @@ -19,10 +19,10 @@ IN PROGRESS 2. Wykonać anubis search na nowych markerach z długością zdania zastanowić się nad optymalizacją: -- tmMatchesMap jako normalna mapa (nie ptr_map) -- REJECTED LCP array -- !important! rezygnacja z ptr_vector -- zwracanie wektorów +REJECTED - tmMatchesMap jako normalna mapa (nie ptr_map) +REJECTED - LCP array +DONE - !important! rezygnacja z ptr_vector +DONE - zwracanie wektorów - powyrzucać using namespace std - profiling diff --git a/concordia/tm_matches.cpp b/concordia/tm_matches.cpp index 35e79a6..0e0465b 100644 --- a/concordia/tm_matches.cpp +++ b/concordia/tm_matches.cpp @@ -2,13 +2,16 @@ #include #include +TmMatches::TmMatches() { +} + TmMatches::TmMatches(const SUFFIX_MARKER_TYPE exampleId, - const unsigned char exampleSize, - const unsigned char patternSize): - _exampleId(exampleId), - _exampleSize(exampleSize), - _patternSize(patternSize), - _score(0) { + const SUFFIX_MARKER_TYPE exampleSize, + const SUFFIX_MARKER_TYPE patternSize): + _exampleId(exampleId), + _exampleSize(exampleSize), + _patternSize(patternSize), + _score(0) { } TmMatches::~TmMatches() { @@ -64,7 +67,7 @@ bool TmMatches::_alreadyIntersects( double TmMatches::_getLogarithmicOverlay( const vector & intervalList, - unsigned char sentenceSize, + SUFFIX_MARKER_TYPE sentenceSize, double k) { double overlayScore = 0; BOOST_FOREACH(Interval interval, intervalList) { diff --git a/concordia/tm_matches.hpp b/concordia/tm_matches.hpp index ba660af..116d321 100644 --- a/concordia/tm_matches.hpp +++ b/concordia/tm_matches.hpp @@ -3,6 +3,7 @@ #include #include +#include #include "concordia/common/config.hpp" #include "concordia/interval.hpp" #include @@ -17,9 +18,11 @@ using namespace std; class TmMatches { public: - explicit TmMatches(const SUFFIX_MARKER_TYPE exampleId, - const unsigned char exampleSize, - const unsigned char patternSize); + TmMatches(); + + TmMatches(const SUFFIX_MARKER_TYPE exampleId, + const SUFFIX_MARKER_TYPE exampleSize, + const SUFFIX_MARKER_TYPE patternSize); /*! Destructor. */ @@ -54,7 +57,7 @@ private: int start, int end); double _getLogarithmicOverlay(const vector & intervalList, - unsigned char sentenceSize, + SUFFIX_MARKER_TYPE sentenceSize, double k); SUFFIX_MARKER_TYPE _exampleId; @@ -63,9 +66,9 @@ private: vector _patternMatchedRegions; - unsigned char _patternSize; + SUFFIX_MARKER_TYPE _patternSize; - unsigned char _exampleSize; + SUFFIX_MARKER_TYPE _exampleSize; double _score; };