final
authorfclaude <fclaude@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Sun, 26 Apr 2009 06:16:45 +0000 (06:16 +0000)
committerfclaude <fclaude@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Sun, 26 Apr 2009 06:16:45 +0000 (06:16 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@352 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

libcds/src/static_bitsequence/sdarray.cpp
libcds/src/static_bitsequence/sdarray.h
libcds/src/static_bitsequence/static_bitsequence_sdarray.cpp

index 96810fe..949726a 100644 (file)
@@ -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;
index 73641a1..fe01200 100644 (file)
@@ -26,7 +26,7 @@ typedef struct {
   uint *low;
   selectd2 *sd0,*sd1;
        uint hi_len, low_len;
-       uint lasti, lasts;
+       //uint lasti, lasts;
 } selects3;
 
 int selects3_construct(selects3 *select, int n, uint *buf);
index 33c1059..8ce9164 100644 (file)
@@ -14,7 +14,7 @@ static_bitsequence_sdarray::static_bitsequence_sdarray(uint * buff, uint len) {
   if(ones)
     selects3_construct(&sd,len,tmp_seq);
   this->len = len;
-       sd.lasti=(uint)-3;
+       //sd.lasti=(uint)-3;
   //this->ones = sd.m;
   delete [] tmp_seq;
 }