Concordia
tm_matches.hpp
1 #ifndef TM_MATCHES_HDR
2 #define TM_MATCHES_HDR
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 #include "concordia/common/config.hpp"
8 #include "concordia/interval.hpp"
9 #include <boost/ptr_container/ptr_map.hpp>
10 
11 
19 class TmMatches {
20 public:
25  TmMatches();
26 
33  TmMatches(const SUFFIX_MARKER_TYPE exampleId,
34  const SUFFIX_MARKER_TYPE exampleSize,
35  const SUFFIX_MARKER_TYPE patternSize);
36 
39  virtual ~TmMatches();
40 
45  double getScore() const {
46  return _score;
47  }
48 
53  std::vector<Interval> getExampleIntervals() const {
54  return _exampleMatchedRegions;
55  }
56 
61  std::vector<Interval> getPatternIntervals() const {
62  return _patternMatchedRegions;
63  }
64 
69  SUFFIX_MARKER_TYPE getExampleId() const {
70  return _exampleId;
71  }
72 
80  void calculateSimpleScore();
81 
91  void calculateScore();
92 
100  void addExampleInterval(int start, int end);
101 
109  void addPatternInterval(int start, int end);
110 
111 private:
112  bool _alreadyIntersects(const std::vector<Interval> & intervalList,
113  int start, int end);
114 
115  SUFFIX_MARKER_TYPE _exampleId;
116 
117  std::vector<Interval> _exampleMatchedRegions;
118 
119  std::vector<Interval> _patternMatchedRegions;
120 
121  SUFFIX_MARKER_TYPE _patternSize;
122 
123  SUFFIX_MARKER_TYPE _exampleSize;
124 
125  double _score;
126 };
127 
128 typedef boost::ptr_map<SUFFIX_MARKER_TYPE, TmMatches> TmMatchesMap;
129 typedef TmMatchesMap::iterator TmMatchesMapIterator;
130 
131 #endif
Definition: tm_matches.hpp:19
TmMatches()
Definition: tm_matches.cpp:7
void calculateScore()
Definition: tm_matches.cpp:22
void calculateSimpleScore()
Definition: tm_matches.cpp:33
void addPatternInterval(int start, int end)
Definition: tm_matches.cpp:54
std::vector< Interval > getPatternIntervals() const
Definition: tm_matches.hpp:61
virtual ~TmMatches()
Definition: tm_matches.cpp:19
double getScore() const
Definition: tm_matches.hpp:45
void addExampleInterval(int start, int end)
Definition: tm_matches.cpp:48
SUFFIX_MARKER_TYPE getExampleId() const
Definition: tm_matches.hpp:69
std::vector< Interval > getExampleIntervals() const
Definition: tm_matches.hpp:53