A Numerical Library in C for Scientists and Engineers

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This extensive library of computer programs-written in C language-allows readers to solve numerical problems in areas of linear algebra, ordinary and partial differential equations, optimization, parameter estimation, and special functions of mathematical physics.The library is based on NUMAL, the program assemblage developed and used at the Centre for Mathematics and Computer Science in Amsterdam, one of the world's leading research centers. The important characteristic of the library is its modular structure. Because it is highly compact, it is well-suited for use on personal computers.The library offers the expert a prodigious collection of procedures for implementing numerical methods. The novice can experiment with the worked examples provided and use the more comprehensive procedures to perform mathematical computations. The library provides a powerful research tool for computer scientists, engineers, and applied mathematicians. Applicable materials can be downloaded from the CRC Press website.

Author(s): Hang Tong Lau
Publisher: CRC Press
Year: 1994

Language: English
Pages: 816

A Numerical Library in C for Scientists and Engineers
Dedication
Contents
A Numerical Library in C for Scientists and Engineers
Contents
Chapter 1 Elementary Procedures
1.1 Real vector and matrix - Initialization
A. inivec
B. inimat
C. inimatd
D. inisymd
E. inisymrow
1.2 Real vector and matrix - Duplication
A.dupvec
B. dupvecrow
C. duprowvec
D. dupveccol
E. dupcolvec
F. dupmat
1.3 Real vector and matrix - Multiplication
A. mulvec
B. mulrow
C. mulcol
D. colcst
E. rowcst
1.4 Real vector vector products
A. vecvec
B. matvec
C. tamvec
D. matmat
E. tammat
F. mattam
G. seqvec
H. scaprdl
I. symmatvec
1.5 Real matrix vector products
A. fulmatvec
B. fultamvec
C. fulsymmatvec
D. resvec
E. symresvec
1.6 Real matrix matrix products
A. hshvecmat
B. hshcolmat
C. hshrowmat
D. hshvectam
E. hshcoltam
F. hshrowtam
1.7 Real vector and matrix - Elimination
A. elmvec
B. elmcol
C. elmrow
D. elmveccol
E. elmcolvec
F. elmvecrow
G. elmrowvec
H. elmcolrow
I. elmrowcol
J. maxelmrow
1.8 Real vector and matrix - Interchanging
A. ichvec
B. ichcol
C. ichrow
D. ichrowcol
E. ichseqvec
F. ichseq
A. rotcol
B. rotrow
1.9 Real vector and matrix - Rotation
A. rotcol
B. rotrow
1.10 Real vector and matrix - Norms
A. infnrmvec
B. infnrmrow
C. infnrmcol
D. infnrmmat
E. onenrmvec
F. onenrmrow
G. onenrmcol
H. onenrmmat
I. absmaxmat
1.11 Real vector and matrix - Scaling
reascl
1.12 Complex vector and matrix - Multiplication
A. comcolcst
B. comrowcst
1.13 Complex vector and matrix - Scalar products
A. commatvec
B. hshcomcol
C. hshcomprd
1.14 Complex vector and matrix - Elimination
A. elmcomveccol
B. elmcomcol
C. elmcomrowvec
1.15 Complex vector and matrix - Rotation
A. rotcomcol
B. rotcornrow
C. chsh2
1.16 Complex vector and matrix - Norms
comeucnrm
1.17 Complex vector and matrix - Scaling
A. comscl
B. sclcom
1.18 Complex monadic operations
A. comabs
B. comsqrt
C. carpol
1.19 Complex dyadic operations
A. commul
B. comdiv
1.20 Long integer arithmetic
A. lngintadd
B. lngintsubtract
C. lngintmult
D. lngintdivide
E. lngintpower
A Numerical Library in C for Scientists and Engineers
Contents
Chapter 2 Algebraic Evaluations
2.1 Evaluation of polynomials in Grunert form
A. pol
B. taypol
C. norderpol
D. derpol
2.2 Evaluation of general orthogonal polynomials
A. ortpol
B. ortpolsym
C. allortpol
D. allortpolsym
E. sumortpol
F. sumortpolsym
2.3 Evaluation of Chebyshev polynomials
A. chepolsum
B. oddchepolsum
C. chepol
D. allchepol
2.4 Evaluation of Fourier series
A. sinser
B. cosser
C. fouser
D. fouserl
E. fouser2
F. comfouser
G. comfouserl
H. comfouser2
2.5 Evaluation of continued fractions
jfrac
2.6 Transformation of polynomial representation
A. polchs
B. chspol
C. polshtchs
D. shtchspol
E. grnnew
F. newgrn
G. lintfmpol
2.7 Operations on orthogonal polynomials
intchs
A Numerical Library in C for Scientists and Engineers
Contents
Chapter 3 Linear Algebra
3.1 Full real general matrices
3.1.1 Preparatory procedures
A. dec
B. gsselm
C. onenrminv
D. erbelm
E. gsserb
F. gssnri
3.1.2 Calculation of determinant
determ
3.1.3 Solution of linear equations
A. sol
B. decsol
C. solelm
D. gsssol
E. gsssolerb
3.1.4 Matrix inversion
A. inv
B. decinv
C. invl
D. gssinv
E. gssinverb
3.1.5 Iteratively improved solution
A. itisol
B. gssitisol
C. itisolerb
D. gssitisolerb
3.2 Real Symmetric positive definite matrices
3.2.1 Preparatory procedures
A. chldec2
B. chldecl
3.2.2 Calculation of determinant
A. chldeterm2
B. chldeterml
3.2.3 Solution of linear equations
A. chlsol2
B. chlsoll
C. chldecsol2
D. chldecsoll
3.2.4 Matrix inversion
A. chlinv2
B. chlinvl
C. chldecinv2
D. chldecinvl
3.3 General real symmetric matrices
3.3.1 Preparatory procedure
decsym2
3.3.2 Calculation of determinant
determsym2
3.3.3 Solution of linear equations
A. solsym2
B. decsolsym2
3.4 Real full rank overdetermined systems
3.4.1 Preparatory procedures
A. lsqortdec
B. lsqdglinv
3.4.2 Least squares solution
A. lsqsol
B. lsqortdecsol
3.4.3 Inverse matrix of normal equations
lsqinv
3.4.4 Least squares with linear constraints
A. lsqdecomp
B. lsqrefsol
3.5 Other real matrix problems
3.5.1 Solution of overdetermined systems
A. solsvdovr
B. solovr
3.5.2 Solution of underdetermined systems
A. solsvdund
B. solund
3.5.3 Solution of homogeneous equation
A. homsolsvd
B. homsol
3.5.4 Pseudo-inversion
A. psdinvsvd
B. psdinv
3.6 Real sparse non-symmetric band matrices
3.6.1 Preparatory procedure
decbnd
3.6.2 Calculation of determinant
determbnd
3.6.3 Solution of linear equations
A. solbnd
B. decsolbnd
3.7 Real sparse non-symmetric tridiagonal matrices
3.7.1 Preparatory procedures
A. dectri
B. dectripiv
3.7.2 Solution of linear equations
A. soltri
B. decsoltri
C. soltripiv
D. decsoltripiv
3.8 Sparse symmetric positive definite band matrices
3.8.1 Preparatory procedure
chldecbnd
3.8.2 Calculation of determinant
chldetermbnd
3.8.3 Solution of linear equations
A. chlsolbnd
B. chldecsolbnd
3.9 Symmetric positive definite tridiagonal matrices
3.9.1 Preparatory procedure
decsymtri
3.9.2 Solution of linear equations
A. solsymtri
B. decsolsymtri
3.10 Sparse real matrices - Iterative methods
conjgrad
3.11 Similarity transformation
3.11.1 Equilibration - real matrices
A. eqilbr
B. baklbr
3.11.2 Equilibration - complex matrices
A. eqilbrcom
B. baklbrcom
3.11.3 To Hessenberg form - real symmetric
A. tfmsymtri2
B. baksymtri2
C. tfmprevec
D. tfmsymtril
E. baksymtril
3.11.4 To Hessenberg form - real asymmetric
A. tfmreahes
B. bakreahesl
C. bakreahes2
3.11.5 To Hessenberg form - complex Hermitian
A. hshhrmtri
B. hshhrmtrival
C. bakhrmtri
3.11.6 To Hessenberg form - complex non-Hermitian
A. hshcomhes
B. bakcomhes
3.12 Other transformations
3.12.1 To bidiagonal form - real matrices
A. hshreabid
B. psttfmmat
C. pretfmmat
3.13 The (ordinary) eigenvalue problem
3.13.1 Real symmetric tridiagonal matrices
A. valsymtri
B. vecsymtri
C. qrivalsymtri
D. qrisymtri
3.13.2 Real symmetric full matrices
A. eigvalsym2
B. eigsym2
C. eigvalsym1
D. eigsym1
E. qrivalsym2
F. qrisym
G. qrivalsyml
3.13.3 Symmetric matrices - Auxiliary procedures
A. mergesort
B. vecperm
C. rowperm
3.13.4 Symmetric matrices - Orthogonalization
orthog
3.13.5 Symmetric matrices - Iterative improvement
symeigimp
3.13.6 Asymmetric matrices in Hessenberg form
A. reavalqri
B. reaveches
C. reaqri
D. comvalqri
E. comveches
3.13.7 Real asymmetric full matrices
A. reaeigval
B. reaeigl
C. reaeig3
D. comeigval
E. comeigl
3.13.8 Complex Hermitian matrices
A. eigvalhrm
B. eighrm
C. qrivalhrm
D. qrihrm
3.13.9 Complex upper-Hessenberg matrices
A. valqricom
B. qricom
3.13.10 Complex full matrices
A. eigvalcom
B. eigcom
3.14 The generalized eigenvalue problem
3.14.1 Real asymmetric matrices
A. qzival
B. qzi
C. hshdecmul
D. hestgl3
E. hestgl2
F. hsh2col
G. hsh3col
H. hsh2row3
I. hsh2row2
J. hsh3row3
K. hshrow2
3.15 Singular values
3.1 5.1 Real bidiagonal matrices
A. qrisngvalbid
B. qrisngvaldecbid
3.15.2 Real full matrices
A. qrisngval
B. qrisngvaldec
3.16 Zeros of polynomials
3.16.1 Zeros of general real polynomials
A. zerpol
B. bounds
3.16.2 Zeros of orthogonal polynomials
A. allzerortpol
B. lupzerortpol
C. selzerortpol
D. alljaczer
E. alllagzer
3.16.3 Zeros of complex polynomials
comkwd
A Numerical Library in C for Scientists and Engineers
Contents
Chapter 4 Analytic Evaluations
4.1 Evaluation of an infinite series
A. euler
B. sumposseries
4.2 Quadrature
4.2.1 One-dimensional quadrature
A. qadrat
B. integral
4.2.2 Multidimensional quadrature
tricub
4.2.3 Gaussian quadrature - General weights
A. reccof
B. gsswts
C. gsswtssym
4.2.4 Gaussian quadrature - Special weights
A. gssjacwghts
B. gsslagwghts
4.3 Numerical differentiation
4.3.1 Calculation with difference formulas
A. jacobnnf
B. jacobnmf
C. jacobnbndf
A Numerical Library in C for Scientists and Engineers
Contents
Chapter 5 Analytic Problems
5.1 Non-linear equations
5.1.1 Single equation - No derivative available
A. zeroin
B. zeroinrat
5.1.2 Single equation - Derivative available
zeroinder
5.1.3 System of equations - No Jacobian matrix
A. quanewbnd
B. quanewbndl
5.2 Unconstrained optimization
5.2.1 One variable - No derivative
minin
5.2.3 One variable - Derivative available
mininder
5.2.4 More variables - Auxiliary procedures
A. linemin
B. rnklupd
C. davupd
D. fleupd
5.2.5 More variables - No derivatives
praxis
5.2.6 More variables - Gradient available
A. rnklmin
B. flemin
5.3 Overdetermined nonlinear systems
5.3.1 Least squares - With Jacobian matrix
A. marquardt
B. gssnewton
5.4 Differential equations - Initial value problems
5.4.1 First order - No derivatives right hand side
A. rk1
B. rke
C.rk4a
D. rk4na
E. rk5na
F. multistep
G. diffsys
H. ark
I. efrk
5.4.2 First Order - Jacobian matrix available
A. efsirk
B. eferk
C. linigerlvs
D. liniger2
E. gms
F. impex
5.4.3 First Order - Several derivatives available
A. modifiedtaylor
B. eft
5.4.4 Second order - No derivatives right hand side
A. rk2
B. rk2n
C. rk3
D. rk3n
5.4.5 Initial boundary value problem
arkmat
5.5 Two point boundary value problems
5.5.1 Linear methods - Second order self adjoint
A. femlagsym
B. femlag
C. femlagspher
5.5.2 Linear methods - Second order skew adjoint
femlagskew
5.5.3 Linear methods - Fourth order self adjoint
femhermsym
5.5.4 Non-linear methods
nonlinfemlagskew
5.6 Two-dimensional boundary value problems
5.6.1 Elliptic special linear systems
A. richardson
B. elimination
5.6 Parameter estimation in differential equations
5.6.1 Initial value problems
peide
A Numerical Library in C for Scientists and Engineers
Contents
Chapter 6 Special Functions
6.1 Elementary functions
6.1.1 Hyperbolic functions
A. arcsinh
B. arccosh
C. arctanh
6.1.2 Logarithmic functions
logoneplusx
6.2 Exponential integral
6.2.1 Exponential integral
A. ei
B. eialpha
C. enx
D. nonexpenx
6.2.2 Sine and cosine integral
A. sincosint
B. sincosfg
6.3 Gamma function
A. recipgamma
B. gamma
C. loggamma
D. incomgam
E. incbeta
F. ibpplusn
G. ibqplusn
H. ixqfix
I. ixpfix
J. forward
K. backward
6.4 Error function
A. errorfunction
B. nonexperfc
C. inverseerrorfunction
D. fresnel
E. fg
6.5 Bessel functions of integer order
6.5.1 Bessel functions J and Y
A. bessj0
B. bessj 1
C. bessj
D. bessy01
E. bessy
F. besspq0
G. besspql
6.5.2 Bessel functions I and K
A. bessi0
B. bessil
C. bessi
D. bessk01
E. bessk
F. nonexpbessio
G. nonexpbessil
H. nonexpbessi
I. nonezpbessk01
J. nonexpbessk
6.6 Bessel functions of real order
6.6.1 Bessel functions J and Y
A. bessjaplusn
B. bessya01
C. bessyaplusn
D. besspqa01
E. besszeros
F. start
6.6.2 Bessel functions I and K
A. bessiaplusn
B. besska01
C . besskaplusn
D. nonexpbessiaplusn
E. nonexpbesska01
F. nonexpbesskaplusn
6.6.3 Spherical Bessel functions
A. spherbessj
B. spherbessy
C. spherbessi
D. spherbessk
E. nonexpspherbessi
F. nonexpspherbessk
6.6.4 Airy functions
A. airy
B. airyzeros
A Numerical Library in C for Scientists and Engineers
Contents
Chapter 7 Interpolation and Approximation
7.1 Real data in one dimension
7.1.1 Interpolation with general polynomials
newton
7.1.2 Approximation in infinity norm
A. ini
B. sndremez
C. minmaxpol
Worked Examples
Examples for chapter 1 procedures
hshcomcol, hshcomprd
elmcomcol
rotcomcol
comabs
comsqrt
carpol
commul
comdiv
lngintadd, lngintsubtract, lngintmult, lngintdivide, lngintpower
Examples for chapter 2 procedures
derpol
allortpol
chepolsum
oddchepolsum
chepol, allchepol
fouser
jfrac
chspol, polchs
polshtchs, shtchspol
newgrn, grnnew
lintfmpol
intchs
Examples for chapter 3 procedures
determ, gsselm
decsoll
gsssol
gsssslerb
dercinv
gssinv
gssinvex-
gssitisol
gssitisslerb
chldec2, chlsol2, chlinv2
chldecf, chlsoll, chlinvl
chldecsol2, chldeterm2, chldecinv2
chldecsoll, chlldeteml, chldecinvl
determsym2
deesolsym2
lsqortdec, lsqsol, lsqdglinv
Ilsqsntdecsd
Isqinv
lsqdecomp, lsqrefsol
solovr
solund
hornsol
psdinv
solbnd, decbnd, determbnd
decsolbnd
decsoltri
soltripiv
decsoltripiv
chlsolbnd, chldecbnd, chldetermbnd
chldecsolbnd, chldetermbnd
decsolsymtri
conjgrad
eqilbrcom
hshhrmtri
valsyrntsi, vecsymtri
eigsyml
symeigimp
comvalqri, csmveches
reaeig3
eighrm
qrihrm
valqricom
qricom
eigcom
qzival
qzi
qrisngvaldec
zerpol, bounds
allzerortpol
lupzerortpol
selzerortpol
alljaczer
alllagzer
comkwd
Examples for chapter 4 procedures
euler
sumposseries
qadrat
integral
tricub
reccof
gsswtssym
gssjacwghts
gsslagwghts
jacobnnf
jacobnmf
jacobnbndf
Examples for chapter 5 procedures
zeroin
zeroinrat
zeroinder
quanewbndl
minin
mininder
praxis
rnklmin, flemin
marquardt
gssnewton
rkl
rke
rk4a
rk4na
rWna
multistep
diffsys
ark
efrk
efsirk
eferk
linigerlvs
liniger2
gms
impex
modifiedtaylor
eft
rk2
rk2n
rk3
rk3n
arkmat
femlagsym
fernlag
femlagspher
fernlagskew
femhermsym
nonlinfemlagskew
richardson
elimination
peide
Examples for chapter 6 and 7
ei
eialpha
enx, nonexpenx
sincosint, sincosfg
recipgamma
gamma
loggamma
incomgam
incbeta
ibpplusn
ibqplusn
errorfunction, nonexperfc
inverseerrorfunction
fresnel, fg
bessj0, bessjl, bessj
bessyOl
bessy
besspq0, besspql
bessi, bessk
besskOl
nonexpbesskol
nonexpbessk
bessjaplusn
besspqaol
besszeros
spherbessi, nonexpspherbessi
spherbessk, nonexpspherbessk
airy
airyzeros
newton
ini
sndremez
minmaxpol
A Numerical Library in C for Scientists and Engineers
Contents
Appendix A: References
Appendix B: Prototype Declarations
Appendix C: Procedure Descriptions
Appendix D: Memory Management Utilities