X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_bitsequence%2Fsdarray.cpp;h=949726a9c8bcfef9ce30125ee3e5b433808bd07b;hb=dc02a833a150dbef202bc14aca74c51360d4a631;hp=96810fe359e9a781cb41523e63ec794edd86151b;hpb=2134520212940b32a0d0e430df02e71591cc4550;p=SXSI%2FXMLTree.git diff --git a/libcds/src/static_bitsequence/sdarray.cpp b/libcds/src/static_bitsequence/sdarray.cpp index 96810fe..949726a 100644 --- a/libcds/src/static_bitsequence/sdarray.cpp +++ b/libcds/src/static_bitsequence/sdarray.cpp @@ -666,22 +666,24 @@ int selects3_select(selects3 *select, int i) { if (i == 0) return -1; d = select->d; - if(select->lasti==(uint)i-1) { + /*if(select->lasti==(uint)i-1) { while(!__getbit2(select->sd1->buf,++select->lasts)); } else { select->lasts = selectd2_select(select->sd1,i,1); } - select->lasti = i; + select->lasti = i;*/ //lasts3 = select; - x = (select->lasts-(i-1)) << d; + 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) { - 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;