oss_src/sframe/sarray_v2_type_encoding.cpp
void decode_number(iarchive& iarc,
                   std::vector<flexible_type>& ret,
                   size_t num_undefined) {
  uint64_t buf[MAX_INTEGERS_PER_BLOCK];
  size_t bufstart = 0;
  size_t buflen = 0;
  size_t num_values_to_read = ret.size() - num_undefined;
  for (size_t i = 0;i < ret.size(); ++i) {
    if (ret[i].get_type() != flex_type_enum::UNDEFINED) {
      if (bufstart < buflen) {
        ret[i].mutable_get<flex_int>() = buf[bufstart];
        ++bufstart;
        --num_values_to_read;
      } else {
        buflen = std::min<size_t>(num_values_to_read, MAX_INTEGERS_PER_BLOCK);
        // decode a new block of 128 integers
        frame_of_reference_decode_128(iarc, buflen, buf);
//         logstream(LOG_INFO) << "Decoding ";
//         for (size_t i = 0;i < buflen; ++i) {
//           logstream(LOG_INFO) << " " << buf[i];
//         }
//         logstream(LOG_INFO) << std::endl;
        bufstart = 0;
        ret[i].mutable_get<flex_int>() = buf[bufstart];
        ++bufstart;
        --num_values_to_read;
      }
    }
  }
}
/**
 * Decodes a collection of numbers 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. It simply decodes a block using
 * frame_of_reference_decode_128() and fills in data with it.
 *
 * \note We have an explicit implementation here that is equivalent to 
 * decode_number_stream for performance reasons since this is a *very* commonly
 * encountered function.
 */
Decodes a collection of numbers 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. It simply decodes a block using
frame_of_reference_decode_128() and fills in data with it.

\note We have an explicit implementation here that is equivalent to
decode_number_stream for performance reasons since this is a *very* commonly
encountered function.
Decodes a collection of numbers 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 . It simply decodes a block using frame_of_reference_decode_128 () and fills in data with it . \ note We have an explicit implementation here that is equivalent to decode_number_stream for performance reasons since this is a * very * commonly encountered function .
void decode_number(iarchive& iarc,
                   std::vector<flexible_type>& ret,
                   size_t num_undefined) {
  uint64_t buf[MAX_INTEGERS_PER_BLOCK];
  size_t bufstart = 0;
  size_t buflen = 0;
  size_t num_values_to_read = ret.size() - num_undefined;
  for (size_t i = 0;i < ret.size(); ++i) {
    if (ret[i].get_type() != flex_type_enum::UNDEFINED) {
      if (bufstart < buflen) {
        ret[i].mutable_get<flex_int>() = buf[bufstart];
        ++bufstart;
        --num_values_to_read;
      } else {
        buflen = std::min<size_t>(num_values_to_read, MAX_INTEGERS_PER_BLOCK);
        frame_of_reference_decode_128(iarc, buflen, buf);
        bufstart = 0;
        ret[i].mutable_get<flex_int>() = buf[bufstart];
        ++bufstart;
        --num_values_to_read;
      }
    }
  }
}
void decode_number ( iarchive & iarc , std :: vector < flexible_type > & ret , size_t num_undefined ) { uint64_t buf [ MAX_INTEGERS_PER_BLOCK ] ; size_t bufstart = 0 ; size_t buflen = 0 ; size_t num_values_to_read = ret . size ( ) - num_undefined ; for ( size_t i = 0 ; i < ret . size ( ) ; ++ i ) { if ( ret [ i ] . get_type ( ) != flex_type_enum :: UNDEFINED ) { if ( bufstart < buflen ) { ret [ i ] . mutable_get < flex_int > ( ) = buf [ bufstart ] ; ++ bufstart ; -- num_values_to_read ; } else { buflen = std :: min < size_t > ( num_values_to_read , MAX_INTEGERS_PER_BLOCK ) ; frame_of_reference_decode_128 ( iarc , buflen , buf ) ; bufstart = 0 ; ret [ i ] . mutable_get < flex_int > ( ) = buf [ bufstart ] ; ++ bufstart ; -- num_values_to_read ; } } } }
Decodes a collection of numbers into 'data'.
Decodes a collection of numbers into ' data ' .
// decode a new block of 128 integers //         logstream(LOG_INFO) << "Decoding "; //         for (size_t i = 0;i < buflen; ++i) { //           logstream(LOG_INFO) << " " << buf[i]; //         } //         logstream(LOG_INFO) << std::endl;