#include <queue>
#include <functional>
#include <algorithm>
+#include <cstring>
#include "dynFMI.h"
#if SAMPLE!=0
delete SampledSAPositionsIndicator;
#endif
- delete handle;
- delete pos;
+// delete handle;
+// delete pos;
#if SAMPLE!=0
delete sampledSATree;
#endif
}
DynFMI::DynFMI(uchar *text, ulong x, ulong n, bool del){
+ numberOfTexts = 0;
initEmptyDynFMI(text, x, n);
if (del) delete [] text;
}
this->sampledSATree = new SampledSATree();
#endif
- this->pos = new Pos(sampleInterval);
- this->handle = new Handle();
+ //this->pos = new Pos(sampleInterval);
+ //this->handle = new Handle();
- pos->handle=this->handle;
- handle->pos=this->pos;
+ //pos->handle=this->handle;
+ //handle->pos=this->pos;
}
#endif
// size must include endmarker!
-ulong DynFMI::addText(uchar const * str, ulong n){
+void DynFMI::addText(uchar const * str, ulong n){
ulong i;
#if SAMPLE!=0
bool sample = false;
#endif
- i=pos->getSize()+1;
-
- ulong key = pos->appendText(n);
+ i = numberOfTexts + 1;
+
+ numberOfTexts ++;
// Adding an empty text (end-marker)
if (n == 1)
{
insert(str[0], i);
//if (del) delete [] str;
- return key;
+ return;
}
insert(str[n-2],i); // insert second last character, corresponds to suffix of length 1
#endif
// if (del) delete [] str;
- return key;
+// return key;
}
-ulong DynFMI::addTextFromFile(char* filename, ulong n){
+/*ulong DynFMI::addTextFromFile(char* filename, ulong n){
ulong i;
#if SAMPLE!=0
bool sample = false;
return key;
}
-
-
+*/
+/*
uchar* DynFMI::retrieveText(ulong key){
cout << "key: " << key << endl;
uchar *text=0;
text[n-1] = 0;
return text;
-}
-
+ }*/
+/*
bool DynFMI::deleteText(ulong key){
// TODO access two times, can do better
ulong i=handle->getPos(key); //=bwtEnd;
return true;
}
-
+*/
ulong DynFMI::getNumberOfSymbolsSmallerThan(uchar c){
int j = 256+c;
ulong r=0;