X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_sequence%2Fstatic_sequence_wvtree.cpp;h=ca935948030ec3e3deb5f8c103f5e9de9915484b;hb=e38bc834442d5369a523ba47d74865e48995ace4;hp=ceeb7329ca4997e8004f701f0d1a2151a13bb867;hpb=69d191f9549b65e692b38bfceecc86fbcde474ad;p=SXSI%2FXMLTree.git diff --git a/libcds/src/static_sequence/static_sequence_wvtree.cpp b/libcds/src/static_sequence/static_sequence_wvtree.cpp index ceeb732..ca93594 100644 --- a/libcds/src/static_sequence/static_sequence_wvtree.cpp +++ b/libcds/src/static_sequence/static_sequence_wvtree.cpp @@ -22,6 +22,7 @@ #include static_sequence_wvtree::static_sequence_wvtree(uint * symbols, uint n, wt_coder * c, static_bitsequence_builder * bmb, alphabet_mapper * am) { + this->n = n; for(uint i=0;imap(symbols[i]); this->am = am; @@ -34,6 +35,7 @@ static_sequence_wvtree::static_sequence_wvtree(uint * symbols, uint n, wt_coder } static_sequence_wvtree::static_sequence_wvtree(uchar * symbols, uint n, wt_coder * c, static_bitsequence_builder * bmb, alphabet_mapper * am) { + this->n = n; for(uint i=0;imap((uint)symbols[i]); this->am = am; @@ -66,7 +68,7 @@ uint static_sequence_wvtree::rank(uint symbol, uint pos) { uint static_sequence_wvtree::rankLessThan(uint &symbol, uint pos) { uint s = am->map(symbol); // std::cout << "lessthan..." << std::endl; - uint r = root->rankLessThan(s, pos, 0, c); + uint r = root->rankLessThan(s, pos); symbol = am->unmap(s); return r; } @@ -101,7 +103,7 @@ vector static_sequence_wvtree::accessAll(uint i, uint j) if (j < i) return resultSet; - resultSet.reserve(j-i+1); + // resultSet.reserve(j-i+1); // avoid reallocation root->access(resultSet, i, j); for (vector::iterator it = resultSet.begin(); it != resultSet.end(); ++it) *it = am->unmap(*it);