Girish Mahajan (Editor)

GNU Scientific Library

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer(s)
  
GNU Project

Written in
  
C

Original author(s)
  
Mark Galassi, James Theiler, Brian Gough, Gerard Jungman and many others

Initial release
  
May 1996; 20 years ago (1996-05)

Stable release
  
GSL-2.2 / 29 August 2016; 6 months ago (2016-08-29)

Repository
  
git.savannah.gnu.org/cgit/gsl.git

The GNU Scientific Library (or GSL) is a software library for numerical computations in applied mathematics and science. The GSL is written in C; wrappers are available for other programming languages. The GSL is part of the GNU Project and is distributed under the GNU General Public License.

Contents

Project History

The GSL project was initiated in 1996 by physicists Mark Galassi and James Theiler of Los Alamos National Laboratory. They aimed at writing a modern replacement for widely used but somewhat outdated Fortran libraries such as Netlib. They carried out the overall design and wrote early modules; with that ready they recruited other scientists to contribute.

The "overall development of the library and the design and implementation of the major modules" was carried out by Brian Gough and Gerard Jungman. Other major contributors were Jim Davies, Reid Priedhorsky, M. Booth, and F. Rossi.

Version 1.0 was released in 2001. The library continues to be actively developed and version 2.2 was released on August 29, 2016.

Example

The following example program calculates the value of the Bessel function for 5:

The example program has to be linked to the GSL library upon compilation:

The output is shown below, and should be correct to double-precision accuracy:

J0(5) = -1.775967713143382920e-01

Features

The software library provides facilities for:

  • Basic mathematical functions
  • Complex numbers
  • Polynomials
  • Special functions
  • Vectors and matrices
  • Permutations
  • Combinations
  • Multisets
  • Sorting
  • BLAS
  • Linear algebra
  • Eigensystems
  • Fast Fourier transforms
  • Numerical integration (based on QUADPACK)
  • 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 transform
  • Root-finding in one and multiple dimensions
  • Minimization in one and multiple dimensions
  • Least-squares fitting
  • Nonlinear least-squares fitting
  • Physical constants
  • IEEE floating-point arithmetic
  • Discrete wavelet transform
  • Programming language bindings

    Since the GSL is written in C, it is straightforward to provide wrappers for other programming languages. Such wrappers currently exist for

  • AMPL
  • C++
  • Fortran
  • Haskell
  • Java
  • Lisp
  • Ocaml
  • Octave
  • Perl Data Language
  • Python
  • R,
  • Ruby
  • C++ support

    The GSL can be used in C++ classes, but not using pointers to member functions, because the type of pointer to member function is different from pointer to function. Instead, pointers to static functions have to be used. Another common work around is using a functor. C++ wrappers for GSL are available, although many are not regularly maintained.

    References

    GNU Scientific Library Wikipedia