# PPPACK Piecewise Polynomial Package

PPPACK is a FORTRAN90 library which evaluates piecewise polynomial functions, including cubic splines. The original FORTRAN77 library is by Carl de Boor.

An original, true, correct version of PPPACK is available at http://www.netlib.org/pppack/index.html Files shown here are modifications made in pursuance of my own interests and needs, and should not be considered in preference to the original versions.

### Piecewise Polynomial Functions:

Typically, a set of data ( X(I), Y(I) ) for I=1, L+1 is available which is to be interpolated. A function F(X) is to be found which passes through the given data. F(X) is to be constructed from some order of polynomials, often cubic, and is to be continuously differentiable to all orders except at certain 'break' points, most likely at the same X points given with the data. Thus, to determine the types of functions F we can construct, it is necessary to specify the number of break points L+1, or intervals L, the location of the breakpoints 'BREAK', the values that the function is to assume at the breakpoints 'Y' or some other condition, and the order 'K' of the polynomial pieces. Sometimes auxilliary information, such as the slope or second derivative of the function at the left and right endpoints is part of the prescription.

Given a set of interpolating conditions or other requirements, the piecewise polynomial routines that follow will produce or manipulate a representation of the function F which has the form:

```
( BREAK, PCOEF, K, L )
```

These quantities represent the function F in the following way. If a point X is between breakpoints BREAK(I) and BREAK(I+1), then set

```
H = X - BREAK(I),
```
and we have
```
F(X)= PCOEF(1,I)
+ PCOEF(2,I) * H
+ PCOEF(3,I) * H^2 / 2!
+ PCOEF(4,I) * H^3 / 3!
...
+ PCOEF(K,I) * H^(K-1) /(K-1)!
```

Note that the piecewise polynomial functions make F and its derivatives continuous from the right. Thus at the break point I+1, we use the definition of F appropriate for the interval ( BREAK(I+1), BREAK(I+2) ) and not ( BREAK(I), BREAK(I+1) ).

Note also that the behavior of the function F for X values below the first breakpoint BREAK(1) or above the last breakpoint BREAK(L+1) is not specified. In fact, generally, F is set to zero below BREAK(1), and the definition of F on the last interval ( BREAK(L), BREAK(L+1) ) is extended all the way to the right.

Whenever you have a piecewise polynomial representation of the above form, you can evaluate the function F(X) by calling the function PPVALU. Moreover, other routines like BSPLPP can convert a B-spline representation into a piecewise polynomial representation. Also, KNOTS can use the information in the breakpoint sequence BREAK, with the continuity conditions required, to construct an equivalent knot sequence for a B-spline.

### Languages:

PPPACK is available in a FORTRAN90 version.

### Related Data and Programs:

BERNSTEIN_POLYNOMIAL, a FORTRAN90 library which evaluates the Bernstein polynomials, useful for uniform approximation of functions;

DIVDIF, a FORTRAN90 library which computes interpolants by divided differences.

HERMITE, a FORTRAN90 library which computes the Hermite interpolant, a polynomial that matches function values and derivatives.

SLATEC, a FORTRAN90 library which includes PPPACK.

SPLINE, a FORTRAN90 library which includes many routines to construct and evaluate spline interpolants and approximants.

TEST_APPROX, a FORTRAN90 library which defines a number of test problems for approximation and interpolation.

Carl de Boor

### Reference:

1. Samuel Conte, Carl de Boor,
Elementary Numerical Analysis,
Second Edition,
McGraw Hill, 1972,
ISBN: 07-012446-4,
LC: QA297.C65.
2. Carl de Boor,
A Practical Guide to Splines,
Springer, 2001,
ISBN: 0387953663,
LC: QA1.A647.v27.
3. Roger Martin, James Wilkinson,
Solution of Symmetric and Unsymmetric Band Equations and the Calculation of Eigenvectors of Band Matrices,
Numerische Mathematik,
Volume 9, Number 4, December 1976, pages 279-301.

### List of Routines:

• BANFAC factors a banded matrix without pivoting.
• BANSLV solves a banded linear system A * X = B factored by BANFAC.
• BCHFAC constructs a Cholesky factorization of a matrix.
• BCHSLV solves a banded symmetric positive definite system.
• BSPLPP converts from B-spline to piecewise polynomial form.
• BSPLVB evaluates B-splines at a point X with a given knot sequence.
• BSPLVD calculates the nonvanishing B-splines and derivatives at X.
• BSPP2D converts from B-spline to piecewise polynomial representation.
• BVALUE evaluates a derivative of a spline from its B-spline representation.
• CHOL1D sets up and solves linear systems needed by SMOOTH.
• COLLOC solves an ordinary differential equation by collocation.
• COLPNT supplies collocation points.
• CUBSPL defines an interpolatory cubic spline.
• CWIDTH solves an almost block diagonal linear system.
• DIFEQU returns information about a differential equation.
• DTBLOK gets the determinant of an almost block diagonal matrix.
• EQBLOK is to be called in COLLOC.
• EVNNOT is a version of NEWNOT returning uniform knots.
• FACTRB constructs a partial PLU factorization.
• FCBLOK supervises the PLU factorization of an almost block diagonal matrix.
• INTERV brackets a real value in an ascending vector of values.
• KNOTS is to be called in COLLOC.
• L2APPR constructs a weighted L2 spline approximation to given data.
• L2ERR computes the errors of an L2 approximation.
• L2KNTS converts breakpoints to knots.
• NEWNOT returns LNEW+1 knots which are equidistributed on (A,B).
• PPVALU evaluates a piecewise polynomial function or its derivative.
• PUTIT puts together one block of the collocation equation system.
• R8VEC_PRINT prints an R8VEC.
• ROUND is called to add some noise to data.
• SBBLOK solves a linear system that was factored by FCBLOK.
• SETUPQ is to be called in SMOOTH.
• SHIFTB shifts the rows in the current block.
• SLVBLK solves the almost block diagonal linear system A * x = b.
• SMOOTH constructs the cubic smoothing spline to given data.
• SPLI2D produces a interpolatory tensor product spline.
• SPLINT produces the B-spline coefficients BCOEF of an interpolating spline.
• SPLOPT computes the knots for an optimal recovery scheme.
• SUBBAK carries out back substitution for the current block.
• SUBFOR carries out the forward pass of substitution for the current block.
• TAUTSP constructs a cubic spline interpolant to given data.
• TITANIUM represents a temperature dependent property of titanium.

You can go up one level to the FORTRAN90 source codes.

Last revised on 14 February 2006.