00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef INCLUDED_MatchStoreGapped
00032 #define INCLUDED_MatchStoreGapped
00033
00034
00035
00036
00037
00038 #include "QueryManager.h"
00039 #include "GlobalDefinitions.h"
00040 #include "HashTableGeneric.h"
00041 #include "MatchStore.h"
00042 #include <vector>
00043 #include <string>
00044 #include <utility>
00045 #include <map>
00046 #include <iosfwd>
00047
00048
00049
00050
00051
00052
00053
00054
00055 class HitListVector;
00056 class MatchAlgorithm
00057 {
00058 public:
00059 MatchAlgorithm( int numRepeats ) :
00060 numRepeats_( numRepeats ), sortNeeded_(true) {}
00061 void operator()
00062 ( WordSequence& querySeq,
00063 MatchAdder& addMatch,
00064 HashTableGeneric& subjectTable,
00065 int wordLength = -1,
00066 int stepLength = -1);
00067 void generateHits( WordSequence& querySeq, HitListVector& hitList,
00068 HashTableGeneric& subjectTable );
00069 virtual void generateMatches
00070 ( HitListVector& hitList, MatchAdder& addMatch )=0;
00071
00072 protected:
00073 bool sortNeeded_;
00074 int numRepeats_;
00075 int wordLength_;
00076 int stepLength_;
00077 };
00078
00079
00080 class MatchAlgorithmGapped : public MatchAlgorithm
00081 {
00082 public:
00083 MatchAlgorithmGapped
00084 ( int maxGap, int maxInsert, int minToProcess, int numRepeats ):
00085 maxGap_( maxGap ),
00086 maxInsert_( maxInsert ),
00087 minToProcess_( minToProcess ),
00088 MatchAlgorithm( numRepeats )
00089 {}
00090
00091 virtual void generateMatches
00092 ( HitListVector& hitList, MatchAdder& addMatch );
00093
00094 void findMatchesInRange
00095 ( HitListVector::iterator first, HitListVector::iterator last,
00096 MatchAdder& addMatch );
00097
00098
00099 private:
00100 int maxGap_;
00101 int maxInsert_;
00102 int minToProcess_;
00103 int maxQueryDiff_;
00104 int minHitsForMatch_;
00105
00106
00107
00108
00109
00110 };
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 #endif
00124
00125
00126
00127
00128
00129