source/BitVector.h
/// Retrive the 32-bit uint at the specified BIT index.
Retrive the 32-bit uint at the specified BIT index.
Retrive the 32 - bit uint at the specified BIT index .
uint32_t GetUIntAtBit(size_t index) {
      const size_t field_id = FieldID(index);
      const size_t pos_id = FieldPos(index);
      if (pos_id == 0) return (uint32_t) bit_set[field_id];
      const size_t NUM_FIELDS = NumFields();
      const uint32_t part1 = (uint32_t) (bit_set[field_id] >> pos_id);
      const uint32_t part2 =
        (uint32_t)((field_id+1 < NUM_FIELDS) ? bit_set[field_id+1] << (FIELD_BITS-pos_id) : 0);
      return part1 | part2;
    }
uint32_t GetUIntAtBit ( size_t index ) { const size_t field_id = FieldID ( index ) ; const size_t pos_id = FieldPos ( index ) ; if ( pos_id == 0 ) return ( uint32_t ) bit_set [ field_id ] ; const size_t NUM_FIELDS = NumFields ( ) ; const uint32_t part1 = ( uint32_t ) ( bit_set [ field_id ] >> pos_id ) ; const uint32_t part2 = ( uint32_t ) ( ( field_id + 1 < NUM_FIELDS ) ? bit_set [ field_id + 1 ] << ( FIELD_BITS - pos_id ) : 0 ) ; return part1 | part2 ; }
Retrive the 32-bit uint at the specified BIT index.
Retrive the 32 - bit uint at the specified BIT index .
// @CAO Need proper assert for non-32-size bit fields! // assert(index < num_bits);