GNU Scientific Library

Last updated
Original author(s) Mark Galassi, James Theiler, Brian Gough, Gerard Jungman and many others
Developer(s) GNU Project
Initial releaseMay 1996;27 years ago (1996-05)
Stable release
2.7.1 [1]   OOjs UI icon edit-ltr-progressive.svg / 30 November 2021
Repository ftpmirror.gnu.org/gsl/
Written in C
Type Numerical library
License 2007: GPL-3.0-or-later [lower-alpha 1]
1996: GPL-2.0-or-later [lower-alpha 2]
Website www.gnu.org/software/gsl/

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.

Contents

Project history

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

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.

Example

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

#include<stdio.h>#include<gsl/gsl_sf_bessel.h>intmain(void){doublex=5.0;doubley=gsl_sf_bessel_J0(x);printf("J0(%g) = %.18e\n",x,y);return0;}

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

C++ wrappers for GSL are available. [7] [8] [9] [10] 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 [24] [25] that allow C++ users to use the Gnu Scientific Library with wrapper features.

See also

Notes

  1. GPL-3.0-or-later since 2007-07-02.
  2. GPL-2.0-or-later from 1996-07-08 until 2007-07-02.

Related Research Articles

This is a "genealogy" of programming languages. Languages are categorized under the ancestor language with the strongest influence. Those ancestor languages are listed in alphabetic order. Any such categorization has a large arbitrary element, since programming languages often incorporate major ideas from multiple sources.

<span class="mw-page-title-main">GNU Multiple Precision Arithmetic Library</span> Free software

GNU Multiple Precision Arithmetic Library (GMP) is a free library for arbitrary-precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers. There are no practical limits to the precision except the ones implied by the available memory (operands may be of up to 232−1 bits on 32-bit machines and 237 bits on 64-bit machines). GMP has a rich set of functions, and the functions have a regular interface. The basic interface is for C, but wrappers exist for other languages, including Ada, C++, C#, Julia, .NET, OCaml, Perl, PHP, Python, R, Ruby, and Rust. Prior to 2008, Kaffe, a Java virtual machine, used GMP to support Java built-in arbitrary precision arithmetic. Shortly after, GMP support was added to GNU Classpath.

Netlib is a repository of software for scientific computing maintained by AT&T, Bell Laboratories, the University of Tennessee and Oak Ridge National Laboratory. Netlib comprises many separate programs and libraries. Most of the code is written in C and Fortran, with some programs in other languages.

The Simplified Wrapper and Interface Generator (SWIG) is an open-source software tool used to connect computer programs or libraries written in C or C++ with scripting languages such as Lua, Perl, PHP, Python, R, Ruby, Tcl, and other language implementations like C#, Java, JavaScript, Go, D, OCaml, Octave, Scilab and Scheme. Output can also be in the form of XML.

In compiler construction, name mangling is a technique used to solve various problems caused by the need to resolve unique names for programming entities in many modern programming languages.

Modular programming is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.

<span class="mw-page-title-main">LAPACK</span> Software library for numerical linear algebra

LAPACK is a standard software library for numerical linear algebra. It provides routines for solving systems of linear equations and linear least squares, eigenvalue problems, and singular value decomposition. It also includes routines to implement the associated matrix factorizations such as LU, QR, Cholesky and Schur decomposition. LAPACK was originally written in FORTRAN 77, but moved to Fortran 90 in version 3.2 (2008). The routines handle both real and complex matrices in both single and double precision. LAPACK relies on an underlying BLAS implementation to provide efficient and portable computational building blocks for its routines.

Basic Linear Algebra Subprograms (BLAS) is a specification that prescribes a set of low-level routines for performing common linear algebra operations such as vector addition, scalar multiplication, dot products, linear combinations, and matrix multiplication. They are the de facto standard low-level routines for linear algebra libraries; the routines have bindings for both C and Fortran. Although the BLAS specification is general, BLAS implementations are often optimized for speed on a particular machine, so using them can bring substantial performance benefits. BLAS implementations will take advantage of special floating point hardware such as vector registers or SIMD instructions.

A foreign function interface (FFI) is a mechanism by which a program written in one programming language can call routines or make use of services written or compiled in another one. An FFI is often used in contexts where calls are made into binary dynamic-link library.

This comparison of programming languages compares the features of language syntax (format) for over 50 computer programming languages.

libffi is a foreign function interface library. It provides a C programming language interface for calling natively compiled functions given information about the target function at run time instead of compile time. It also implements the opposite functionality: libffi can produce a pointer to a function that can accept and decode any combination of arguments defined at run time.

SLATEC Common Mathematical Library is a FORTRAN 77 library of over 1,400 general purpose mathematical and statistical routines. The code was developed at US government research laboratories and is therefore public domain software.

Some programming languages provide a complex data type for complex number storage and arithmetic as a built-in (primitive) data type.

QUADPACK is a FORTRAN 77 library for numerical integration of one-dimensional functions. It was included in the SLATEC Common Mathematical Library and is therefore in the public domain. The individual subprograms are also available on netlib.

Augeas is a free software configuration-management library, written in the C programming language. It is licensed under the terms of the GNU Lesser General Public License.

Absoft Fortran Compilers are set of Fortran compilers for Microsoft Windows, Apple Macintosh, and Linux produced by Absoft Corporation. The compilers are source code compatible across platforms.

References

  1. "relase 2.7.1 to fix libtool version numbers".
  2. "GNU - Free Software Directory".
  3. 1 2 3 GSL homepage.
  4. GSL design document.
  5. Using the Library. An Example Program. GSL documentation.
  6. AMPL bindings for the GNU Scientific Library.
  7. 1 2 ccgsl: a C++ interface for the GNU Scientific Library;
  8. 1 2 GSL-- C++ wrappers for GSL Archived 2015-01-29 at the Wayback Machine ;
  9. 1 2 GSLwrap: A C++ wrapper class for the GNU Scientific Library;
  10. 1 2 gslcpp: A Header-Only, Modern C++-Library Wrapping the GNU Scientific Library.
  11. FGSL - A Fortran interface to the GNU Scientific Library.
  12. The hmatrix-special package, an interface to GSL special functions.
  13. The hmatrix-gsl package, a purely functional interface to selected numerical computations, internally implemented using GSL.
  14. JavaCPP Presets for GSL.
  15. Julia interface to GSL.
  16. GSLL, GNU Scientific Library for Lisp.
  17. gsl-ocaml: OCaml bindings to the GSL.
  18. Python interface for GNU Scientific Library.
  19. RcppGSL: 'Rcpp' Integration for 'GNU GSL' Vectors and Matrices.
  20. gsl: wrapper for the Gnu Scientific Library.
  21. rb-gsl: Ruby/GSL is a Ruby interface to the GNU Scientific Library, for numerical computing with Ruby.
  22. rust-gsl: A Rust binding for the GSL library (the GNU Scientific Library).
  23. Pointers to member functions. Archived 2004-10-13 at the Wayback Machine .
  24. o2scl Object-oriented Scientific Computing Library;
  25. yat.