Ignore:
Timestamp:
Apr 13, 2005, 3:37:14 PM (17 years ago)
Author:
Peter
Message:

bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/stl_utility.cc

    r266 r270  
    6767  bool read_to_double(std::istream& is, std::vector<double>& vec)
    6868  {
     69    vec.resize(0);
    6970    std::vector<std::string> vec_str;
    7071    if (read_to_string(is,vec_str)){
     
    7475                    << " is not a number." << std::endl;
    7576        }
    76         vec.push_back(atoi(vec_str[i].c_str()));
     77        vec.push_back(atof(vec_str[i].c_str()));
    7778      }
    7879      return true;
     
    8485  bool read_to_int(std::istream& is, std::vector<int>& vec)
    8586  {
     87    vec.resize(0);
    8688    std::vector<std::string> vec_str;
    8789    if (read_to_string(is,vec_str)){
     
    101103  bool read_to_string(std::istream& is, std::vector<std::string>& vec)
    102104  {
     105    vec.resize(0);
    103106    std::string s;
    104107    if (getline(is, s, '\n')){
Note: See TracChangeset for help on using the changeset viewer.