X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_sequence%2Fstatic_sequence.cpp;h=bd86382ad6cfb07de5a244a1dd89c74c41c51766;hb=e38bc834442d5369a523ba47d74865e48995ace4;hp=05b77538d6a3511b7fff21ff7d75827ad91f2dba;hpb=6a9117a97674437c9fe00b099c40ccb61d45d704;p=SXSI%2FXMLTree.git diff --git a/libcds/src/static_sequence/static_sequence.cpp b/libcds/src/static_sequence/static_sequence.cpp index 05b7753..bd86382 100644 --- a/libcds/src/static_sequence/static_sequence.cpp +++ b/libcds/src/static_sequence/static_sequence.cpp @@ -20,6 +20,12 @@ */ #include +using std::max; +using std::min; +using std::cout; +using std::cin; +using std::endl; + static_sequence::static_sequence() {} static_sequence::~static_sequence() {} @@ -38,10 +44,15 @@ static_sequence * static_sequence::load(FILE * fp) { case GMR_CHUNK_HDR: return static_sequence_gmr_chunk::load(fp); case GMR_HDR: return static_sequence_gmr::load(fp); case WVTREE_NOPTRS_HDR: return static_sequence_wvtree_noptrs::load(fp); + case BS_HDR: return static_sequence_bs::load(fp); } return NULL; } +uint static_sequence::select_next(uint c, uint i) { + return select(c,rank(c,i)+1); +} + bool static_sequence::test(uint * seq, uint n) { uint sigma = 0; for(uint i=0;i