X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_sequence%2Fwt_node_leaf.cpp;h=02bc9cc313ab04027ce76f1212a49d2572d0992f;hb=a01a06472c8dcf1c58a8d87e6b93eb709b921d0e;hp=d99ea62291defad0d1a8bc0b3e909bf217ca711e;hpb=eea9c5c03f004e3facd74f004ded0e3801e72ab2;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 d99ea62..02bc9cc 100644 --- a/libcds/src/static_sequence/wt_node_leaf.cpp +++ b/libcds/src/static_sequence/wt_node_leaf.cpp @@ -36,6 +36,23 @@ uint wt_node_leaf::rank(uint symbol, uint pos, uint l, wt_coder * c) { return pos; } +uint wt_node_leaf::rankLessThan(uint &symbol, uint pos, uint l, wt_coder * c) { +// std::cout <<"this-symbol: " << (uchar)this->symbol << ", symbol = " << (uchar)symbol << ", pos = " << pos << std::endl; + if(symbol > this->symbol) return -1; + symbol = this->symbol; + pos++; + return pos; +} + +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) + return -1; + symbol = this->symbol; + pos++; + return pos; +} + uint wt_node_leaf::select(uint symbol, uint pos, uint l, wt_coder * c) { if(symbol!=this->symbol) return (uint)-1; if(pos==0 || pos>count) return (uint)-1; @@ -43,6 +60,8 @@ uint wt_node_leaf::select(uint symbol, uint pos, uint l, wt_coder * c) { } uint wt_node_leaf::access(uint pos) { +// std::cout <<"this-symbol: " << (uchar)this->symbol << ", pos = " << pos << std::endl; + return symbol; }