src/main.cpp
/**
 * @brief Reading data from an input stream.
 *
 * @details
 * Data is received from the input stream, then read line by line, parsed and
 * formed into a data vector.
 *
 * @param [in] istrm - the input stream where the data comes from.
 * @return Data vector ready.
 */
@brief Reading data from an input stream.
@details
Data is received from the input stream, then read line by line, parsed and
formed into a data vector.

@param [in] istrm - the input stream where the data comes from.
@return Data vector ready.
@brief Reading data from an input stream . @details Data is received from the input stream then read line by line parsed and formed into a data vector . @param [ in ] istrm - the input stream where the data comes from . @return Data vector ready .
kkmeans::core::datas_t read_from(std::istream& istrm) {
  std::vector<kkmeans::core::sample_t> res;
  while (istrm) {
    std::string line;
    istrm >> line;
    if (!line.empty()) {
      kkmeans::core::sample_t dot;
      std::size_t sep_pos = line.find(';');
      dot(0) = std::stod(line.substr(0, sep_pos));
      dot(1) = std::stod(line.substr(sep_pos + 1, line.size() - sep_pos - 1));
      res.push_back(std::move(dot));
    }
  }
  return res;
}
kkmeans :: core :: datas_t read_from ( std :: istream & istrm ) { std :: vector < kkmeans :: core :: sample_t > res ; while ( istrm ) { std :: string line ; istrm >> line ; if ( ! line . empty ( ) ) { kkmeans :: core :: sample_t dot ; std :: size_t sep_pos = line . find ( ' ' ) ; dot ( 0 ) = std :: stod ( line . substr ( 0 , sep_pos ) ) ; dot ( 1 ) = std :: stod ( line . substr ( sep_pos + 1 , line . size ( ) - sep_pos - 1 ) ) ; res . push_back ( std :: move ( dot ) ) ; } } return res ; }
@brief Reading data from an input stream.
@brief Reading data from an input stream .