projects
/
SXSI
/
XMLTree.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
final
[SXSI/XMLTree.git]
/
libcds
/
src
/
static_bitsequence
/
sdarray.cpp
diff --git
a/libcds/src/static_bitsequence/sdarray.cpp
b/libcds/src/static_bitsequence/sdarray.cpp
index
28758d3
..
949726a
100644
(file)
--- a/
libcds/src/static_bitsequence/sdarray.cpp
+++ b/
libcds/src/static_bitsequence/sdarray.cpp
@@
-649,9
+649,9
@@
int selects3_construct(selects3 *select, int n, uint *buf) {
return 0;
}
return 0;
}
-selects3 * lasts3=NULL;
-int lasti=0;
-int lasts=0;
+
//
selects3 * lasts3=NULL;
+
//
int lasti=0;
+
//
int lasts=0;
int selects3_select(selects3 *select, int i) {
int d,x;
int selects3_select(selects3 *select, int i) {
int d,x;
@@
-666,22
+666,24
@@
int selects3_select(selects3 *select, int i) {
if (i == 0) return -1;
d = select->d;
if (i == 0) return -1;
d = select->d;
-
if(lasts3==select && lasti==i
) {
- while(!__getbit2(select->sd1->buf,++
lasti
));
+
/*if(select->lasti==(uint)i-1
) {
+ while(!__getbit2(select->sd1->buf,++
select->lasts
));
}
else {
}
else {
- lasts = selectd2_select(select->sd1,i,1);
+
select->
lasts = selectd2_select(select->sd1,i,1);
}
}
- lasti = i;
- lasts3 = select;
- x = (lasts-(i-1)) << d;
+ select->lasti = i;*/
+ //lasts3 = select;
+ x = selectd2_select(select->sd1,i,1) - (i-1);
+ //x = (select->lasts-(i-1)) << d;
+ x <<= d;
x += __getbits(select->low,(i-1)*d,d);
return x;
}
int selects3_selectnext(selects3 *select, int i) {
x += __getbits(select->low,(i-1)*d,d);
return x;
}
int selects3_selectnext(selects3 *select, int i) {
- return selects3_select(select,selects3_rank(select,i)+1);
+
//
return selects3_select(select,selects3_rank(select,i)+1);
int d,x,w,y;
int r,j;
int z,ii;
int d,x,w,y;
int r,j;
int z,ii;