X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_sequence%2Fwt_node_leaf.cpp;h=43ca7ca0d78e926aa5ef18932bb139adc8d33b38;hb=816fe5fd2e5c2ef306227c6870a45b026b923f2e;hp=02bc9cc313ab04027ce76f1212a49d2572d0992f;hpb=a01a06472c8dcf1c58a8d87e6b93eb709b921d0e;p=SXSI%2FXMLTree.git diff --git a/libcds/src/static_sequence/wt_node_leaf.cpp b/libcds/src/static_sequence/wt_node_leaf.cpp index 02bc9cc..43ca7ca 100644 --- a/libcds/src/static_sequence/wt_node_leaf.cpp +++ b/libcds/src/static_sequence/wt_node_leaf.cpp @@ -46,7 +46,7 @@ uint wt_node_leaf::rankLessThan(uint &symbol, uint pos, uint l, wt_coder * c) { uint wt_node_leaf::rankLessThan(uint &symbol, uint pos) { // std::cout <<"this-symbol: " << (uchar)this->symbol << ", symbol = " << (uchar)symbol << ", pos = " << pos << std::endl; - if (pos == -1) + if (pos == (uint)-1) return -1; symbol = this->symbol; pos++; @@ -65,6 +65,31 @@ uint wt_node_leaf::access(uint pos) { return symbol; } +void wt_node_leaf::access(vector &result, uint i, uint j, uint min, uint max, uint l, uint pivot) +{ +// std::cout << "At l = " << l << ", [" << i << ", " << j << "], [" << min << ", " << max << "], symbol = " << symbol << std::endl; + + if (i <= j && symbol >= min && symbol <= max) + result.push_back((int)symbol); +} + +void wt_node_leaf::access(vector &result, uint i, uint j) +{ +// std::cout << "At l = " << l << ", [" << i << ", " << j << "], [" << min << ", " << max << "], symbol = " << symbol << std::endl; + + if (i <= j) + result.push_back((int)symbol); +} + +uint wt_node_leaf::access(uint i, uint j, uint min, uint max, uint l, uint pivot) +{ +// std::cout << "At l = " << l << ", [" << i << ", " << j << "], [" << min << ", " << max << "], symbol = " << symbol << std::endl; + + if (i <= j && symbol >= min && symbol <= max) + return 1; + return 0; +} + uint wt_node_leaf::size() { return sizeof(wt_node_leaf); }