Changeset 1021


Ignore:
Timestamp:
Feb 1, 2008, 6:58:38 PM (13 years ago)
Author:
Peter
Message:

passing VectorBase? in regression::MultiDimesional? - refs #256

Location:
trunk/yat/regression
Files:
2 edited

Legend:

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

    r1009 r1021  
    2626#include "yat/utility/Exception.h"
    2727#include "yat/utility/matrix.h"
     28#include "yat/utility/VectorBase.h"
    2829#include "yat/utility/vector.h"
    2930
     
    5455
    5556
    56   void MultiDimensional::fit(const utility::matrix& x, const utility::vector& y)
     57  void MultiDimensional::fit(const utility::matrix& x,
     58                             const utility::VectorBase& y)
    5759  {
    5860    assert(x.rows()==y.size());
     
    8688
    8789
    88   double MultiDimensional::predict(const utility::vector& x) const
     90  double MultiDimensional::predict(const utility::VectorBase& x) const
    8991  {
    9092    assert(x.size()==fit_parameters_.size());
     
    9395
    9496
    95   double MultiDimensional::prediction_error2(const utility::vector& x) const
     97  double MultiDimensional::prediction_error2(const utility::VectorBase& x) const
    9698  {
    9799    return standard_error2(x) + s2_;
     
    99101
    100102
    101   double MultiDimensional::standard_error2(const utility::vector& x) const
     103  double MultiDimensional::standard_error2(const utility::VectorBase& x) const
    102104  {
    103105    double s2 = 0;
  • trunk/yat/regression/MultiDimensional.h

    r1000 r1021  
    2626
    2727#include "yat/utility/matrix.h"
    28 #include "yat/utility/vector.h"
     28#include "yat/utility/VectorBase.h"
    2929
    3030#include <gsl/gsl_multifit.h>
     
    6464       dimension errors).
    6565    */
    66     void fit(const utility::matrix& X, const utility::vector& y);
     66    void fit(const utility::matrix& X, const utility::VectorBase& y);
    6767
    6868    ///
     
    7979    /// @return value in @a x according to fitted model
    8080    ///
    81     double predict(const utility::vector& x) const;
     81    double predict(const utility::VectorBase& x) const;
    8282
    8383    ///
     
    8585    /// in @a x
    8686    ///
    87     double prediction_error2(const utility::vector& x) const;
     87    double prediction_error2(const utility::VectorBase& x) const;
    8888
    8989    ///
    9090    /// @return squared error of model value in @a x
    9191    ///
    92     double standard_error2(const utility::vector& x) const;
     92    double standard_error2(const utility::VectorBase& x) const;
    9393
    9494  private:
Note: See TracChangeset for help on using the changeset viewer.