LinearSpline1D

class LinearSpline1D

Linear spline is the same as linear interpolation. A piece-wise cubic polynomials with equal value at each knot point.

\( y = C_0 + C_1 x \)

Public Functions

LinearSpline1D(const std::vector<double> &ycoord)

Initialize from a set y coordinates that are equally-spaced in x. The dimensionless variable z = (x - x_lower) / (x_upper - x_lower) spans the range from 0 to 1.

double interpolate(const double z) const

Interpolate as a function of z.

class LinearSpline2D

Public Functions

LinearSpline2D(const vec2 &ycoord)

Initialize from a set y coordinates that are equally-spaced in x. The dimensionless variables xs = (x - x_lower) / (x_upper - x_lower) spans the range from 0 to 1.

double interpolate(const double xs, const double ys) const

Interpolate as a function of scaled x and y.

class QuadraticSpline1D

Quadratic spline is a piece-wise quadratic polynomials with equal value and equal derivative at each knot point.

\( y = C_0 + C_1 x + C_2 x^2 \)

Public Functions

QuadraticSpline1D(const std::vector<double> &ycoord, const double right_endpoint_derivative = 0.)

Initialize from a set y coordinates that are equally-spaced in x. The dimensionless variable z = (x - x_lower) / (x_upper - x_lower) spans the range from 0 to 1.

double interpolate(const double z) const

Interpolate as a function of z.