ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
Class and methods for cubic splines

Functions

dvar_vector d3_np_fs (int n, const dvar_vector &_a, const dvar_vector &_b)
 factors and solves a D3 system. More...
 
dvar_vector spline (const dvector &_x, const dvar_vector &_y, double yp1, double ypn)
 Cubic spline interpolation. More...
 
dvar_vector spline (const dvector &_x, const dvar_vector &_y, dvariable yp1, dvariable ypn)
 Cubic spline interpolation. More...
 
dvar_vector spline (const dvector &_x, const dvar_vector &_y, dvariable yp1, double ypn)
 Cubic spline interpolation. More...
 
dvar_vector spline_cubic_set (int n, const dvector &t, const dvar_vector &y, int ibcbeg, dvariable ybcbeg, int ibcend, dvariable ybcend)
 Computes the second derivatives of a piecewise cubic spline. More...
 
dvariable spline_cubic_val (int n, const dvector &_t, double tval, const dvar_vector &_y, const dvar_vector &_ypp)
 Evaluates a piecewise cubic spline at a point. More...
 
dvariable spline_cubic_val2 (int n, const dvector &_t, const prevariable &tval, const dvar_vector &_y, const dvar_vector &_ypp)
 Evaluates a piecewise cubic spline at a point. More...
 
dvariable splint (const dvector &_xa, const dvar_vector &_ya, const dvar_vector &_y2a, double x)
 Cubic spline interpolation allows users to model natural cubic spline (2nd derivative of boundary nodes is set to zero) as an alternative of use of 1st derivative of boundary nodes. More...
 
dvariable splint (const dvector &_xa, const dvar_vector &_ya, const dvar_vector &_y2a, const prevariable &_x)
 Cubic spline interpolation. More...
 

Detailed Description

Function Documentation

dvar_vector d3_np_fs ( int  n,
const dvar_vector _a,
const dvar_vector _b 
)

factors and solves a D3 system.

Parameters
nthe order of the linear system
_aOn input, the nonzero diagonals of the linear system
_bthe right hand side
Returns
the solution of the linear system

Definition at line 530 of file vspline.cpp.

Referenced by spline_cubic_set().

dvar_vector spline ( const dvector _x,
const dvar_vector _y,
double  yp1,
double  ypn 
)

Cubic spline interpolation.

Parameters
_xarray of abscissa
_yarray of corresponding values $y_i=f(x_i)$
yp1value of the first derivative of $f$ at the left end point
ypnvalue of the first derivative of $f$ at the right end point
Returns
an array containing the second derivatives

Definition at line 189 of file vspline.cpp.

dvar_vector spline ( const dvector _x,
const dvar_vector _y,
dvariable  yp1,
dvariable  ypn 
)

Cubic spline interpolation.

Parameters
_xarray of abscissa
_yarray of corresponding values $y_i=f(x_i)$
yp1value of the first derivative of $f$ at the left end point
ypnvalue of the first derivative of $f$ at the right end point
Returns
an array containing the second derivatives

Definition at line 142 of file vspline.cpp.

dvar_vector spline ( const dvector _x,
const dvar_vector _y,
dvariable  yp1,
double  ypn 
)

Cubic spline interpolation.

Parameters
_xarray of abscissa
_yarray of corresponding values $y_i=f(x_i)$
yp1value of the first derivative of $f$ at the left end point
ypnvalue of the first derivative of $f$ at the right end point
Returns
an array containing the second derivatives

Definition at line 236 of file vspline.cpp.

dvar_vector spline_cubic_set ( int  n,
const dvector t,
const dvar_vector y,
int  ibcbeg,
dvariable  ybcbeg,
int  ibcend,
dvariable  ybcend 
)

Computes the second derivatives of a piecewise cubic spline.

Parameters
nThe number of data points. $n$ must be at least 2. In the special case where $n = 2$ and ibcend = ibcend = 0, the spline will actually be linear.
tThe knot values. The knot values should be distinct, and increasing.
yThe data values to be interpolated
ibcbegThe left boundary flag, 0: the cubic spline should be a quadratic over the first interval; 1: the first derivative at the left endpoint should be ybcbeg; 2: the second derivative at the left endpoint should be ybcbeg.
ybcbegThe values to be used in the boundary conditions
ibcendThe right boundary flag, 0: the cubic spline should be a quadratic over the last interval; 1: the first derivative at the right endpoint should be YBCEND; 2: the second derivative at the right endpoint should be YBCEND.
ybcendthe values to be used in the boundary conditions
Returns
the second derivatives of the cubic spline

Definition at line 643 of file vspline.cpp.

Referenced by spline().

dvariable spline_cubic_val ( int  n,
const dvector _t,
double  tval,
const dvar_vector _y,
const dvar_vector _ypp 
)

Evaluates a piecewise cubic spline at a point.

Parameters
nthe number of knots
tthe knot values
tvala point, typically between t[0] and t[N-1], at which the spline is to be evalulated. If tval lies outside this range, extrapolation is used.
ythe data values at the knots
yppthe second derivatives of the spline at the knots
Returns
the value of the spline at tval

Definition at line 284 of file vspline.cpp.

Referenced by splint().

dvariable spline_cubic_val2 ( int  n,
const dvector _t,
const prevariable tval,
const dvar_vector _y,
const dvar_vector _ypp 
)

Evaluates a piecewise cubic spline at a point.

Parameters
nthe number of knots
tthe knot values
tvala point, typically between t[0] and t[n-1], at which the spline is to be evalulated. If tval lies outside this range, extrapolation is used.
ythe data values at the knots
yppthe second derivatives of the spline at the knots
Returns
the value of the spline at tval

Definition at line 409 of file vspline.cpp.

Referenced by splint().

dvariable splint ( const dvector _xa,
const dvar_vector _ya,
const dvar_vector _y2a,
double  x 
)

Cubic spline interpolation allows users to model natural cubic spline (2nd derivative of boundary nodes is set to zero) as an alternative of use of 1st derivative of boundary nodes.

This can be accomplished b setting yp1 and ypn of function spline to >0.99e30

Parameters
_xaarray of abscissa
_yaarray of corresponding values $y_i=f(x_i)$
_y2aarray of 2nd derivatives computed from dvar_vector spline()
xthe input coordinate to be used in the interpolation
Returns
a cubic-spline interpolation to $f(x)$

Definition at line 38 of file vspline.cpp.

dvariable splint ( const dvector _xa,
const dvar_vector _ya,
const dvar_vector _y2a,
const prevariable _x 
)

Cubic spline interpolation.

Parameters
_xaarray of abscissa
_yaarray of corresponding values $y_i=f(x_i)$
_y2aarray of 2nd derivatives computed from dvar_vector spline()
xthe input coordinate to be used in the interpolation
Returns
a cubic-spline interpolation to $f(x)$

Definition at line 57 of file vspline.cpp.