\input texinfo @c -*-texinfo-*-
@c This will be for the printing version of the manual
@c @input config-local.texi
@c %**start of header
@setfilename gsl-ref.info
@settitle GNU Scientific Library -- Reference Manual
@finalout
@ifset publish
@set frontcontents
@setchapternewpage odd
@end ifset
@c %**end of header

@dircategory Scientific software
@direntry
* gsl-ref: (gsl-ref).                   GNU Scientific Library -- Reference
@end direntry

@c How to use the math macros
@c ==========================
@c 
@c For simple expressions, simply use the @math{} command, e.g.
@c
@c     @math{\exp(x)/(1+x^2)}
@c 
@c but if the expression includes characters that need to be 'escaped'
@c in texinfo, like '{' or '}', or needs different output for TeX and info,
@c then use the following form,
@c
@c     blah blah blah @c{$y^{1+b} \le \pi$}
@c     @math{y^@{1+b@} <= \pi}
@c
@c The first part using @c{} must appear at the end of a line (it reads
@c up to the line end -- as far as texinfo is concerned it's actually
@c a 'comment').  The comment command @c has been modified to capture
@c a TeX expression which is output by the next @math.
@c
@c For ordinary comments use the @comment command.

@tex
% Mathematical macros taken from the GNU Calc Manual
% ==================================================
%
% Some special kludges to make TeX formatting prettier.
% Because makeinfo.c exists, we can't just define new commands.
% So instead, we take over little-used existing commands.
%
% Redefine @cite{text} to act like $text$ in regular TeX.
% Info will typeset this same as @samp{text}.
\gdef\goodtex{\tex \let\rm\goodrm \let\t\ttfont \turnoffactive}
\gdef\goodrm{\fam0\tenrm}
\gdef\math{\goodtex$\mathxxx}
\gdef\mathxxx#1{#1$\Etex}
\global\let\oldxrefX=\xrefX
\gdef\xrefX[#1]{\begingroup\let\math=\dfn\oldxrefX[#1]\endgroup}
%
% Redefine @i{text} to be equivalent to @cite{text}, i.e., to use math mode.
% This looks the same in TeX but omits the surrounding ` ' in Info.
%\global\let\i=\cite
%\global\let\math=\cite
%
% Redefine @c{tex-stuff} \n @whatever{info-stuff}.
\gdef\c{\futurelet\next\mycxxx}
\gdef\mycxxx{%
  \ifx\next\bgroup \goodtex\let\next\mycxxy
  \else\ifx\next\mindex \let\next\relax
  \else\ifx\next\kindex \let\next\relax
  \else\ifx\next\starindex \let\next\relax \else \let\next\comment
  \fi\fi\fi\fi \next
}
\gdef\mycxxy#1#2{#1\Etex\mycxxz}
\gdef\mycxxz#1{}
%
% Define \Hat to take over from \hat as an accent
\gdef\Hat{\mathaccent "705E}
%
\gdef\beforedisplay{\vskip-10pt}
\gdef\afterdisplay{\vskip-5pt}
\gdef\beforedisplayh{\vskip-25pt}
\gdef\afterdisplayh{\vskip-10pt}
%
\gdef\arcsec{\hbox{\rm arcsec}}
\gdef\arccsc{\hbox{\rm arccsc}}
\gdef\arccot{\hbox{\rm arccot}}
\gdef\sech{\hbox{\rm sech}}
\gdef\csch{\hbox{\rm csch}}
\gdef\coth{\hbox{\rm coth}}
\gdef\arcsinh{\hbox{\rm arcsinh}}
\gdef\arccosh{\hbox{\rm arccosh}}
\gdef\arctanh{\hbox{\rm arctanh}}
\gdef\arcsech{\hbox{\rm arcsech}}
\gdef\arccsch{\hbox{\rm arccsch}}
\gdef\arccoth{\hbox{\rm arccoth}}
%
\gdef\Re{\hbox{\rm Re}}
\gdef\Im{\hbox{\rm Im}}
\gdef\Sin{\hbox{\rm Sin}}
\gdef\Cos{\hbox{\rm Cos}}
\gdef\Log{\hbox{\rm Log}}
%
\gdef\erf{\hbox{\rm erf}}
\gdef\erfc{\hbox{\rm erfc}}
\gdef\sinc{\hbox{\rm sinc}}
@end tex

@include version-ref.texi
@set GSL @i{GNU Scientific Library}

@iftex
@copying
Copyright @copyright{} 1996, 1997, 1998, 1999, 2000, 2001, 2002 The GSL Team.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.

The Texinfo source for this manual may be obtained from
@code{ftp.gnu.org} in the directory @code{/gnu/gsl/}.
@end copying
@end iftex

@titlepage
@title GNU Scientific Library
@subtitle Reference Manual
@subtitle Edition @value{EDITION}, for GSL Version @value{VERSION}
@subtitle @value{UPDATED}

@author Mark Galassi 
Los Alamos National Laboratory
@comment @email{rosalia@@lanl.gov}
@sp 1

@author Jim Davies 
Department of Computer Science, Georgia Institute of Technology
@comment @email{jimmyd@@nis.lanl.gov}
@sp 1

@author James Theiler 
Astrophysics and Radiation Measurements Group, Los Alamos National Laboratory
@comment @email{jt@@nis.lanl.gov}
@sp 1

@author Brian Gough 
Network Theory Limited
@comment @email{bjg@@network-theory.co.uk}
@sp 1

@comment Asked to be moved to 'contributors' appendix
@comment @author Reid Priedhorsky 
@comment Mathematical Modeling and Analysis Group, Los Alamos National Laboratory
@comment @email{rp@@lanl.gov}
@comment @sp 1

@author Gerard Jungman 
Theoretical Astrophysics Group, Los Alamos National Laboratory
@comment @email{jungman@@lanl.gov}
@sp 1

@author Michael Booth
Department of Physics and Astronomy, The Johns Hopkins University
@comment @email{booth@@planck.pha.jhu.edu} or @email{booth@@debian.org}
@sp 1

@author Fabrice Rossi
University of Paris-Dauphine
@comment @email{rossi@@ufrmd.dauphine.fr}
@sp 1
@page
@vskip 0pt plus 1filll
@ifset publish
@flushleft
Published by Network Theory Limited.

15 Royal Park
Clifton
Bristol BS8 3AL
United Kingdom

Email: info@@network-theory.co.uk

ISBN 0-9541617-0-X

Cover design by David Nicholls.

Errata for this book will be available from 
@url{http://www.network-theory.co.uk/gsl/manual/}

@end flushleft
@end ifset
@insertcopying
@end titlepage

@ifset frontcontents
@contents
@end ifset

@ifinfo
@node Top, Introduction, (dir), (dir)
@top GSL
@end ifinfo

@ifset publish
@iftex
@unnumbered Preface
This manual documents the use of the GNU Scientific Library, a numerical
library for C and C++ programmers.

The GNU Scientific Library is @dfn{free software}.  The term "free
software" is sometimes misunderstood---it has nothing to do with
price. It is about freedom.  It refers to your freedom to run, copy,
distribute, study, change and improve the software.  With the GNU
Scientific Library you have all these freedoms.

The GNU Scientific Library is part of the GNU Project.  The GNU Project
was launched in 1984 to develop a complete Unix-like operating system
which is free software: the GNU system.  It was conceived as a way of
bringing back the cooperative spirit that prevailed in the computing
community in earlier days---to make cooperation possible once again by
removing the obstacles to cooperation imposed by the owners of
proprietary software.  Variants of the GNU operating system, which use
the kernel Linux, are now widely used; though these systems are often
referred to as ``Linux'', they are more accurately called GNU/Linux
systems.

The Free Software Foundation is a tax-exempt charity that raises funds
for work on the GNU Project.  It is dedicated to promoting computer
users' right to use, study, copy, modify, and redistribute computer
programs.  You can support the Free Software Foundation by making a
donation or ordering manuals, t-shirts and especially CD-ROMs.  For more
information visit the website @url{www.gnu.org}.
@sp 1
@flushright
Brian Gough
Publisher
December 2001
@end flushright
@end iftex
@end ifset

@ifinfo
This file documents the @value{GSL} (GSL), a collection of numerical
routines for scientific computing.  It corresponds to release
@value{VERSION} of the library.

More information about GSL can be found at the project homepage,
@url{http://www.gnu.org/software/gsl/}.

This manual is also available as a printed book (ISBN 095416170X).

For ordering information visit @url{http://www.network-theory.co.uk/}

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License.
@end ifinfo

@menu
* Introduction::                
* Using the library::           
* Error Handling::              
* Mathematical Functions::      
* Complex Numbers::             
* Polynomials::                 
* Special Functions::           
* Vectors and Matrices::        
* Permutations::                
* Combinations::                
* Sorting::                     
* BLAS Support::                
* Linear Algebra::              
* Eigensystems::                
* Fast Fourier Transforms::     
* Numerical Integration::       
* Random Number Generation::    
* Quasi-Random Sequences::      
* Random Number Distributions::  
* Statistics::                  
* Histograms::                  
* N-tuples::                    
* Monte Carlo Integration::     
* Simulated Annealing::         
* Ordinary Differential Equations::  
* Interpolation::               
* Numerical Differentiation::   
* Chebyshev Approximations::    
* Series Acceleration::         
* Discrete Hankel Transforms::  
* One dimensional Root-Finding::  
* One dimensional Minimization::  
* Multidimensional Root-Finding::  
* Multidimensional Minimization::  
* Least-Squares Fitting::       
* Nonlinear Least-Squares Fitting::  
* Physical Constants::          
* IEEE floating-point arithmetic::  
* Debugging Numerical Programs::  
* Contributors to GSL::         
* Autoconf Macros::             
* GSL CBLAS Library::           
* Reporting Bugs::              
* GNU General Public License::  
* GNU Free Documentation License::  
* Function Index::              
* Variable Index::              
* Type Index::                  
* Concept Index::               
@end menu

@node  Introduction, Using the library, Top, Top
@chapter Introduction
@include intro.texi

@node Using the library, Error Handling, Introduction, Top
@chapter Using the library
@cindex usage, compiling application programs
@include usage.texi

@node Error Handling, Mathematical Functions, Using the library, Top
@chapter Error Handling
@cindex Errors
@include err.texi

@node  Mathematical Functions, Complex Numbers, Error Handling, Top
@chapter Mathematical Functions
@include math.texi

@node Complex Numbers, Polynomials, Mathematical Functions, Top
@chapter Complex Numbers
@include complex.texi

@node Polynomials, Special Functions, Complex Numbers, Top
@chapter Polynomials
@include poly.texi

@node Special Functions, Vectors and Matrices, Polynomials, Top
@chapter Special Functions
@include specfunc.texi

@node Vectors and Matrices, Permutations, Special Functions, Top
@chapter Vectors and Matrices
@include vectors.texi

@node   Permutations, Combinations, Vectors and Matrices, Top
@chapter Permutations
@include permutation.texi

@node   Combinations, Sorting, Permutations, Top
@chapter Combinations
@include combination.texi

@node  Sorting, BLAS Support, Combinations, Top
@chapter Sorting
@include sort.texi

@node BLAS Support, Linear Algebra, Sorting, Top
@chapter BLAS Support
@include blas.texi

@node Linear Algebra, Eigensystems, BLAS Support, Top
@chapter Linear Algebra
@include linalg.texi

@node Eigensystems, Fast Fourier Transforms, Linear Algebra, Top
@chapter Eigensystems
@include eigen.texi

@node Fast Fourier Transforms, Numerical Integration, Eigensystems, Top
@chapter Fast Fourier Transforms (FFTs)
@include fft.texi

@node Numerical Integration, Random Number Generation, Fast Fourier Transforms, Top
@chapter Numerical Integration
@include integration.texi

@node Random Number Generation, Quasi-Random Sequences, Numerical Integration, Top
@chapter Random Number Generation
@include rng.texi

@node Quasi-Random Sequences, Random Number Distributions, Random Number Generation, Top
@chapter Quasi-Random Sequences
@include qrng.texi

@node  Random Number Distributions, Statistics, Quasi-Random Sequences, Top
@chapter Random Number Distributions
@include randist.texi

@node Statistics, Histograms, Random Number Distributions, Top
@chapter Statistics
@include statistics.texi

@node Histograms, N-tuples, Statistics, Top
@chapter Histograms
@include histogram.texi

@node  N-tuples, Monte Carlo Integration, Histograms, Top
@chapter N-tuples
@include ntuple.texi

@node Monte Carlo Integration, Simulated Annealing, N-tuples, Top
@chapter Monte Carlo Integration
@include montecarlo.texi

@node Simulated Annealing, Ordinary Differential Equations, Monte Carlo Integration, Top
@chapter Simulated Annealing
@include siman.texi

@node Ordinary Differential Equations, Interpolation, Simulated Annealing, Top
@chapter Ordinary Differential Equations
@include ode-initval.texi

@node   Interpolation, Numerical Differentiation, Ordinary Differential Equations, Top
@chapter Interpolation
@include interp.texi

@node  Numerical Differentiation, Chebyshev Approximations, Interpolation, Top
@chapter Numerical Differentiation
@include diff.texi

@node  Chebyshev Approximations, Series Acceleration, Numerical Differentiation, Top
@chapter Chebyshev Approximations
@include cheb.texi

@node Series Acceleration, Discrete Hankel Transforms, Chebyshev Approximations, Top
@chapter Series Acceleration
@include sum.texi

@node  Discrete Hankel Transforms, One dimensional Root-Finding, Series Acceleration, Top
@chapter Discrete Hankel Transforms
@include dht.texi

@node  One dimensional Root-Finding, One dimensional Minimization, Discrete Hankel Transforms, Top
@chapter One dimensional Root-Finding
@include roots.texi

@node   One dimensional Minimization, Multidimensional Root-Finding, One dimensional Root-Finding, Top
@chapter One dimensional Minimization
@include min.texi

@node  Multidimensional Root-Finding, Multidimensional Minimization, One dimensional Minimization, Top
@chapter Multidimensional Root-Finding
@include multiroots.texi

@node   Multidimensional Minimization, Least-Squares Fitting, Multidimensional Root-Finding, Top
@chapter Multidimensional Minimization
@include multimin.texi

@node Least-Squares Fitting, Nonlinear Least-Squares Fitting, Multidimensional Minimization, Top
@chapter Least-Squares Fitting
@include fitting.texi

@node Nonlinear Least-Squares Fitting, Physical Constants, Least-Squares Fitting, Top
@chapter Nonlinear Least-Squares Fitting
@include multifit.texi

@node  Physical Constants, IEEE floating-point arithmetic, Nonlinear Least-Squares Fitting, Top
@chapter Physical Constants
@include const.texi

@node IEEE floating-point arithmetic, Debugging Numerical Programs, Physical Constants, Top
@chapter IEEE floating-point arithmetic
@include ieee754.texi

@node Debugging Numerical Programs, Contributors to GSL, IEEE floating-point arithmetic, Top
@appendix Debugging Numerical Programs
@include debug.texi

@node Contributors to GSL, Autoconf Macros, Debugging Numerical Programs, Top
@appendix Contributors to GSL

(See the AUTHORS file in the distribution for up-to-date information.)

@table @strong
@item Mark Galassi
Conceived GSL (with James Theiler) and wrote the design document.  Wrote
the simulated annealing package and the relevant chapter in the manual.

@item James Theiler
Conceived GSL (with Mark Galassi).  Wrote the random number generators
and the relevant chapter in this manual.

@item Jim Davies
Wrote the statistical routines and the relevant chapter in this
manual.

@item Brian Gough
FFTs, numerical integration, random number generators and distributions,
root finding, minimization and fitting, polynomial solvers, complex
numbers, physical constants, permutations, vector and matrix functions,
histograms, statistics, ieee-utils, revised @sc{cblas} Level 2 & 3, matrix
decompositions and eigensystems.

@item Reid Priedhorsky 
Wrote and documented the initial version of the root finding routines
while at Los Alamos National Laboratory, Mathematical Modeling and
Analysis Group.  
@comment email: reid@reidster.net

@item Gerard Jungman
Special Functions, Series acceleration, ODEs, BLAS, Linear Algebra,
Eigensystems, Hankel Transforms.

@item Mike Booth
Wrote the Monte Carlo library.

@item Jorma Olavi T@"ahtinen 
Wrote the initial complex arithmetic functions.

@item  Thomas Walter 
Wrote the initial heapsort routines and cholesky decomposition.

@item  Fabrice Rossi
Multidimensional minimization.

@item Carlo Perassi
Implementation of the random number generators in Knuth's
@cite{Seminumerical Algorithms}, 3rd Ed.

@item Szymon Jaroszewicz 
@comment <sj@cs.umb.edu>
Write the routines for generating combinations

@end table

@node  Autoconf Macros, GSL CBLAS Library, Contributors to GSL, Top
@appendix Autoconf Macros

@noindent
The following autoconf test will check for extern inline,

@smallexample
dnl Check for "extern inline", using a modified version
dnl of the test for AC_C_INLINE from acspecific.mt
dnl
AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
[ac_cv_c_extern_inline=no
AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
extern $ac_cv_c_inline double foo(double x) @{ return x+1.0; @};
double foo (double x) @{ return x + 1.0; @};], 
[  foo(1.0)  ],
[ac_cv_c_extern_inline="yes"])
])

if test "$ac_cv_c_extern_inline" != no ; then
  AC_DEFINE(HAVE_INLINE,1)
  AC_SUBST(HAVE_INLINE)
fi
@end smallexample

@node GSL CBLAS Library, Reporting Bugs, Autoconf Macros, Top
@appendix GSL CBLAS Library
@include cblas.texi

@node  Reporting Bugs, GNU General Public License, GSL CBLAS Library, Top
@appendix Reporting Bugs
@include bugs.texi

@comment @node  Copyright, GNU General Public License, Contributors to GSL, Top
@comment @unnumbered Copyright
@comment @include science.texi

@node  GNU General Public License, GNU Free Documentation License, Reporting Bugs, Top
@unnumbered GNU General Public License
@include gpl.texi

@node GNU Free Documentation License, Function Index, GNU General Public License, Top
@unnumbered GNU Free Documentation License
@include fdl.texi

@comment htmlhelp: @bye

@iftex
@normalbottom
@end iftex

@node Function Index, Variable Index, GNU Free Documentation License, Top
@unnumbered Function Index

@printindex fn

@node Variable Index, Type Index, Function Index, Top
@unnumbered Variable Index

@printindex vr

@node Type Index, Concept Index, Variable Index, Top
@unnumbered Type Index

@printindex tp

@node Concept Index,  , Type Index, Top
@unnumbered Concept Index

@printindex cp

@ifclear frontcontents
@comment Use @setchapternewpage odd to ensure that the contents starts 
@comment on an odd page so that it can always be moved to the front when 
@comment printing two-up.
@setchapternewpage odd
@contents
@end ifclear

@ifset extrablankpages
@comment final page must be blank for printed version
@page
@headings off
@*
@page
@*
@comment @page
@comment @*
@comment @page
@comment @*
@end ifset
@bye
