Changeset 1314 for trunk/yat


Ignore:
Timestamp:
May 19, 2008, 7:45:50 PM (13 years ago)
Author:
Peter
Message:

closes #330

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Vector.cc

    r1275 r1314  
    100100          break;       
    101101
    102         if(utility::is_double(element)) {
    103           v.push_back(atof(element.c_str()));
    104         }
    105         else if (!element.size() || utility::is_nan(element)) {
     102        if (!element.size())
    106103          v.push_back(std::numeric_limits<double>::quiet_NaN());
    107         }
    108104        else {
    109           std::stringstream ss("Warning: '");
    110           ss << element << "' is not a double.";
    111           throw IO_error(ss.str());
     105          try {
     106            v.push_back(convert<double>(element));
     107          }
     108          catch (std::runtime_error& e) {
     109            std::stringstream ss(e.what());
     110            ss << "\nVector.cc: " << element
     111               << " is not accepted as a Vector element\n";
     112            throw IO_error(ss.str());
     113          }
    112114        }
    113115      }
Note: See TracChangeset for help on using the changeset viewer.