Theoretica
A C++ numerical and automatic mathematical library
theoretica::spline Class Reference

A natural cubic spline interpolation class. More...

#include <splines.h>

Public Member Functions

template<typename DataPoints = std::vector<vec2>>
 spline (const DataPoints &p)
 Construct the natural cubic spline interpolation from a vector of coordinate pairs.
 
template<typename Dataset1 , typename Dataset2 >
 spline (const Dataset1 &X, const Dataset2 &Y)
 Construct the natural cubic spline interpolation from the sets of X and Y data points.
 
splineoperator= (const spline &other)
 Copy from another spline.
 
real operator() (real x) const
 Evaluate the natural cubic spline interpolation at a given point.
 
real deriv (real x) const
 Evaluate the derivative of the natural cubic spline interpolation at a given point.
 
auto begin ()
 Get an iterator to the first spline element.
 
auto end ()
 Get an iterator to one plus the last spline element.
 

Public Attributes

std::vector< spline_nodenodes
 The computed nodes of the natural cubic spline interpolation over the points.
 

Detailed Description

A natural cubic spline interpolation class.


The documentation for this class was generated from the following file: