X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_sequence%2Fstatic_sequence_wvtree.cpp;h=ceeb7329ca4997e8004f701f0d1a2151a13bb867;hb=69d191f9549b65e692b38bfceecc86fbcde474ad;hp=ef504bdbfaa971cf3e78210601f42c62edd27298;hpb=816fe5fd2e5c2ef306227c6870a45b026b923f2e;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 ef504bd..ceeb732 100644 --- a/libcds/src/static_sequence/static_sequence_wvtree.cpp +++ b/libcds/src/static_sequence/static_sequence_wvtree.cpp @@ -40,7 +40,12 @@ static_sequence_wvtree::static_sequence_wvtree(uchar * symbols, uint n, wt_coder am->use(); this->c=c; c->use(); - root = new wt_node_internal(symbols, n, 0, c, bmb); + uint *done = new uint[n/W+1]; + for (uint i = 0; i < n/W+1; i++) + done[i] = 0; + root = new wt_node_internal(symbols, n, 0, c, bmb, 0, done); + delete [] done; + delete [] symbols; symbols = 0; // Already deleted! // for(uint i=0;iunmap((uint)symbols[i]); @@ -60,7 +65,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; +// std::cout << "lessthan..." << std::endl; uint r = root->rankLessThan(s, pos, 0, c); symbol = am->unmap(s); return r; @@ -93,7 +98,7 @@ vector static_sequence_wvtree::access(uint i, uint j, uint min, uint max) vector static_sequence_wvtree::accessAll(uint i, uint j) { vector resultSet; - if (j > i) + if (j < i) return resultSet; resultSet.reserve(j-i+1);