oss_src/sframe/sarray_v2_type_encoding.cpp
void decode_double(iarchive& iarc,
                   std::vector<flexible_type>& ret,
                   size_t num_undefined) {
  // we reserve one character so we can add new encoders as needed in the future
  char reserved = 0;
  iarc.read(&(reserved), sizeof(reserved));
  ASSERT_LT(reserved, 3);
  if (reserved == DOUBLE_RESERVED_FLAGS::LEGACY_ENCODING) {
    decode_double_legacy(iarc, ret, num_undefined);
    return;
  } else if (reserved == DOUBLE_RESERVED_FLAGS::INTEGER_ENCODING) {
    for (auto& i : ret) {
      if (i.get_type() == flex_type_enum::FLOAT) i.reset(flex_type_enum::INTEGER);
    }
    decode_number(iarc, ret, num_undefined);
    for (auto& i : ret) {
      if (i.get_type() == flex_type_enum::INTEGER) {
        i = (flex_float)(i.get<flex_int>());
      }
    }
    return;
  } 
}
/**
 * Decodes a collection of doubles into 'data'. Entries in data which are 
 * of type flex_type_enum::UNDEFINED will be skipped, and there must be exactly
 * num_undefined number of them. 
 *
 *
 * This is the 2nd generation floating point encoder. its use is flagged by
 * turning on the block flag BLOCK_ENCODING_EXTENSION. 
 * The format is basically: 
 * - one byte: encoding format. LEGACY, or INTEGER.
 * If LEGACY:
 *   The old encoder is used
 * If INTEGER:
 *   The floating point values are encoded as integers.
 */
Decodes a collection of doubles into 'data'. Entries in data which are
of type flex_type_enum::UNDEFINED will be skipped, and there must be exactly
num_undefined number of them.

This is the 2nd generation floating point encoder. its use is flagged by
turning on the block flag BLOCK_ENCODING_EXTENSION.
The format is basically:
- one byte: encoding format. LEGACY, or INTEGER.
If LEGACY:
The old encoder is used
If INTEGER:
The floating point values are encoded as integers.
Decodes a collection of doubles into ' data ' . Entries in data which are of type flex_type_enum :: UNDEFINED will be skipped and there must be exactly num_undefined number of them . This is the 2nd generation floating point encoder . its use is flagged by turning on the block flag BLOCK_ENCODING_EXTENSION . The format is basically : - one byte : encoding format . LEGACY or INTEGER . If LEGACY : The old encoder is used If INTEGER : The floating point values are encoded as integers .
void decode_double(iarchive& iarc,
                   std::vector<flexible_type>& ret,
                   size_t num_undefined) {
  char reserved = 0;
  iarc.read(&(reserved), sizeof(reserved));
  ASSERT_LT(reserved, 3);
  if (reserved == DOUBLE_RESERVED_FLAGS::LEGACY_ENCODING) {
    decode_double_legacy(iarc, ret, num_undefined);
    return;
  } else if (reserved == DOUBLE_RESERVED_FLAGS::INTEGER_ENCODING) {
    for (auto& i : ret) {
      if (i.get_type() == flex_type_enum::FLOAT) i.reset(flex_type_enum::INTEGER);
    }
    decode_number(iarc, ret, num_undefined);
    for (auto& i : ret) {
      if (i.get_type() == flex_type_enum::INTEGER) {
        i = (flex_float)(i.get<flex_int>());
      }
    }
    return;
  } 
}
void decode_double ( iarchive & iarc , std :: vector < flexible_type > & ret , size_t num_undefined ) { char reserved = 0 ; iarc . read ( & ( reserved ) , sizeof ( reserved ) ) ; ASSERT_LT ( reserved , 3 ) ; if ( reserved == DOUBLE_RESERVED_FLAGS :: LEGACY_ENCODING ) { decode_double_legacy ( iarc , ret , num_undefined ) ; return ; } else if ( reserved == DOUBLE_RESERVED_FLAGS :: INTEGER_ENCODING ) { for ( auto & i : ret ) { if ( i . get_type ( ) == flex_type_enum :: FLOAT ) i . reset ( flex_type_enum :: INTEGER ) ; } decode_number ( iarc , ret , num_undefined ) ; for ( auto & i : ret ) { if ( i . get_type ( ) == flex_type_enum :: INTEGER ) { i = ( flex_float ) ( i . get < flex_int > ( ) ) ; } } return ; } }
Decodes a collection of doubles into 'data'.
Decodes a collection of doubles into ' data ' .
// we reserve one character so we can add new encoders as needed in the future