Closed ekg closed 9 years ago
Hi Erik,
the vector should not contain a zero (since zero is appended as sentinel at the end of the text). Here is an example:
#include <sdsl/suffix_arrays.hpp>
#include <iostream>
using namespace sdsl;
using namespace std;
int main(){
csa_wt_int<> csa;
int_vector<> text = {1,2,3,2,4,5,100,4,3};
construct_im(csa, text, 0);
cout << "csa=" << csa << endl;
cout << "text=" << csa.text << endl;
}
How does one build a compressed suffix array from an integer vector? For instance, I try:
Where
e_iv
is an integer vector composed of non-zero 64-bit integers (size_t).When I try to run this code, I get:
I can see how to build the CSA for strings, and got that to work fine, but don't see how to do this. Is the CSA implementation limitation to strings? Any documentation or example code would be greatly appreciated! What is already here is wonderful.