14

SUN/194.3

Starlink Project
Starlink User Note 194.3

H. Meyerdierks, D. Berry, P. W. Draper, G. Privett, M. Currie

12th October 2005


PDA
Public Domain Algorithms

Version 0.5

Programmer’s Manual

pdfpict

Abstract

The PDA library provides numerical algorithm code that can be used to replace NAG in open source software.

Contents

1 Introduction
2 Packages from which the routines were obtained
3 Routine naming
4 I/O and error handling
5 Machine dependencies
6 Test programs
7 Linking with the library
8 Fast Fourier transform (FFT)
 8.1 Differences between NAG and FFTPACK
 8.2 Data formats for FFTPACK and NAG
  8.2.1 Fourier transforms of sequences of purely real values
  8.2.2 Fourier transforms of sequences of complex values
 8.3 Replacing calls to C06FAF
 8.4 Replacing calls to C06FBF
 8.5 Replacing calls to C06FCF
  8.5.1 Forward transforms
  8.5.2 Inverse transforms
 8.6 Replacing calls to C06FJF
  8.6.1 Forward transforms
  8.6.2 Inverse transforms
 8.7 Replacing calls to C06FUF
 8.8 Replacing calls to C06GBF and C06GCF
9 One-dimensional Interpolation and Fitting, Splines
 9.1 B-splines
 9.2 Ordinary polynomials
 9.3 Replacing calls to E01BAF
 9.4 Replacing calls to E02BAF
 9.5 Replacing calls to E02BBF
 9.6 Replacing calls to E02BCF
 9.7 Replacing calls to E02BDF
 9.8 Replacing calls to E02BEF
 9.9 Replacing calls to E02ADF
 9.10 Replacing calls to E02AEF
 9.11 Replacing calls to E02AKF
 9.12 Replacing calls to GEN_CHB2NO
10 Two-dimensional Interpolation and Fitting
 10.1 Replacing calls to E02DAF
 10.2 Replacing calls to E02SAF
 10.3 Replacing calls to E02CBF
11 Minimisation
 11.1 Overview
 11.2 Replacing calls to E04DGF and E04DKF
 11.3 Replacing calls to E04FDF and E04GBF
 11.4 Replacing calls to E04HCF
 11.5 Replacing calls to E04JAF and E04KDF
 11.6 Replacing calls to E04YCF
12 Matrices
 12.1 Overview
 12.2 Replacing calls to F01AAF
 12.3 Replacing calls to F01ABF
 12.4 Replacing calls to F04AAF
 12.5 Replacing calls to F04AEF
 12.6 Replacing calls to F04ANF and F01AXF
 12.7 Replacing calls to F04ASF and F04ATF
 12.8 Replacing calls to F04QAF
13 Sorting
 13.1 Replacing calls to M01DJF
14 Normal Distribution
15 Bessel Functions
16 Simple Statistics
 16.1 Replacing calls to G01DBF
 16.2 Replacing calls to G01DCF
17 Pseudo-Random Numbers
 17.1 Setting the seed (replacements for G05CBF and G05CCF)
 17.2 Data type of the random numbers
 17.3 Replacements for G05CAF and G05DAF
 17.4 Replacement for G05DBF
 17.5 Replacements for G05DDF, G05DRF, and G05FFF
A User-callable routines
PDA_BISPEV – Evaluates the bivariate spline approximation found by PDA_SURFIT.
PDA_BSPDOC – Documentation for working with piecewise polynomial functions in B-representation.
PDA_C2NAG – Convert FFTPACK complex Fourier transform array into equivalent NAG arrays
PDA_CFFTB – Unnormalized inverse of PDA_CFFTF.
PDA_CFFTF – Forward transform of a complex periodic sequence.
PDA_CFFTI – Initialize PDA_CFFTF and PDA_CFFTB.
PDA_CHE2D – Evaluates a 2-dimensional Chebyshev polynomial
PDA_COVMAT – Approximates the covariance matrix of normal order statistics
PDA_CURFIT – Smooth spline approximation. Knots can be given or determined by the routine.
PDA_D1MACH – Floating point machine dependent constants
PDA_DB2INK – Determines the parameters of a 2-D, interpolation function for gridded data.
PDA_DB2VAL – Evaluates the piecewise polynomial interpolating function constructed by the routine PDA_DB2INK, or one of its partial derivatives.
PDA_DBESJ1 – Bessel function of first kind of order one.
PDA_DBINTK – Compute B-representation of an interpolating spline. Knots must be given.
PDA_DBOLS – Solve E * x = f (in least squares sense) with bounds on x. E is a matrix, x and f are vectors.
PDA_DBSQAD – Integral of a B-spline using the B-representation.
PDA_DBVALU – Evaluate a B-spline for the function value or a derivative.
PDA_DC2NAG – Convert FFTPACK complex Fourier transform array into equivalent NAG arrays
PDA_DCFFTB – Unnormalized inverse of PDA_DCFFTF.
PDA_DCFFTF – Forward transform of a complex periodic sequence.
PDA_DCFFTI – Initialize PDA_DCFFTF and PDA_DCFFTB.
PDA_DCOV – Calculates the covariance matrix for a nonlinear data fitting problem
PDA_DEFC – Fit piecewise polynomial curve represented as B-splines (weighted least squares sense).
PDA_DEFLT – Set default parameters for use by PDA_SUMSL.
PDA_DERF – Error function erf().
PDA_DERFC – Complementary error function erfc().
PDA_DGEDI – Determinant and inverse of a matrix using the factors from PDA_DGEFA.
PDA_DGEFA – Factor a matrix using Gaussian elimination. This is needed before PDA_DGEDI.
PDA_DGEFS – Solve the problem A * x = b. A is a square matrix, x and b are vectors. Factoring of A can be re-used to solve for multi-column X and B.
PDA_DNAG2C – Convert NAG complex Fourier transform array into array usable by FFTPACK routine PDA_DCFFTB
PDA_DNAG2R – Convert NAG Hermitian Fourier transform array into array usable by FFTPACK routine PDA_DRFFTB
PDA_DNFFTB – Backward FFT of N-dimensional complex array
PDA_DNFFTF – Forward FFT of N-dimensional complex array
PDA_DNLS1 – Minimises the sum of squares of M non-linear functions
PDA_DNLS1E – Minimises the sum of squares of M non-linear functions (easy version)
PDA_DP1VLU – Use coefficients from PDA_DPOLFT to evaluate polynomial fit and its derivatives.
PDA_DPCOEF – Convert the PDA_DPOLFT coefficients to Taylor series form.
PDA_DPLINT – Produce the polynomial which interpolates a set of discrete data points.
PDA_DPOLCF – Coefficients of the polynomial fit (including Hermite polynomial fits) produced by PDA_DPLINT.
PDA_DPOLFT – Weighted least-squares polynomial fit.
PDA_DPOLVL – Evaluate polynomial and its derivatives as produced by PDA_DPLINT.
PDA_DQED – Solves bounded nonlinear least squares and nonlinear equations.
PDA_DR2NAG – Convert FFTPACK Hermitian Fourier transform array into equivalent NAG array
PDA_DRFFTB – Backward transform of a real coefficient array.
PDA_DRFFTF – Forward transform of a real periodic sequence.
PDA_DRFFTI – Initialize PDA_DRFFTF and PDA_DRFFTB.
PDA_DSORT – Sort array and optionally make same interchanges in auxiliary array.
PDA_I1MACH – Integer machine dependent constants
PDA_IDBVIP – Performs 2-D bivariate interpolation when the data is irregularly scattered in the x-y plane.
PDA_IDSFFT – Performs smooth surface fitting when the projections of the data points in the x-y plane are irregularly distributed in the plane.
PDA_IPERM – Forms the inverse of a permutation
PDA_LMDIF – Minimise the sum of the squares of m nonlinear functions in n variables, function only.
PDA_LMDIF1 – Minimise the sum of the squares of m nonlinear functions in n variables, simple interface to PDA_LMDIF.
PDA_LSQR – Solves sparse unsymmetric, linear least squares and damped least squares problems
PDA_NAG2C – Convert NAG complex Fourier transform array into array usable by FFTPACK routine PDA_CFFTB
PDA_NAG2R – Convert NAG Hermitian Fourier transform array into array usable by FFTPACK routine PDA_RFFTB
PDA_NFFTB – Backward FFT of N-dimensional complex array
PDA_NFFTF – Forward FFT of N-dimensional complex array
PDA_NSCOR – Calculates the approximate expected values of normal order statistics.
PDA_PPND16 – Returns the normal deviate corresponding to a given lower tail area of P
PDA_QSAx – Sort an array into ascending order
PDA_QSDx – Sort an array into descending order
PDA_QSIAx – Sort an array of pointers to access an array in ascending order
PDA_QSIDx – Sort an array of pointers to access an array in descending order
PDA_R2NAG – Convert FFTPACK Hermitian Fourier transform array into equivalent NAG array
PDA_RAND – Returns pseudo-random numbers in the range 0 to 1
PDA_RFFTB – Backward transform of a real coefficient array.
PDA_RFFTF – Forward transform of a real periodic sequence.
PDA_RFFTI – Initialize PDA_RFFTF and PDA_RFFTB.
PDA_RINPx – Reorder an array in place using a permutation index
PDA_RNEXP – Returns pseudo-random numbers from an exponential distribution
PDA_RNGAM – Returns pseudo-random numbers from a gamma distribution
PDA_RNNOR – Returns pseudo-random numbers from a Gaussian distribution
PDA_RNPOI – Returns pseudo-random numbers from a Poisson distribution
PDA_RNSED – Sets the seed for the PDA random-number generators
PDA_SA – Continuous simulated annealing global optimisation algorithm. Simple constraints can be specified.
PDA_SAACx – Sorts the columns of a two dimensional array into ascending order
PDA_SAARx – Sorts the rows of a two dimensional array into ascending order
PDA_SPLDER – Evaluate derivative of spline, given in its B-spline representation from PDA_CURFIT.
PDA_SPLEV – Evaluate spline, given in its B-spline representation from PDA_CURFIT.
PDA_SPLINT – Calculate integral of spline, given its normalised B-spline representation from PDA_CURFIT.
PDA_SUBPLX – Subspace-searching simplex method for unconstrained optimization
PDA_SUMSL – Unconstrained minimisation of a smooth non-linear function of n variables, function and gradients supplied.
PDA_SURFIT – Find a bivariate spline approximation to irregularly spaced 2-D data.
PDA_UNCMND – Minimise smooth non-linear function of n variables, function values only.
PDA_V11 – Calculates an approximation to the variance of the largest normal order statistic
PDA_XERMSG – Process error messages for SLATEC and other libraries

B Adding further routines
C Changes
 C.1 Changes from version 0.4 to 0.5
 C.2 Changes from version 0.3 to 0.4