2 * Interface for alignment queries
8 #include "TextCollection.h"
18 * Base class for queries
23 TextCollection::document_result align(uchar const *p, unsigned k);
32 virtual void firstStep() = 0;
34 inline bool pushChar(char c) {
35 ulong nmin = tc->LF(c, smin.top()-1);
36 ulong nmax = tc->LF(c, smax.top())-1;
37 if (nmin > nmax) return false;
44 inline void popChar() {
50 inline int min(int a, int b) {
51 if (a < b) return a; else return b;
54 inline int min(int a, int b, int c) {
55 if (a < b) if (a < c) return a; else return c;
56 else if (b < c) return b; else return c;
59 Query(TextCollection const *tc_);
63 TextCollection const *tc;
69 static const unsigned ALPHABET_SIZE = 5;
70 static const char ALPHABET_DNA[];
72 std::stack<ulong> smin;
73 std::stack<ulong> smax;
74 std::vector<uchar> match;
75 std::set<TextCollection::DocId> result;
79 // No copy constructor or assignment
81 Query& operator = (Query const&);