Ignore:
Timestamp:
Sep 3, 2008, 6:46:34 PM (13 years ago)
Author:
Peter
Message:

fitting a Local with no data is impossible so added a throw in that case

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/regression/Local.cc

    r1450 r1472  
    5858    if (step_size==0){
    5959      std::stringstream ss;
    60       ss << "yat::regression::local: step_size must be larger than zero.";
     60      ss << "yat::regression::Local: step_size must be larger than zero.";
    6161      throw std::runtime_error(ss.str());
    6262    }
    6363    if (nof_points<3){
    6464      std::stringstream ss;
    65       ss << "yat::regression::local: too few data points. "
     65      ss << "yat::regression::Local: too few data points. "
    6666         << "At least 3 data points are needed to perform fitting.";
     67      throw std::runtime_error(ss.str());
     68    }
     69    if (data_.size()<step_size){
     70      std::stringstream ss;
     71      ss << "yat::regression::Local: too large step_size "
     72         << "step_size, " << step_size
     73         << ", is larger than number of added data points " << data_.size();
    6774      throw std::runtime_error(ss.str());
    6875    }
Note: See TracChangeset for help on using the changeset viewer.