Changeset 1644


Ignore:
Timestamp:
Dec 13, 2008, 9:14:51 AM (12 years ago)
Author:
Jari Häkkinen
Message:

Addresses #466. Changed to VectorBase? passing. Added documentation.

Location:
trunk/yat/regression
Files:
4 edited

Legend:

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

    r1643 r1644  
    2929
    3030
    31   CSpline::CSpline(const utility::VectorConstView& x,
    32                    const utility::VectorConstView& y)
     31  CSpline::CSpline(const utility::VectorBase& x, const utility::VectorBase& y)
    3332    : GSLInterpolation(gsl_interp_cspline,x,y)
    3433  {
  • trunk/yat/regression/CSpline.h

    r1643 r1644  
    2828namespace yat {
    2929namespace utility {
    30   class VectorConstView;
     30  class VectorBase;
    3131}
    3232namespace regression {
    3333
    3434  /**
    35      @brief Documentation please.
     35     \brief Cubic spline with natural boundary conditions.
     36
     37     The resulting curve is piecewise cubic on each interval, with
     38     matching first and second derivatives at the supplied
     39     data-points. The second derivative is chosen to be zero at the
     40     first point and last point.
     41
     42     \see Please refer to the base class documentation for genereal
     43     introduction to the GSL based interpolation methods.
    3644  */
    3745  class CSpline : public GSLInterpolation
     
    4048  public:
    4149    /**
    42        @brief The default constructor
     50       \brief The default constructor
    4351    */
    44     CSpline(const utility::VectorConstView& x,
    45             const utility::VectorConstView& y);
     52    CSpline(const utility::VectorBase& x, const utility::VectorBase& y);
    4653
    4754    /**
    48        @brief The destructor
     55       \brief The destructor
    4956    */
    5057    ~CSpline(void);
     
    5259  private:
    5360    /**
    54        Copy Constructor. (not implemented)
     61       \brief Copy Constructor. (not implemented)
    5562    */
    5663    CSpline(const CSpline&);
  • trunk/yat/regression/GSLInterpolation.cc

    r1643 r1644  
    2222#include "GSLInterpolation.h"
    2323
    24 #include "yat/utility/VectorConstView.h"
     24#include "yat/utility/VectorBase.h"
    2525
    2626#include <cassert>
     
    3232
    3333  GSLInterpolation::GSLInterpolation(const gsl_interp_type* interpolator_type,
    34                                      const utility::VectorConstView& x,
    35                                      const utility::VectorConstView& y)
     34                                     const utility::VectorBase& x,
     35                                     const utility::VectorBase& y)
    3636  {
    3737    assert(x.size()==y.size());
     
    4343      y_[i]=y(i);
    4444    }
    45     interpolator_=gsl_interp_alloc (interpolator_type, size);
     45    interpolator_ = gsl_interp_alloc(interpolator_type, size);
    4646    gsl_interp_init(interpolator_, x_, y_, size);
    4747    accelerator_ = gsl_interp_accel_alloc();
  • trunk/yat/regression/GSLInterpolation.h

    r1643 r1644  
    2828namespace yat {
    2929namespace utility {
    30   class VectorConstView;
     30  class VectorBase;
    3131}
    3232namespace regression {
    3333
    3434  /**
    35      @brief Documentation please.
     35     \brief Base class for interfacing GSL interpolation.
     36
     37     The GSL interpolation is descibed in
     38     http://www.gnu.org/software/gsl/manual/html_node/Interpolation.html. The
     39     GSL library provides a variety of interpolation methods,
     40     including Cubic splines and Akima splines. Interpolations can be
     41     defined for both normal and periodic boundary
     42     conditions. Additional functions are available for computing
     43     derivatives and integrals of interpolating functions.
     44
     45     Given a set of data points \f$ (x_1, y_1) \dots (x_n, y_n) \f$
     46     the sub classescompute a continuous interpolating function \f$
     47     y(x) \f$ such that \f$ y(x_i) = y_i \f$. The interpolation is
     48     piecewise smooth, and its behavior at the end-points is
     49     determined by the type of interpolation used.
    3650  */
    3751  class GSLInterpolation
     
    4155
    4256    /**
    43        @brief Documentation please.
     57       \brief Calculate the interpolated value for \a x.
     58
     59       \return The interpolated value of \f$ y \f$ for a given point
     60       \a x.
    4461    */
    4562    double evaluate(const double x) const;
     
    4764  protected:
    4865    /**
    49        @brief The default constructor
     66       \brief The default constructor
     67
     68       Initializion of the interpolation object for the data \f$ (x,
     69       y) \f$ where \a x and \a y are vector like objects of the same
     70       size. The content of \a x and \a y are copied for internal
     71       storage. \a x is always assumed to be strictly ordered, with
     72       increasing \a x values; the behavior for other arrangements is
     73       not defined.
    5074    */
    51     GSLInterpolation(const gsl_interp_type*, const utility::VectorConstView& x,
    52                      const utility::VectorConstView& y);
     75    GSLInterpolation(const gsl_interp_type*, const utility::VectorBase& x,
     76                     const utility::VectorBase& y);
    5377
    5478    /**
    55        @brief The destructor
     79       \brief The destructor
    5680    */
    5781    virtual ~GSLInterpolation(void);
     
    5983  private:
    6084    /**
    61        Copy Constructor. (not implemented)
     85       \brief Copy Constructor. (not implemented)
    6286    */
    6387    GSLInterpolation(const GSLInterpolation&);
Note: See TracChangeset for help on using the changeset viewer.