concordia-library/concordia/tm_matches.hpp
rjawor 655087582e anubis search stub
Former-commit-id: 41cf0c8811767219f6f58bc06d9729d724269e73
2014-03-11 14:32:10 +01:00

61 lines
1.2 KiB
C++

#ifndef TM_MATCHES_HDR
#define TM_MATCHES_HDR
#include <string>
#include "concordia/common/config.hpp"
#include "concordia/interval.hpp"
#include <boost/ptr_container/ptr_vector.hpp>
/*!
Class used within Anubis search algorithm to store partial results.
*/
using namespace std;
class TmMatches {
public:
explicit TmMatches(const SUFFIX_MARKER_TYPE exampleId,
const unsigned char exampleSize,
const unsigned char patternSize);
/*! Destructor.
*/
virtual ~TmMatches();
double getScore() const {
return _score;
}
SUFFIX_MARKER_TYPE getExampleId() const {
return _exampleId;
}
void calculateSimpleScore();
void calculateScore();
void addExampleInterval(int start, int end);
void addPatternInterval(int start, int end);
private:
bool _alreadyIntersects(boost::ptr_vector<Interval> intervalList,
int start, int end);
SUFFIX_MARKER_TYPE _exampleId;
boost::ptr_vector<Interval> _exampleMatchedRegions;
boost::ptr_vector<Interval> _patternMatchedRegions;
unsigned char _patternSize;
unsigned char _exampleSize;
double _score;
};
#endif