projects
/
SXSI
/
XMLTree.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New rank/select data structure based on sadakane's code
[SXSI/XMLTree.git]
/
libcds
/
src
/
static_sequence
/
static_sequence_wvtree.cpp
diff --git
a/libcds/src/static_sequence/static_sequence_wvtree.cpp
b/libcds/src/static_sequence/static_sequence_wvtree.cpp
index
e86da89
..
baabf02
100644
(file)
--- a/
libcds/src/static_sequence/static_sequence_wvtree.cpp
+++ b/
libcds/src/static_sequence/static_sequence_wvtree.cpp
@@
-58,6
+58,15
@@
uint static_sequence_wvtree::rank(uint symbol, uint pos) {
return root->rank(am->map(symbol), pos, 0, c);
}
return root->rank(am->map(symbol), pos, 0, c);
}
+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);
+ symbol = am->unmap(s);
+ return r;
+}
+
+
uint static_sequence_wvtree::count(uint s) {
return root->rank(am->map(s), len-1, 0, c);
}
uint static_sequence_wvtree::count(uint s) {
return root->rank(am->map(s), len-1, 0, c);
}