×

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

Developer(s) | GNU Project |

Initial release | May 1996 |

Stable release | GSL-2.7
/ 1 June 2021 ^{[1]} |

Repository | ftpmirror |

Written in | C |

Type | Numerical library |

License | GNU General Public License |

Website | www |

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^{[2]} and is distributed under the GNU General Public License.

The GSL project was initiated in 1996 by physicists Mark Galassi and James Theiler of Los Alamos National Laboratory.^{[1]} They aimed at writing a modern replacement for widely used but somewhat outdated Fortran libraries such as Netlib.^{[3]} 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.^{[1]} Other major contributors were Jim Davies, Reid Priedhorsky, M. Booth, and F. Rossi.^{[1]}

Version 1.0 was released in 2001. In the following years, the library expanded only slowly; as the documentation stated, the maintainers were more interested in stability than in additional functionality. Major version 1 ended with release 1.16 of July 2013; this was the only public activity in the three years 2012–2014.

Vigorous development resumed with publication of version 2.0 in October 2015. The latest version 2.7 was released in June 2021.

The following example program calculates the value of the Bessel function for 5:^{[4]}

```
#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>
int main(void)
{
double x = 5.0;
double y = gsl_sf_bessel_J0(x);
printf("J0(%g) = %.18e\n", x, y);
return 0;
}
```

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

```
gcc $(gsl-config --cflags) example.c $(gsl-config --libs)
```

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

J0(5) = -1.775967713143382920e-01

The software library provides facilities for:

- Basic mathematical functions
- Complex numbers
- Polynomials
- B-splines
- 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

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

- AMPL
^{[5]} - C++
^{[6]}^{[7]}^{[8]} - Fortran
^{[9]} - Haskell
^{[10]}^{[11]} - Java
^{[12]} - Julia
^{[13]} - Lisp
^{[14]} - Ocaml
^{[15]} - Octave
- Perl Data Language
- Python
^{[16]} - R
^{[17]}^{[18]} - Ruby
^{[19]}

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*.^{[20]} Instead, pointers to static functions have to be used. Another common workaround is using a functor.

C++ wrappers for GSL are available.^{[6]}^{[7]}^{[8]} Not all of these are regularly maintained. They do offer access to matrix and vector classes without the user having to use malloc and free functions. Some also offer support for also creating workspaces that behave like Smart pointer classes. Finally, there is (limited, as of April 2020) support for allowing the user to create classes to represent a parametrised function as a functor.

While not strictly wrappers, there are some C++ classes ^{[21]}^{[22]} that allow C++ users to use the Gnu Scientific Library with wrapper features.

- List of numerical analysis software
- List of numerical libraries
- Netlib
*Numerical Recipes*

- ^
^{a}^{b}^{c}^{d}GSL homepage. **^**http://directory.fsf.org/GNU/**^**GSL design document.**^**Using the Library. An Example Program. GSL documentation.**^**AMPL bindings for the GNU Scientific Library.- ^
^{a}^{b}ccgsl: a C++ interface for the gnu Scientific Library; - ^
^{a}^{b}GSL-- C++ wrappers for GSL; - ^
^{a}^{b}GSLwrap: A C++ wrapper class for the GNU Scientific Library. **^**FGSL - A Fortran interface to the GNU Scientific Library.**^**The hmatrix-special package, an interface to GSL special functions.**^**The hmatrix-gsl package, a purely functional interface to selected numerical computations, internally implemented using GSL.**^**JavaCPP Presets for GSL.**^**Julia interface to GSL.**^**GSLL, GNU Scientific Library for Lisp.**^**gsl-ocaml: OCaml bindings to the GSL.**^**Python interface for GNU Scientific Library.**^**RcppGSL: 'Rcpp' Integration for 'GNU GSL' Vectors and Matrices.**^**gsl: wrapper for the Gnu Scientific Library.**^**rb-gsl: Ruby/GSL is a Ruby interface to the GNU Scientific Library, for numerical computing with Ruby.**^**Pointers to member functions. Archived 2004-10-13 at the Wayback Machine.**^**o2scl Object-oriented Scientific Computing Library;**^**yat.

- Official website
- GSL Design Document
- The
**gsl**package for R (programming language), an R wrapper for the special functions and quasi random number generators.

**By:** Wikipedia.org

**Edited:** 2021-06-18 15:16:46

**Source:** Wikipedia.org