Add nextNodeBefore primitive.
[SXSI/XMLTree.git] / libcds / src / static_bitsequence / static_bitsequence_rrr02_light.cpp
index 746f5cf..793b7af 100644 (file)
@@ -20,7 +20,8 @@
  */
 
 #include <static_bitsequence_rrr02_light.h>
-
+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;k<pos;k++) {
     uint aux = get_field(C,C_field_bits,k);
     pos_O += E->get_log2binomial(BLOCK_SIZE_LIGHT,aux);