Changeset 789 for trunk/yat/regression


Ignore:
Timestamp:
Mar 10, 2007, 9:07:13 PM (14 years ago)
Author:
Jari Häkkinen
Message:

Addresses #193. vector now works as outlined here. Added some
functionality. Added a clone function that facilitates resizing of
vectors. clone is needed since assignement operator functionality is
changed.

Location:
trunk/yat/regression
Files:
3 edited

Legend:

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

    r767 r789  
    5858
    5959    size_t nof_fits=data_.size()/step_size;
    60     x_= utility::vector(nof_fits);
    61     y_predicted_ = utility::vector(x_.size());
    62     y_err_ = utility::vector(x_.size());
     60    x_.clone(utility::vector(nof_fits));
     61    y_predicted_.clone(utility::vector(x_.size()));
     62    y_err_.clone(utility::vector(x_.size()));
    6363    sort(data_.begin(), data_.end());
    6464
  • trunk/yat/regression/MultiDimensional.cc

    r750 r789  
    5757    assert(x.rows()==y.size());
    5858    covariance_=utility::matrix(x.columns(),x.columns());
    59     fit_parameters_=utility::vector(x.columns());
     59    fit_parameters_.clone(utility::vector(x.columns()));
    6060    if (work_)
    6161      gsl_multifit_linear_free(work_);
  • trunk/yat/regression/MultiDimensionalWeighted.cc

    r750 r789  
    5959
    6060    covariance_=utility::matrix(x.columns(),x.columns());
    61     fit_parameters_=utility::vector(x.columns());
     61    fit_parameters_.clone(utility::vector(x.columns()));
    6262    if (work_)
    6363      gsl_multifit_linear_free(work_);
     
    8585  }
    8686
     87
    8788  double MultiDimensionalWeighted::predict(const utility::vector& x) const
    8889  {
     
    9091    return fit_parameters_ * x;
    9192  }
     93
    9294
    9395  double MultiDimensionalWeighted::prediction_error2(const utility::vector& x,
Note: See TracChangeset for help on using the changeset viewer.