Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
GNU Scientific Library
Library for numerical analysis in C and C++

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.

We don't have any images related to GNU Scientific Library yet.
We don't have any YouTube videos related to GNU Scientific Library yet.
We don't have any PDF documents related to GNU Scientific Library yet.
We don't have any Books related to GNU Scientific Library yet.
We don't have any archived web articles related to GNU Scientific Library yet.

Project history

The GSL project was initiated in 1996 by physicists Mark Galassi and James Theiler of Los Alamos National Laboratory.2 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.4 Other major contributors were Jim Davies, Reid Priedhorsky, M. Booth, and F. Rossi.5

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, which included user contributed patches. The latest version 2.8 was released in May 2024.

Example

The following example program calculates the value of the Bessel function of the first kind and order zero for 5:6

#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

Features

The software library provides facilities for:

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

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.24 Instead, pointers to static functions have to be used. Another common workaround is using a functor.

C++ wrappers for GSL are available.25262728 Not all of these are regularly maintained. They do offer access to matrix and vector classes without having to use GSL's interface to 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 parameterised function as a functor.

While not strictly wrappers, there are some C++ classes 2930 that allow C++ users to use the Gnu Scientific Library with wrapper features.

See also

  • Free and open-source software portal
Wikimedia Commons has media related to GNU Scientific Library.

Notes

References

  1. "GNU - Free Software Directory". http://directory.fsf.org/GNU/

  2. GSL homepage. https://www.gnu.org/software/gsl/

  3. GSL design document. https://www.gnu.org/software/gsl/design/gsl-design.html#SEC1

  4. GSL homepage. https://www.gnu.org/software/gsl/

  5. GSL homepage. https://www.gnu.org/software/gsl/

  6. Using the Library. An Example Program. GSL documentation. https://www.gnu.org/software/gsl/doc/html/usage.html#an-example-program

  7. AMPL bindings for the GNU Scientific Library Archived 2021-10-28 at the Wayback Machine. https://ampl.github.io/amplgsl/

  8. ccgsl: a C++ interface for the GNU Scientific Library; http://ccgsl.sourceforge.net/

  9. GSL-- C++ wrappers for GSL Archived 2015-01-29 at the Wayback Machine; http://cholm.home.cern.ch/cholm/misc/#gslmm

  10. GSLwrap: A C++ wrapper class for the GNU Scientific Library; http://gslwrap.sourceforge.net/

  11. gslcpp: A Header-Only, Modern C++-Library Wrapping the GNU Scientific Library. https://github.com/tevaughan/gslcpp/

  12. FGSL - A Fortran interface to the GNU Scientific Library. https://doku.lrz.de/display/PUBLIC/FGSL+-+A+Fortran+interface+to+the+GNU+Scientific+Library

  13. The hmatrix-special package, an interface to GSL special functions. https://hackage.haskell.org/package/hmatrix-special

  14. The hmatrix-gsl package, a purely functional interface to selected numerical computations, internally implemented using GSL. https://hackage.haskell.org/package/hmatrix-gsl

  15. JavaCPP Presets for GSL. https://github.com/bytedeco/javacpp-presets/tree/master/gsl

  16. Julia interface to GSL. https://github.com/JuliaMath/GSL.jl

  17. GSLL, GNU Scientific Library for Lisp. http://common-lisp.net/project/gsll/

  18. gsl-ocaml: OCaml bindings to the GSL. https://mmottl.github.io/gsl-ocaml/

  19. Python interface for GNU Scientific Library. http://pygsl.sourceforge.net/#pygsl

  20. RcppGSL: 'Rcpp' Integration for 'GNU GSL' Vectors and Matrices. https://cran.r-project.org/web/packages/RcppGSL/index.html

  21. gsl: wrapper for the Gnu Scientific Library. https://cran.r-project.org/web/packages/gsl/index.html

  22. rb-gsl: Ruby/GSL is a Ruby interface to the GNU Scientific Library, for numerical computing with Ruby. https://rubygems.org/gems/rb-gsl

  23. rust-gsl: A Rust binding for the GSL library (the GNU Scientific Library). https://docs.rs/GSL/6.0.0/rgsl/

  24. Pointers to member functions. Archived 2004-10-13 at the Wayback Machine. http://www.parashift.com/c++-faq-lite/pointers-to-members.html#faq-33.1

  25. ccgsl: a C++ interface for the GNU Scientific Library; http://ccgsl.sourceforge.net/

  26. GSL-- C++ wrappers for GSL Archived 2015-01-29 at the Wayback Machine; http://cholm.home.cern.ch/cholm/misc/#gslmm

  27. GSLwrap: A C++ wrapper class for the GNU Scientific Library; http://gslwrap.sourceforge.net/

  28. gslcpp: A Header-Only, Modern C++-Library Wrapping the GNU Scientific Library. https://github.com/tevaughan/gslcpp/

  29. o2scl Object-oriented Scientific Computing Library; https://neutronstars.utk.edu/code/o2scl/html/index.html

  30. yat. https://web.archive.org/web/20101103060841/http://dev.thep.lu.se/yat/