ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
Public Member Functions | List of all members
ryujin::CubicSpline Class Reference

#include <source/cubic_spline.h>

Public Member Functions

 CubicSpline (const std::vector< double > &x, const std::vector< double > &y) noexcept
 
 CubicSpline (const CubicSpline &copy)
 
CubicSplineoperator= (const CubicSpline &)=delete
 
 ~CubicSpline ()
 
double eval (double x) const
 

Detailed Description

A cubic spline class implemented as a thin wrapper around the GSL spline library functions.

Usage:

std::vector<double> xs{0.0, 0.2, 0.4, 0.6, 0.8, 1.0};
std::vector<double> ys{1.0, 0.2, 5.0, 2.0, 1.0, 10.0};
CubicSpline spline(xs, ys);
spline.eval(0.5);
CubicSpline(const std::vector< double > &x, const std::vector< double > &y) noexcept
Definition: cubic_spline.h:37

Definition at line 28 of file cubic_spline.h.

Constructor & Destructor Documentation

◆ CubicSpline() [1/2]

ryujin::CubicSpline::CubicSpline ( const std::vector< double > &  x,
const std::vector< double > &  y 
)
inlinenoexcept

Constructor.

Precondition
The supplied vectors x and y must have the same size and must contain at least two elements. The vector x must be sorted

Definition at line 37 of file cubic_spline.h.

◆ CubicSpline() [2/2]

ryujin::CubicSpline::CubicSpline ( const CubicSpline copy)
inline

Copy constructor.

Definition at line 56 of file cubic_spline.h.

◆ ~CubicSpline()

ryujin::CubicSpline::~CubicSpline ( )
inline

Destructor.

Definition at line 69 of file cubic_spline.h.

Member Function Documentation

◆ operator=()

CubicSpline & ryujin::CubicSpline::operator= ( const CubicSpline )
delete

The copy assignment operator is deleted.

◆ eval()

double ryujin::CubicSpline::eval ( double  x) const
inline

Evaluate the cubic spline at a given point x.

Precondition
The point x must lie within the interval described by the largest and smallest support point supplied to the constructor.

Definition at line 81 of file cubic_spline.h.


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