Changeset 1120 for trunk/yat/regression


Ignore:
Timestamp:
Feb 22, 2008, 12:18:41 AM (13 years ago)
Author:
Peter
Message:

vector is now Vector

Location:
trunk/yat/regression
Files:
12 edited

Legend:

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

    r1043 r1120  
    2626#include "LinearWeighted.h"
    2727#include "yat/statistics/AveragerPairWeighted.h"
    28 #include "yat/utility/vector.h"
     28#include "yat/utility/Vector.h"
    2929
    3030#include <cassert>
     
    7575    // want.
    7676    ap_.reset();
    77     yat::utility::vector dummy(x.size(), 1.0);
     77    yat::utility::Vector dummy(x.size(), 1.0);
    7878    add(ap_, x.begin(), x.end(), y.begin(),dummy.begin(),w.begin());
    7979
  • trunk/yat/regression/Local.cc

    r1049 r1120  
    2626#include "Kernel.h"
    2727#include "OneDimensionalWeighted.h"
    28 #include "yat/utility/vector.h"
     28#include "yat/utility/Vector.h"
    2929#include "yat/utility/VectorView.h"
    3030
     
    6868
    6969    size_t nof_fits=data_.size()/step_size;
    70     x_ = utility::vector(nof_fits);
    71     y_predicted_ = utility::vector(x_.size());
    72     y_err_ = utility::vector(x_.size());
     70    x_ = utility::Vector(nof_fits);
     71    y_predicted_ = utility::Vector(x_.size());
     72    y_err_ = utility::Vector(x_.size());
    7373    sort(data_.begin(), data_.end());
    7474
    7575    // coying data to 2 utility vectors ONCE to use views from
    76     utility::vector x(data_.size());
    77     utility::vector y(data_.size());
     76    utility::Vector x(data_.size());
     77    utility::Vector y(data_.size());
    7878    for (size_t j=0; j<x.size(); j++){
    7979      x(j)=data_[j].first;
     
    115115
    116116      // calculating weights
    117       utility::vector w(max_index-min_index+1);
     117      utility::Vector w(max_index-min_index+1);
    118118      for (size_t j=0; j<w.size(); j++)
    119119        w(j) = (*kernel_)( (x_local(j)- x_mid)/width );
     
    128128  }
    129129
    130   const utility::vector& Local::x(void) const
     130  const utility::Vector& Local::x(void) const
    131131  {
    132132    return x_;
    133133  }
    134134
    135   const utility::vector& Local::y_predicted(void) const
     135  const utility::Vector& Local::y_predicted(void) const
    136136  {
    137137    return y_predicted_;
    138138  }
    139139
    140   const utility::vector& Local::y_err(void) const
     140  const utility::Vector& Local::y_err(void) const
    141141  {
    142142    return y_err_;
  • trunk/yat/regression/Local.h

    r1000 r1120  
    2727*/
    2828
    29 #include "yat/utility/vector.h"
     29#include "yat/utility/Vector.h"
    3030
    3131#include <iostream>
     
    7878    /// @return x-values where fitting was performed.
    7979    ///
    80     const utility::vector& x(void) const;
     80    const utility::Vector& x(void) const;
    8181
    8282    ///
    8383    /// Function returning predicted values
    8484    ///
    85     const utility::vector& y_predicted(void) const;
     85    const utility::Vector& y_predicted(void) const;
    8686
    8787    ///
    8888    /// Function returning error of predictions
    8989    ///
    90     const utility::vector& y_err(void) const;
     90    const utility::Vector& y_err(void) const;
    9191
    9292  private:
     
    9999    Kernel* kernel_;
    100100    OneDimensionalWeighted* regressor_;
    101     utility::vector x_;
    102     utility::vector y_predicted_;
    103     utility::vector y_err_;
     101    utility::Vector x_;
     102    utility::Vector y_predicted_;
     103    utility::Vector y_err_;
    104104  };
    105105
  • trunk/yat/regression/MultiDimensional.cc

    r1098 r1120  
    2727#include "yat/utility/matrix.h"
    2828#include "yat/utility/VectorBase.h"
    29 #include "yat/utility/vector.h"
     29#include "yat/utility/Vector.h"
    3030
    3131#include <cassert>
     
    6060    assert(x.rows()==y.size());
    6161    covariance_.resize(x.columns(),x.columns());
    62     fit_parameters_ = utility::vector(x.columns());
     62    fit_parameters_ = utility::Vector(x.columns());
    6363    if (work_)
    6464      gsl_multifit_linear_free(work_);
     
    7676  }
    7777
    78   const utility::vector& MultiDimensional::fit_parameters(void) const
     78  const utility::Vector& MultiDimensional::fit_parameters(void) const
    7979  {
    8080    return fit_parameters_;
  • trunk/yat/regression/MultiDimensional.h

    r1021 r1120  
    6969    /// @return parameters of the model
    7070    ///
    71     const utility::vector& fit_parameters(void) const;
     71    const utility::Vector& fit_parameters(void) const;
    7272
    7373    /**
     
    9696    double s2_;
    9797    utility::matrix covariance_;
    98     utility::vector fit_parameters_;
     98    utility::Vector fit_parameters_;
    9999    gsl_multifit_linear_workspace* work_;
    100100
  • trunk/yat/regression/MultiDimensionalWeighted.cc

    r1098 r1120  
    2525#include "yat/statistics/AveragerWeighted.h"
    2626#include "yat/utility/matrix.h"
    27 #include "yat/utility/vector.h"
     27#include "yat/utility/Vector.h"
    2828
    2929#include <cassert>
     
    5959
    6060    covariance_.resize(x.columns(),x.columns());
    61     fit_parameters_ = utility::vector(x.columns());
     61    fit_parameters_ = utility::Vector(x.columns());
    6262    if (work_)
    6363      gsl_multifit_linear_free(work_);
     
    8080
    8181
    82   const utility::vector& MultiDimensionalWeighted::fit_parameters(void) const
     82  const utility::Vector& MultiDimensionalWeighted::fit_parameters(void) const
    8383  {
    8484    return fit_parameters_;
  • trunk/yat/regression/MultiDimensionalWeighted.h

    r1022 r1120  
    2626
    2727#include "yat/utility/matrix.h"
    28 #include "yat/utility/vector.h"
     28#include "yat/utility/Vector.h"
    2929
    3030#include <gsl/gsl_multifit.h>
     
    8585    /// @return parameters of fitted model
    8686    ///
    87     const utility::vector& fit_parameters(void) const;
     87    const utility::Vector& fit_parameters(void) const;
    8888
    8989    ///
     
    9595    double chisquare_;
    9696    utility::matrix covariance_;
    97     utility::vector fit_parameters_;
     97    utility::Vector fit_parameters_;
    9898    double s2_;
    9999    gsl_multifit_linear_workspace* work_;
  • trunk/yat/regression/NaiveWeighted.cc

    r1043 r1120  
    2727#include "OneDimensional.h"
    2828#include "yat/statistics/AveragerWeighted.h"
    29 #include "yat/utility/vector.h"
     29#include "yat/utility/Vector.h"
    3030
    3131#include <cassert>
     
    5151    assert(y.size()==w.size());
    5252    ap_.reset();
    53     utility::vector dummy(x.size(),1.0);
     53    utility::Vector dummy(x.size(),1.0);
    5454    add(ap_, x.begin(), x.end(), y.begin(),dummy.begin(), w.begin());
    5555    chisq_ = ap_.y_averager().sum_xx_centered();
  • trunk/yat/regression/Polynomial.cc

    r1043 r1120  
    6262
    6363
    64   const utility::vector& Polynomial::fit_parameters(void) const
     64  const utility::Vector& Polynomial::fit_parameters(void) const
    6565  {
    6666    return md_.fit_parameters();
     
    7070  double Polynomial::predict(const double x) const
    7171  {
    72     utility::vector vec(power_+1,1);
     72    utility::Vector vec(power_+1,1);
    7373    for (size_t i=1; i<=power_; ++i)
    7474      vec(i) = vec(i-1)*x;
     
    8585  double Polynomial::standard_error2(const double x) const
    8686  {
    87     utility::vector vec(power_+1,1);
     87    utility::Vector vec(power_+1,1);
    8888    for (size_t i=1; i<=power_; ++i)
    8989      vec(i) = vec(i-1)*x;
  • trunk/yat/regression/Polynomial.h

    r1019 r1120  
    7272    /// @see MultiDimensional
    7373    ///
    74     const utility::vector& fit_parameters(void) const;
     74    const utility::Vector& fit_parameters(void) const;
    7575
    7676    ///
  • trunk/yat/regression/PolynomialWeighted.cc

    r1043 r1120  
    2525#include "PolynomialWeighted.h"
    2626#include "yat/utility/matrix.h"
    27 #include "yat/utility/vector.h"
     27#include "yat/utility/Vector.h"
    2828
    2929#include <cassert>
     
    5252    // product wx*wy, so we can send in w and a dummie to get what we
    5353    // want.
    54     utility::vector dummy(x.size(), 1.0);
     54    utility::Vector dummy(x.size(), 1.0);
    5555    add(ap_,x.begin(), x.end(),y.begin(),dummy.begin(),w.begin());
    5656    utility::matrix X=utility::matrix(x.size(),power_+1,1);
     
    6363
    6464
    65   const utility::vector& PolynomialWeighted::fit_parameters(void) const
     65  const utility::Vector& PolynomialWeighted::fit_parameters(void) const
    6666  {
    6767    return md_.fit_parameters();
     
    7676  double PolynomialWeighted::predict(const double x) const
    7777  {
    78     utility::vector vec(power_+1,1);
     78    utility::Vector vec(power_+1,1);
    7979    for (size_t i=1; i<=power_; ++i)
    8080      vec(i) = vec(i-1)*x;
     
    8484  double PolynomialWeighted::standard_error2(const double x) const
    8585  {
    86     utility::vector vec(power_+1,1);
     86    utility::Vector vec(power_+1,1);
    8787    for (size_t i=1; i<=power_; ++i)
    8888      vec(i) = vec(i-1)*x;
  • trunk/yat/regression/PolynomialWeighted.h

    r1020 r1120  
    2727#include "OneDimensionalWeighted.h"
    2828#include "MultiDimensionalWeighted.h"
    29 #include "yat/utility/vector.h"
     29#include "yat/utility/Vector.h"
    3030
    3131namespace theplu {
     
    6565    /// @see MultiDimensional
    6666    ///
    67     const utility::vector& fit_parameters(void) const;
     67    const utility::Vector& fit_parameters(void) const;
    6868
    6969    ///
Note: See TracChangeset for help on using the changeset viewer.