DIVDIF
Divided Difference Polynomials
DIVDIF is a C++ library
which creates, prints and manipulates divided difference
polynomials.
Divided difference polynomials are a
systematic method of computing polynomial approximations to scattered
data. The representations are compact, and may easily be updated with
new data, rebased at zero, or analyzed to produce the standard form
polynomial, integral or derivative polynomials.
Other routines are available to convert the divided difference
representation into standard polynomial format. This is a natural
way to determine the coefficients of the polynomial that interpolates
a given set of data, for instance.
One surprisingly simple but useful routine is available to take
a set of roots and compute the divided difference or standard form
polynomial that passes through those roots.
Finally, the Newton-Cotes quadrature formulas can be derived using
divided difference methods, so a few routines are given which can
compute the weights and abscissas of open or closed rules for an
arbitrary number of nodes.
Related Data and Programs:
DIVDIF is also available in
a FORTRAN90 version and
a MATLAB version.
PPPACK
is a FORTRAN90 library of piecewise polynomial functions,
including, in particular, cubic splines.
SPLINE
is a C++ library which includes many routines to construct
and evaluate spline interpolants and approximants.
TEST_APPROX
is a FORTRAN90 library which defines a number of test problems
for approximation and interpolation.
Reference:
-
Carl de Boor,
A Practical Guide to Splines,
Springer Verlag, 1978.
-
Jean-Paul Berrut, Lloyd Trefethen,
Barycentric Lagrange Interpolation,
SIAM Review,
Volume 46, Number 3, September 2004, pages 501-517.
-
F M Larkin,
Root Finding by Divided Differences,
Numerische Mathematik,
Volume 37, pages 93-104, 1981.
Source Code:
Examples and Tests:
List of Routines:
-
DATA_TO_DIF sets up a divided difference table from raw data.
-
DATA_TO_DIF_DISPLAY sets up a divided difference table and prints out intermediate data.
-
DATA_TO_R8POLY computes the coefficients of a polynomial interpolating data.
-
DIF_ANTIDERIV integrates a polynomial in divided difference form.
-
DIF_APPEND adds a pair of data values to a divided difference table.
-
DIF_BASIS computes all Lagrange basis polynomials in divided difference form.
-
DIF_BASIS_I computes the I-th Lagrange basis polynomial in divided difference form.
-
DIF_DERIV computes the derivative of a polynomial in divided difference form.
-
DIF_PRINT prints the polynomial represented by a divided difference table.
-
DIF_SHIFT_ZERO shifts a divided difference table so that all abscissas are zero.
-
DIF_SHIFT_X replaces one abscissa of a divided difference table with a new one.
-
DIF_TO_R8POLY converts a divided difference table to a standard polynomial.
-
DIF_VAL evaluates a divided difference polynomial at a point.
-
NC_RULE computes the weights of a Newton-Cotes quadrature rule.
-
NCC_RULE computes the coefficients of a Newton-Cotes closed quadrature rule.
-
NCO_RULE computes the coefficients of a Newton-Cotes open quadrature rule.
-
R8_SWAP swaps two R8's.
-
R8POLY_ANT_COF integrates a real polynomial in standard form.
-
R8POLY_ANT_VAL evaluates the antiderivative of a real polynomial in standard form.
-
R8POLY_BASIS computes all Lagrange basis polynomials in standard form.
-
R8POLY_BASIS_1 computes the I-th Lagrange basis polynomial in standard form.
-
R8POLY_DER_COF computes the coefficients of the derivative of a real polynomial.
-
R8POLY_DER_VAL evaluates the derivative of a real polynomial in standard form.
-
R8POLY_ORDER returns the order of a polynomial.
-
R8POLY_PRINT prints out a real polynomial in standard form.
-
R8POLY_SHIFT adjusts the coefficients of a polynomial for a new argument.
-
R8POLY_VAL_HORNER evaluates a real polynomial in standard form.
-
R8VEC_DISTINCT is true if the entries in a real vector are distinct.
-
R8VEC_INDICATOR sets a real vector to the indicator vector {1,2,3...}.
-
R8VEC_PRINT prints a real vector.
-
ROOTS_TO_DIF sets a divided difference table for a polynomial from its roots.
-
ROOTS_TO_R8POLY converts polynomial roots to polynomial coefficients.
-
S_LEN_TRIM returns the length of a string to the last nonblank.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to
the C++ source codes.
Last revised on 10 November 2006.