X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_bitsequence%2Fsdarray.cpp;h=f904aa3c89dc79d060b004f7a4a91dabfeb11205;hb=41eabb2b95bf53567098821e6f91a8d40eea4a39;hp=2b08dc311b067769733c2fd1ff99c3392050ad4c;hpb=06201fcce6255906ad6b4d305b8e643c634780a3;p=SXSI%2FXMLTree.git diff --git a/libcds/src/static_bitsequence/sdarray.cpp b/libcds/src/static_bitsequence/sdarray.cpp index 2b08dc3..f904aa3 100644 --- a/libcds/src/static_bitsequence/sdarray.cpp +++ b/libcds/src/static_bitsequence/sdarray.cpp @@ -139,7 +139,7 @@ uint __getbits(uint *B, int i, int d) { } #endif -static const unsigned int __popCount[] = { +static const unsigned int _popCount[] = { 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4, 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, @@ -194,13 +194,13 @@ unsigned int __popCount(uint x) { //r = ((r & 0xffff0000)>>16) + (r & 0x0000ffff); r = ((r>>16) + r) & 63; #else - r = __popCount[x & 0xff]; + r = _popCount[x & 0xff]; x >>= 8; - r += __popCount[x & 0xff]; + r += _popCount[x & 0xff]; x >>= 8; - r += __popCount[x & 0xff]; + r += _popCount[x & 0xff]; x >>= 8; - r += __popCount[x & 0xff]; + r += _popCount[x & 0xff]; #endif return r; } @@ -214,7 +214,7 @@ unsigned int __popCount8(uint x) { r = ((r & 0xcc)>>2) + (r & 0x33); r = ((r>>4) + r) & 0x0f; #else - r = __popCount[x & 0xff]; + r = _popCount[x & 0xff]; #endif return r; } @@ -387,11 +387,11 @@ int selectd2_select(selectd2 *select, int i,int f) { if (f == 1) { rr = p & (8-1); - r -= __popCount[*q >> (8-1-rr)]; + r -= _popCount[*q >> (8-1-rr)]; //p = p - rr; while (1) { - rr = __popCount[*q]; + rr = _popCount[*q]; if (r + rr >= i) break; r += rr; //p += 8; @@ -402,11 +402,11 @@ int selectd2_select(selectd2 *select, int i,int f) { } else { rr = p & (8-1); - r -= __popCount[(*q ^ 0xff) >> (8-1-rr)]; + r -= _popCount[(*q ^ 0xff) >> (8-1-rr)]; //p = p - rr; while (1) { - rr = __popCount[*q ^ 0xff]; + rr = _popCount[*q ^ 0xff]; if (r + rr >= i) break; r += rr; //p += 8; @@ -463,11 +463,11 @@ int selectd2_select2(selectd2 *select, int i,int f, int *st, int *en) { if (f == 1) { rr = p & (8-1); - r -= __popCount[*q >> (8-1-rr)]; + r -= _popCount[*q >> (8-1-rr)]; //p = p - rr; while (1) { - rr = __popCount[*q]; + rr = _popCount[*q]; if (r + rr >= i) break; r += rr; //p += 8; @@ -479,7 +479,7 @@ int selectd2_select2(selectd2 *select, int i,int f, int *st, int *en) { if ((i>>logL) == ((i+1)>>logL)) { i++; while (1) { - rr = __popCount[*q]; + rr = _popCount[*q]; if (r + rr >= i) break; r += rr; q++; @@ -494,11 +494,11 @@ int selectd2_select2(selectd2 *select, int i,int f, int *st, int *en) { } else { rr = p & (8-1); - r -= __popCount[(*q ^ 0xff) >> (8-1-rr)]; + r -= _popCount[(*q ^ 0xff) >> (8-1-rr)]; //p = p - rr; while (1) { - rr = __popCount[*q ^ 0xff]; + rr = _popCount[*q ^ 0xff]; if (r + rr >= i) break; r += rr; //p += 8; @@ -510,7 +510,7 @@ int selectd2_select2(selectd2 *select, int i,int f, int *st, int *en) { if ((i>>logL) == ((i+1)>>logL)) { i++; while (1) { - rr = __popCount[*q ^ 0xff]; + rr = _popCount[*q ^ 0xff]; if (r + rr >= i) break; r += rr; q++;