X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=libcds%2Fsrc%2Fstatic_bitsequence%2Fstatic_bitsequence_rrr02_light.cpp;h=793b7af1fd1849e3dbea2c51edf2d01647edc0d0;hb=e38bc834442d5369a523ba47d74865e48995ace4;hp=746f5cf69e1f0bdd69f7420ab2a74de6c05e1d9b;hpb=52cb7bbcda67f4676335cdd4eb96d4d87ad1445d;p=SXSI%2FXMLTree.git diff --git a/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.cpp b/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.cpp index 746f5cf..793b7af 100644 --- a/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.cpp +++ b/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.cpp @@ -20,7 +20,8 @@ */ #include - +using std::min; +using std::max; #define VARS_NEEDED uint C_len = len/BLOCK_SIZE_LIGHT + (len%BLOCK_SIZE_LIGHT!=0);\ uint C_field_bits = bits(BLOCK_SIZE_LIGHT);\ uint O_len = uint_len(1,O_bits_len);\ @@ -119,13 +120,11 @@ void static_bitsequence_rrr02_light::create_sampling(uint sample_rate) { } bool static_bitsequence_rrr02_light::access(uint i) { - uint C_len = len/BLOCK_SIZE_LIGHT + (len%BLOCK_SIZE_LIGHT!=0); uint C_field_bits = bits(BLOCK_SIZE_LIGHT); uint O_pos_field_bits = bits(O_bits_len); uint nearest_sampled_value = i/BLOCK_SIZE_LIGHT/sample_rate; uint pos_O = get_field(O_pos,O_pos_field_bits,nearest_sampled_value); uint pos = i/BLOCK_SIZE_LIGHT; - assert(pos<=C_len); for(uint k=nearest_sampled_value*sample_rate;kget_log2binomial(BLOCK_SIZE_LIGHT,aux);