Changeset 1647 for trunk/yat/regression


Ignore:
Timestamp:
Dec 13, 2008, 9:45:44 AM (13 years ago)
Author:
Jari Häkkinen
Message:

Addresses #466. Added more interpolation algorithms. The full set of GSL 1.11 interpolation methods is now interfaced.

Location:
trunk/yat/regression
Files:
1 edited
8 copied

Legend:

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

    r1646 r1647  
    2020*/
    2121
    22 #include "LinearInterpolation.h"
     22#include "AkimaInterpolation.h"
    2323
    2424#include <gsl/gsl_interp.h>
     
    2929
    3030
    31   LinearInterpolation::LinearInterpolation(const utility::VectorBase& x,
    32                                           const utility::VectorBase& y)
    33     : GSLInterpolation(gsl_interp_linear,x,y)
     31  AkimaInterpolation::AkimaInterpolation(const utility::VectorBase& x,
     32                                        const utility::VectorBase& y)
     33    : GSLInterpolation(gsl_interp_akima,x,y)
    3434  {
    3535  }
    3636
    3737
    38   LinearInterpolation::~LinearInterpolation(void)
     38  AkimaInterpolation::~AkimaInterpolation(void)
    3939  {
    4040  }
  • trunk/yat/regression/AkimaInterpolation.h

    r1646 r1647  
    1 #ifndef _theplu_yat_regression_linear_interpolation_
    2 #define _theplu_yat_regression_linear_interpolation_
     1#ifndef _theplu_yat_regression_akima_interpolation_
     2#define _theplu_yat_regression_akima_interpolation_
    33
    44// $Id$
     
    3333
    3434  /**
    35      \brief Linear interpolation.
     35     \brief Non-rounded Akima spline with natural boundary conditions.
     36
     37     This method uses the non-rounded corner algorithm of Wodicka.
    3638
    3739     \see Please refer to the base class documentation for genereal
    3840     introduction to the GSL based interpolation methods.
    3941  */
    40   class LinearInterpolation : public GSLInterpolation
     42  class AkimaInterpolation : public GSLInterpolation
    4143  {
    4244
     
    4547       \brief The default constructor
    4648    */
    47     LinearInterpolation(const utility::VectorBase& x,
    48                         const utility::VectorBase& y);
     49    AkimaInterpolation(const utility::VectorBase& x,
     50                       const utility::VectorBase& y);
    4951
    5052    /**
    5153       \brief The destructor
    5254    */
    53     ~LinearInterpolation(void);
     55    ~AkimaInterpolation(void);
    5456
    5557  private:
     
    5759       \brief Copy Constructor. (not implemented)
    5860    */
    59     LinearInterpolation(const LinearInterpolation&);
     61    AkimaInterpolation(const AkimaInterpolation&);
    6062
    6163  };
  • trunk/yat/regression/AkimaPeriodicInterpolation.cc

    r1646 r1647  
    2020*/
    2121
    22 #include "LinearInterpolation.h"
     22#include "AkimaPeriodicInterpolation.h"
    2323
    2424#include <gsl/gsl_interp.h>
     
    2929
    3030
    31   LinearInterpolation::LinearInterpolation(const utility::VectorBase& x,
    32                                           const utility::VectorBase& y)
     31  AkimaPeriodicInterpolation::AkimaPeriodicInterpolation(
     32    const utility::VectorBase& x, const utility::VectorBase& y)
    3333    : GSLInterpolation(gsl_interp_linear,x,y)
    3434  {
     
    3636
    3737
    38   LinearInterpolation::~LinearInterpolation(void)
     38  AkimaPeriodicInterpolation::~AkimaPeriodicInterpolation(void)
    3939  {
    4040  }
  • trunk/yat/regression/AkimaPeriodicInterpolation.h

    r1646 r1647  
    1 #ifndef _theplu_yat_regression_linear_interpolation_
    2 #define _theplu_yat_regression_linear_interpolation_
     1#ifndef _theplu_yat_regression_akima_periodic_interpolation_
     2#define _theplu_yat_regression_akima_periodic_interpolation_
    33
    44// $Id$
     
    3333
    3434  /**
    35      \brief Linear interpolation.
     35     \brief AkimaPeriodic interpolation.
    3636
    3737     \see Please refer to the base class documentation for genereal
    3838     introduction to the GSL based interpolation methods.
    3939  */
    40   class LinearInterpolation : public GSLInterpolation
     40  class AkimaPeriodicInterpolation : public GSLInterpolation
    4141  {
    4242
     
    4545       \brief The default constructor
    4646    */
    47     LinearInterpolation(const utility::VectorBase& x,
    48                         const utility::VectorBase& y);
     47    AkimaPeriodicInterpolation(const utility::VectorBase& x,
     48                               const utility::VectorBase& y);
    4949
    5050    /**
    5151       \brief The destructor
    5252    */
    53     ~LinearInterpolation(void);
     53    ~AkimaPeriodicInterpolation(void);
    5454
    5555  private:
     
    5757       \brief Copy Constructor. (not implemented)
    5858    */
    59     LinearInterpolation(const LinearInterpolation&);
     59    AkimaPeriodicInterpolation(const AkimaPeriodicInterpolation&);
    6060
    6161  };
  • trunk/yat/regression/CSplinePeriodicInterpolation.cc

    r1645 r1647  
    2020*/
    2121
    22 #include "CSplineInterpolation.h"
     22#include "CSplinePeriodicInterpolation.h"
    2323
    2424#include <gsl/gsl_interp.h>
     
    2929
    3030
    31   CSplineInterpolation::CSplineInterpolation(const utility::VectorBase& x,
    32                                             const utility::VectorBase& y)
     31  CSplinePeriodicInterpolation::CSplinePeriodicInterpolation(
     32    const utility::VectorBase& x, const utility::VectorBase& y)
    3333    : GSLInterpolation(gsl_interp_cspline,x,y)
    3434  {
     
    3636
    3737
    38   CSplineInterpolation::~CSplineInterpolation(void)
     38  CSplinePeriodicInterpolation::~CSplinePeriodicInterpolation(void)
    3939  {
    4040  }
  • trunk/yat/regression/CSplinePeriodicInterpolation.h

    r1645 r1647  
    1 #ifndef _theplu_yat_regression_cspline_interpolation_
    2 #define _theplu_yat_regression_cspline_interpolation_
     1#ifndef _theplu_yat_regression_cspline_periodic_interpolation_
     2#define _theplu_yat_regression_cspline_periodic_interpolation_
    33
    44// $Id$
     
    3333
    3434  /**
    35      \brief Cubic spline with natural boundary conditions.
     35     \brief Cubic spline with periodic boundary conditions.
    3636
    3737     The resulting curve is piecewise cubic on each interval, with
    3838     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.
     39     data-points. The derivatives at the first and last points are
     40     also matched. Note that the last point in the data must have the
     41     same y-value as the first point, otherwise the resulting periodic
     42     interpolation will have a discontinuity at the boundary.
    4143
    4244     \see Please refer to the base class documentation for genereal
    4345     introduction to the GSL based interpolation methods.
    4446  */
    45   class CSplineInterpolation : public GSLInterpolation
     47  class CSplinePeriodicInterpolation : public GSLInterpolation
    4648  {
    4749
     
    5052       \brief The default constructor
    5153    */
    52     CSplineInterpolation(const utility::VectorBase& x,
    53                         const utility::VectorBase& y);
     54    CSplinePeriodicInterpolation(const utility::VectorBase& x,
     55                                const utility::VectorBase& y);
    5456
    5557    /**
    5658       \brief The destructor
    5759    */
    58     ~CSplineInterpolation(void);
     60    ~CSplinePeriodicInterpolation(void);
    5961
    6062  private:
     
    6264       \brief Copy Constructor. (not implemented)
    6365    */
    64     CSplineInterpolation(const CSplineInterpolation&);
     66    CSplinePeriodicInterpolation(const CSplinePeriodicInterpolation&);
    6567
    6668  };
  • trunk/yat/regression/Makefile.am

    r1646 r1647  
    2323
    2424noinst_LTLIBRARIES = libregression.la
    25 libregression_la_SOURCES = CSplineInterpolation.cc GSLInterpolation.cc \
    26   KernelBox.cc KernelTriCube.cc Linear.cc LinearInterpolation.cc \
    27   LinearWeighted.cc Local.cc MultiDimensional.cc      \
    28   MultiDimensionalWeighted.cc Naive.cc NaiveWeighted.cc   \
    29   OneDimensional.cc OneDimensionalWeighted.cc Polynomial.cc \
    30   PolynomialWeighted.cc
     25libregression_la_SOURCES = AkimaInterpolation.cc                      \
     26  AkimaPeriodicInterpolation.cc CSplineInterpolation.cc               \
     27  CSplinePeriodicInterpolation.cc GSLInterpolation.cc KernelBox.cc    \
     28  KernelTriCube.cc Linear.cc LinearInterpolation.cc LinearWeighted.cc \
     29  Local.cc MultiDimensional.cc MultiDimensionalWeighted.cc Naive.cc   \
     30  NaiveWeighted.cc OneDimensional.cc OneDimensionalWeighted.cc        \
     31  Polynomial.cc LinearInterpolation.cc PolynomialWeighted.cc
    3132
    3233include_regressiondir = $(includedir)/yat/regression
    3334
    34 include_regression_HEADERS = CSplineInterpolation.h GSLInterpolation.h \
    35   Kernel.h KernelBox.h KernelTriCube.h  \
    36   Linear.h LinearInterpolation.h LinearWeighted.h Local.h MultiDimensional.h    \
    37   MultiDimensionalWeighted.h Naive.h NaiveWeighted.h    \
    38   OneDimensional.h OneDimensionalWeighted.h Polynomial.h    \
     35include_regression_HEADERS = AkimaInterpolation.h                     \
     36  AkimaPeriodicInterpolation.h CSplineInterpolation.h                 \
     37  CSplinePeriodicInterpolation.cc GSLInterpolation.h Kernel.h         \
     38  KernelBox.h KernelTriCube.h Linear.h LinearInterpolation.h          \
     39  LinearWeighted.h Local.h MultiDimensional.h                         \
     40  MultiDimensionalWeighted.h Naive.h NaiveWeighted.h OneDimensional.h \
     41  OneDimensionalWeighted.h Polynomial.h LinearInterpolation.cc        \
    3942  PolynomialWeighted.h
  • trunk/yat/regression/PolynomialInterpolation.cc

    r1646 r1647  
    2020*/
    2121
    22 #include "LinearInterpolation.h"
     22#include "PolynomialInterpolation.h"
    2323
    2424#include <gsl/gsl_interp.h>
     
    2929
    3030
    31   LinearInterpolation::LinearInterpolation(const utility::VectorBase& x,
    32                                           const utility::VectorBase& y)
    33     : GSLInterpolation(gsl_interp_linear,x,y)
     31  PolynomialInterpolation::PolynomialInterpolation(const utility::VectorBase& x,
     32                                                  const utility::VectorBase& y)
     33    : GSLInterpolation(gsl_interp_polynomial,x,y)
    3434  {
    3535  }
    3636
    3737
    38   LinearInterpolation::~LinearInterpolation(void)
     38  PolynomialInterpolation::~PolynomialInterpolation(void)
    3939  {
    4040  }
  • trunk/yat/regression/PolynomialInterpolation.h

    r1646 r1647  
    1 #ifndef _theplu_yat_regression_linear_interpolation_
    2 #define _theplu_yat_regression_linear_interpolation_
     1#ifndef _theplu_yat_regression_polynomial_interpolation_
     2#define _theplu_yat_regression_polynomial_interpolation_
    33
    44// $Id$
     
    3333
    3434  /**
    35      \brief Linear interpolation.
     35     \brief Polynomial interpolation.
     36
     37     This method should only be used for interpolating small numbers
     38     of points because polynomial interpolation introduces large
     39     oscillations, even for well-behaved datasets. The number of terms
     40     in the interpolating polynomial is equal to the number of points.
    3641
    3742     \see Please refer to the base class documentation for genereal
    3843     introduction to the GSL based interpolation methods.
    3944  */
    40   class LinearInterpolation : public GSLInterpolation
     45  class PolynomialInterpolation : public GSLInterpolation
    4146  {
    4247
     
    4550       \brief The default constructor
    4651    */
    47     LinearInterpolation(const utility::VectorBase& x,
    48                         const utility::VectorBase& y);
     52    PolynomialInterpolation(const utility::VectorBase& x,
     53                            const utility::VectorBase& y);
    4954
    5055    /**
    5156       \brief The destructor
    5257    */
    53     ~LinearInterpolation(void);
     58    ~PolynomialInterpolation(void);
    5459
    5560  private:
     
    5762       \brief Copy Constructor. (not implemented)
    5863    */
    59     LinearInterpolation(const LinearInterpolation&);
     64    PolynomialInterpolation(const PolynomialInterpolation&);
    6065
    6166  };
Note: See TracChangeset for help on using the changeset viewer.