## Index of Code Files by Book Section

Note: Book section links are active for subscribers to Numerical Recipes Electronic, or as manual references to the hardcopy book. Webnote links are active for anyone. You must be connected to the Internet for these links to work. Links to files (ending in .h) are local to Numerical Recipes Code and do not require an Internet connection.

1.0 Introduction
calendar.h calendar routines

1.4 Vector and Matrix Objects
nr3.h defines Numerical Recipes classes used by all routines

2.1 Gauss-Jordan Elimination
gaussj.h Gauss-Jordan decomposition

2.3 LU Decomposition and Its Applications
ludcmp.h LU decomposition and related

2.4 Tridiagonal and Band-Diagonal Systems of Equations
tridag.h solve tridiagonal linear systems
banded.h routines for banded matrices

2.5 Iterative Improvement of a Solution to Linear Equations
ludcmp.h LU decomposition and related

2.6 Singular Value Decomposition
svd.h singular value decomposition

2.7 Sparse Linear Systems
tridag.h solve tridiagonal linear systems
sparse.h sparse matrix routines
linbcg.h solution of sparse linear system by biconjugate gradient method
asolve.h biconjugate gradient sparse linear solver (example)

2.8 Vandermonde Matrices and Toeplitz Matrices
vander.h solve Vandermonde linear systems
toeplz.h solve Toepltz linear systems

2.9 Cholesky Decomposition
cholesky.h Cholesky decomposition

2.10 QR Decomposition
qrdcmp.h QR decomposition and related

3.1 Preliminaries: Searching an Ordered Table
interp_1d.h interpolation routines for one dimension
interp_linear.h linear interpolation

3.2 Polynomial Interpolation and Extrapolation
interp_1d.h interpolation routines for one dimension

3.3 Cubic Spline Interpolation
interp_1d.h interpolation routines for one dimension

3.4 Rational Function Interpolation and Extrapolation
interp_1d.h interpolation routines for one dimension

3.5 Coefficients of the Interpolating Polynomial
polcoef.h polynomial coefficients from polynomial values

3.6 Interpolation on a Grid in Multidimensions
interp_2d.h interpolation routines for two dimensions

3.7 Interpolation on Scattered Data in Multidimensions
interp_rbf.h interpolation by radial basis functions
krig.h fitting or interpolation by kriging
interp_curve.h interpolate along a curve

3.8 Laplace Interpolation
interp_laplace.h Laplace interpolation on a grid

4.2 Elementary Algorithms

4.3 Romberg Integration

4.4 Improper Integrals

4.6 Gaussian Quadratures and Orthogonal Polynomials
gauss_wgts.h weights for Gaussian and related quadratures

4.8 Multidimensional Integrals

5.1 Polynomials and Rational Functions
poly.h operations on polynomials

5.3 Series and Their Convergence
series.h routines for summing a series
levex.h sample program for Levin transformation

5.7 Numerical Derivatives
dfridr.h numerical derivative by Ridders' method

5.8 Chebyshev Approximation
chebyshev.h Chebyshev approximation and related

5.9 Derivatives or Integrals of a Chebyshev-Approximated Function
chebyshev.h Chebyshev approximation and related

5.10 Polynomial Approximation from Chebyshev Coefficients
chebyshev.h Chebyshev approximation and related
pcshft.h shift a polynomial

5.11 Economization of Power Series
pcshft.h shift a polynomial
chebyshev.h Chebyshev approximation and related

5.13 Rational Chebyshev Approximation
ratlsq.h rational function fitting

6.1 Gamma, Beta, and Related Functions
gamma.h gamma function and related

6.2 Incomplete Gamma Function
incgammabeta.h incomplete gamma and beta functions
erf.h error function and related distributions

6.3 Exponential Integrals
expint.h exponential integral

6.4 Incomplete Beta Function
incgammabeta.h incomplete gamma and beta functions

6.5 Bessel Functions of Integer Order
bessel.h Bessel functions of integer order

6.6 Bessel Functions of Fractional Order
besselfrac.h Bessel functions of fractional order

6.7 Spherical Harmonics
plegendre.h Legendre functions and spherical harmonics

6.8 Fresnel Integrals, Cosine and Sine Integrals
frenel.h Fresnel integrals
cisi.h cosine and sine integrals

6.9 Dawson's Integral
dawson.h Dawson's integral

6.10 Generalized Fermi-Dirac Integrals
fermi.h Fermi-Dirac integrals

6.11 Inverse of the Function x log(x)
ksdist.h Kolmogorov-Smirnov distribution functions

6.12 Elliptic Integrals and Jacobian Elliptic Functions
elliptint.h elliptic integrals

6.13 Hypergeometric Functions
hypgeo.h hypergeometric function

6.14 Statistical Functions
erf.h error function and related distributions
distributions.h probability distributions and related
incgammabeta.h incomplete gamma and beta functions
ksdist.h Kolmogorov-Smirnov distribution functions

7.1 Uniform Deviates
ran.h random number generators

7.2 Completely Hashing a Large Array
hashall.h hash a large array

7.3 Deviates from Other Distributions
deviates.h random deviates from various distributions

7.4 Multivariate Normal Deviates
multinormaldev.h multivariate normal deviates

7.5 Linear Feedback Shift Registers
primpolytest.h test whether a polynomial is primitive

7.6 Hash Tables and Hash Memories
hash.h routines for hash tables and hash memory

7.7 Simple Monte Carlo Integration
mcintegrate.h Monte Carlo integration

7.8 Quasi- (that is, Sub-) Random Sequences
sobseq.h Sobol quasi-random sequence

8.1 Straight Insertion and Shell's Method
sort.h sorting and related routines

8.2 Quicksort
sort.h sorting and related routines

8.3 Heapsort
sort.h sorting and related routines

8.4 Indexing and Ranking
sort.h sorting and related routines

8.5 Selecting the Mth Largest
sort.h sorting and related routines
iqagent.h estimate distribution function from a sample

8.6 Determination of Equivalence Classes
eclass.h find equivalence classes

9.0 Introduction
scrsho.h plot a function interactively

9.1 Bracketing and Bisection
roots.h routines for root finding in one dimension

9.2 Secant Method, False Position Method, and Ridders' Method
roots.h routines for root finding in one dimension

9.3 Van Wijngaarden-Dekker-Brent Method
roots.h routines for root finding in one dimension

9.4 Newton-Raphson Method Using Derivative
roots.h routines for root finding in one dimension

9.5 Roots of Polynomials
roots_poly.h roots of a polynomial
zrhqr.h polynomial roots by eigenvalue method
qroot.h Bairstow's method for complex root

9.6 Newton-Raphson Method for Nonlinear Systems of Equations
mnewt.h multidimensional Newton root finding

9.7 Globally Convergent Methods for Nonlinear Systems of Equations
roots_multidim.h routines for root finding in multidimensions

10.1 Initially Bracketing a Minimum
mins.h minimization routines

10.2 Golden Section Search in One Dimension
mins.h minimization routines

10.3 Parabolic Interpolation and Brent's Method
mins.h minimization routines

10.4 One-Dimensional Search with First Derivatives
mins.h minimization routines

10.5 Downhill Simplex Method in Multidimensions
amoeba.h downhill simplex minimization

10.6 Line Methods in Multidimensions
mins_ndim.h minimization routines in multidimensions

10.7 Direction Set (Powell's) Methods in Multidimensions
mins_ndim.h minimization routines in multidimensions

10.8 Conjugate Gradient Methods in Multidimensions
mins_ndim.h minimization routines in multidimensions

10.9 Quasi-Newton or Variable Metric Methods in Multidimensions
quasinewton.h quasi-Newton or DFP multidimensional minimization

10.11 Linear Programming: Interior-Point Methods
interior.h linear programming by interior point method

10.13 Dynamic Programming
dynpro.h dynamic programming
stringalign.h Needleman-Wunsch string alignment

11.1 Jacobi Transformations of a Symmetric Matrix
eigen_sym.h routines for eigenproblems on symmetric matrices

11.2 Real Symmetric Matrices
eigen_sym.h routines for eigenproblems on symmetric matrices

11.3 Reduction of a Symmetric Matrix to Tridiagonal Form
eigen_sym.h routines for eigenproblems on symmetric matrices

11.4 Eigenvalues and Eigenvectors of a Tridiagonal Matrix
eigen_sym.h routines for eigenproblems on symmetric matrices

11.6 Real Nonsymmetric Matrices
eigen_unsym.h routines for eigenproblems on nonsymmetric matrices

12.2 Fast Fourier Transform (FFT)
fourier.h FFT routines in one dimension

12.3 FFT of Real Functions
fourier.h FFT routines in one dimension

12.4 Fast Sine and Cosine Transforms
fourier.h FFT routines in one dimension

12.5 FFT in Two or More Dimensions
fourier_ndim.h FFT routines in multidimensions

12.6 Fourier Transforms of Real Data in Two and Three Dimensions
fourier_ndim.h FFT routines in multidimensions
rlft3_sharpen.h example using FFT to sharpen an image

13.1 Convolution and Deconvolution Using the FFT
convlv.h data convolution

13.2 Correlation and Autocorrelation Using the FFT
correl.h data correlation

13.4 Power Spectrum Estimation Using the FFT
spectrum.h spectral estimation using FFTs

13.6 Linear Prediction and Linear Predictive Coding
linpredict.h linear prediction

13.7 Maximum Entropy (All-Poles) Method
linpredict.h linear prediction

13.8 Spectral Analysis of Unevenly Sampled Data
period.h Lomb periodogram for spectral analysis
fasper.h fast evaluation of Lomb periodogram

13.9 Computing Fourier Integrals Using the FFT
dftintegrate.h Fourier integrals using FFT

13.10 Wavelet Transforms
wavelet.h wavelet routines

14.1 Moments of a Distribution: Mean, Variance, Skewness
moment.h calculate moments of samples

14.2 Do Two Distributions Have the Same Means or Variances?
stattests.h various statistical tests
moment.h calculate moments of samples

14.3 Are Two Distributions Different?
stattests.h various statistical tests
kstests.h Kolmogorov-Smirnov tests in one dimension

14.4 Contingency Table Analysis of Two Distributions
stattests.h various statistical tests

14.5 Linear Correlation
stattests.h various statistical tests

14.6 Nonparametric or Rank Correlation
stattests.h various statistical tests

14.8 Do Two-Dimensional Distributions Differ?
kstests_2d.h Kolmogorov-Smirnov tests in two dimensions
quadvl.h used in two-dimensional K-S test

14.9 Savitzky-Golay Smoothing Filters
savgol.h Savitzky-Golay filters

15.2 Fitting Data to a Straight Line
fitab.h fit a straight line

15.4 General Linear Least Squares
fitlin.h general linear fit
fitsvd.h general linear fit using SVD
fit_examples.h examples for fitting

15.5 Nonlinear Models
fitmrq.h Levenberg-Marquardt nonlinear fitting
fit_examples.h examples for fitting

15.7 Robust Estimation
fitmed.h fit a line minimizing absolute deviation

15.8 Markov Chain Monte Carlo
mcmc.h Markov chain Monte Carlo routines

16.1 Gaussian Mixture Models and k-Means Clustering
gaumixmod.h Gaussian mixture models
kmeans.h k-means classification

16.3 Markov Models and Hidden Markov Modeling
markovgen.h Markov model generator
hmm.h hidden Markov models

16.4 Hierarchical Clustering by Phylogenetic Trees
phylo.h phylogenetic tree algorithms

16.5 Support Vector Machines
svm.h support vector machines

17.0 Introduction
odeint.h ordinary differential equations
stepper.h base class for ODE steppers

17.1 Runge-Kutta Method
rk4.h Runge-Kutta integration (pedagogical example)

17.2 Adaptive Stepsize Control for Runge-Kutta
stepperdopr5.h Dormand-Prince fifth-order stepper

17.3 Richardson Extrapolation and the Bulirsch-Stoer Method
stepperbs.h Bulirsch-Stoer stepper base class

17.4 Second-Order Conservative Equations
stepperstoerm.h Bulirsch-Stoer stepper, second-order equations

17.5 Stiff Sets of Equations
stepperross.h fourth-order stiffly stable Rosenbrock stepper

17.7 Stochastic Simulation of Chemical Reaction Networks
stochsim.h stochastic simulation of ODEs

18.1 The Shooting Method
shoot.h two point boundary problem by shooting

18.2 Shooting to a Fitting Point
shootf.h two point boundary problem by shooting to a fitting point

18.4 A Worked Example: Spheroidal Harmonics
sfroid.h spheroidal harmonics example using relaxation method
difeq.h example solving two point boundary problem by relaxation
sphoot.h spheroidal harmonics example using shooting
sphfpt.h spheroidal harmonics example using shooting to a fitting point

19.1 Fredholm Equations of the Second Kind
fred2.h linear Fredholm equations of the second kind

19.2 Volterra Equations
voltra.h Volterra integral equations

19.3 Integral Equations with Singular Kernels
fred_singular.h singular Fredholm equations

20.5 Relaxation Methods for Boundary Value Problems
sor.h successive over-relaxation

20.6 Multigrid Methods for Boundary Value Problems
mglin.h full multigrid method (FMG) for linear equation
mgfas.h multigrid method full approximation storage

20.7 Spectral Methods
weights.h differentiation matrix for spectral methods

21.1 Points and Boxes
pointbox.h geometric point and box
kdtree.h KD-tree routines

21.2 KD Trees and Nearest-Neighbor Finding
kdtree.h KD-tree routines

21.3 Triangles in Two and Three Dimensions
circumcircle.h circumcircle of three points

21.4 Lines, Line Segments, and Polygons
polygon.h geometric polygon

21.6 Triangulation and Delaunay Triangulation
delaunay.h Delaunay triangulation

21.7 Applications of Delaunay Triangulation
delaunay.h Delaunay triangulation
voronoi.h construct Voronoi diagram

21.8 Quadtrees and Octrees: Storing Geometrical Objects
sphcirc.h geometrical circle or sphere
qotree.h QO-tree routines

22.1 Plotting Simple Graphs
psplotexample.h generate a PostScript plot (example)

22.3 Gray Codes
igray.h Gray code

22.4 Cyclic Redundancy and Other Checksums
icrc.h cyclic redundancy checksum
decchk.h decimal digit error check

22.5 Huffman Coding and Compression of Data
huffcode.h Huffman compression

22.6 Arithmetic Coding
arithcode.h compression by arithmetic coding

22.7 Arithmetic at Arbitrary Precision
mparith.h multiprecision arithmetic

Webnote.3 Implementation of Stiel
stiel.h Stieltjes procedure for quadrature weights

Webnote.9 Complete VEGAS Code
rebin.h used by vegas.h

Webnote.10 Complete miser Code
ranpt.h used by miser.h

Webnote.11 Code Listing for selip
selip.h select Mth largest in place

Webnote.12 Routine Implementing the Simplex Method
simplex.h linear programming by simplex method

Webnote.14 Code Implementation for the Traveling Salesman Problem
anneal.h simulated annealing

Webnote.15 Code for Minimization with Simulated Annealing
amebsa.h downhill simplex minimization with simulated annealing

Webnote.18 Code for External or Memory-Local Fourier Transform
fourfs.h FFT on external storage

Webnote.19 Code Listing fitexy
fitexy.h fit a line with errors in both x and y

Webnote.20 Routine Implementing Eighth-order Runge-Kutta
stepperdopr853.h Dormand-Prince eighth-order stepper

Webnote.24 StepperSie Implementation
steppersie.h semi-implicit extrapolation stepper

Webnote.25 Solvde Implementation
solvde.h relaxation solution of ODEs

Webnote.26 Code for PSpage and PSplot
psplot.h generate a PostScript plot

Webnote.27 Code for machar
machar.h probe machine characteristics