Class implements the natural cubic spline interpolation. More...

#include <naturalCubicSpline.hpp>

Inheritance diagram for julian::NaturalCubicSpline:
julian::Interpolation

Public Member Functions

virtual double operator() (const std::vector< double > &, const std::vector< double > &, const double &) const
 Performs interpolation. More...
 
virtual NaturalCubicSplineclone () const
 Virtual copy constructor. More...
 
virtual unsigned int getMinSize () const
 return the minimum number of points required by the interpolation More...
 
virtual std::string info () const
 Name of a class. More...
 
- Public Member Functions inherited from julian::Interpolation
 Interpolation ()
 Constructor. More...
 
virtual ~Interpolation ()
 Destructor. More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &, const unsigned int)
 interface used by Boost serialization library More...
 

Friends

class boost::serialization::access
 

Detailed Description

Class implements the natural cubic spline interpolation.

A natural cubic spline is a non-local method of interpolation. The interpolant is a piecewise function build from cubic polynomial defined on each interval $(x_{i-1},x_{i})$ for $i = 0,1,..,n$:

\[f_{i}(x) = a_{i} x^{3} + b_{i} x^{2} + c_{i} x + d_{i} for x \in (x_{i-1}, x_{i})\]

For a given tabulated points $(x_{i},y_{i})$ where $i = 0,1,..,n$ cubic functions $f_{j}$ where $j = 1,..,n$ satisfies the conditions:

  • $ f_{i}(x_{i-1}) = y_{i-1}$ for $ i = 1,..,n $
  • $ f_{i}(x_{i}) = y_{i}$ for $ i = 1,..,n $
  • $ \frac{df_{i}(x)}{dx}|_{x=x_{i}} = \frac{df_{i+1}(x)}{dx}|_{x=x_{i}}$ for $ i = 1,..,n-1 $
  • $ \frac{d^{2}f_{i}(x)}{dx^{2}}|_{x=x_{i}} = \frac{d^{2}f_{i+1}(x)}{dx^{2}}|_{x=x_{i}}$ for $ i = 1,..,n-1 $
  • $ \frac{d^{2}f_{1}(x)}{dx^{2}}|_{x=x_{0}} = 0 $
  • $ \frac{d^{2}f_{n}(x)}{dx^{2}}|_{x=x_{n}} = 0 $
cubicSpline_interpolation.png

For more details see [32].

Examples:
interpolationExample.cpp.

Member Function Documentation

NaturalCubicSpline * julian::NaturalCubicSpline::clone ( ) const
virtual

Virtual copy constructor.

Method is an implementation of virtual copy constructor.

Implements julian::Interpolation.

int unsigned julian::NaturalCubicSpline::getMinSize ( ) const
virtual

return the minimum number of points required by the interpolation

Implements julian::Interpolation.

std::string julian::NaturalCubicSpline::info ( ) const
virtual

Name of a class.

Method returns string that containing information about class.

Implements julian::Interpolation.

double julian::NaturalCubicSpline::operator() ( const std::vector< double > &  x,
const std::vector< double > &  a,
const double &  s 
) const
virtual

Performs interpolation.

This operator returns value of interpolant at the point x.

Implements julian::Interpolation.

template<class Archive >
void julian::NaturalCubicSpline::serialize ( Archive &  ,
const unsigned  int 
)
inlineprivate

interface used by Boost serialization library


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/mathematics/interpolation/naturalCubicSpline.hpp
  • C:/Unix/home/OEM/jULIAN/src/mathematics/interpolation/naturalCubicSpline.cpp