GNU Scientific Library
   HOME

TheInfoList



OR:

The GNU Scientific Library (or GSL) is a
software library In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and sub ...
for numerical computations in
applied mathematics Applied mathematics is the application of mathematical methods by different fields such as physics, engineering, medicine, biology, finance, business, computer science, and industry. Thus, applied mathematics is a combination of mathemati ...
and
science Science is a systematic endeavor that Scientific method, builds and organizes knowledge in the form of Testability, testable explanations and predictions about the universe. Science may be as old as the human species, and some of the earli ...
. The GSL is written in C; wrappers are available for other programming languages. The GSL is part of the
GNU Project The GNU Project () is a free software, mass collaboration project announced by Richard Stallman on September 27, 1983. Its goal is to give computer users freedom and control in their use of their computers and computing devices by collaborat ...
and is distributed under the
GNU General Public License The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the four freedoms to run, study, share, and modify the software. The license was the first copyleft for general ...
.


Project history

The GSL project was initiated in 1996 by physicists Mark Galassi and James Theiler of
Los Alamos National Laboratory Los Alamos National Laboratory (often shortened as Los Alamos and LANL) is one of the sixteen research and development laboratories of the United States Department of Energy (DOE), located a short distance northwest of Santa Fe, New Mexico, ...
.GSL homepage
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. 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 Bessel functions, first defined by the mathematician Daniel Bernoulli and then generalized by Friedrich Bessel, are canonical solutions of Bessel's differential equation x^2 \frac + x \frac + \left(x^2 - \alpha^2 \right)y = 0 for an arbitrar ...
for 5: #include #include int main(void) 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 *
AMPL AMPL (A Mathematical Programming Language) is an algebraic modeling language to describe and solve high-complexity problems for large-scale mathematical computing (i.e., large-scale optimization and scheduling-type problems). It was developed ...
*
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
ccgsl: a C++ interface for the GNU Scientific Library
GSL-- C++ wrappers for GSL
;
GSLwrap: A C++ wrapper class for the GNU Scientific Library
gslcpp: A Header-Only, Modern C++-Library Wrapping the GNU Scientific Library
* Fortran *
Haskell Haskell () is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research and industrial applications, Haskell has pioneered a number of programming lan ...
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
*
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
*
Julia Julia is usually a feminine given name. It is a Latinate feminine form of the name Julio and Julius. (For further details on etymology, see the Wiktionary entry "Julius".) The given name ''Julia'' had been in use throughout Late Antiquity (e.g ...
* Common Lisp * Ocaml * Octave *
Perl Data Language Perl Data Language (abbreviated PDL) is a set of free software array programming extensions to the Perl programming language. PDL extends the data structures built into Perl, to include large multidimensional arrays, and adds functionality to m ...
*
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
* R *
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called ...
* Rust


C++ support

The GSL can be used in
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
classes, but not using pointers to member functions, because the type of ''pointer to member function'' is different from ''pointer to function''.Pointers to member functions
.
Instead, pointers to static functions have to be used. Another common workaround is using a
functor In mathematics, specifically category theory, a functor is a mapping between categories. Functors were first considered in algebraic topology, where algebraic objects (such as the fundamental group) are associated to topological spaces, and m ...
. C++ wrappers for GSL are available. 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 C dynamic memory allocation refers to performing manual memory management for dynamic memory allocation in the C programming language via a group of functions in the C standard library, namely , , , and . The C++ programming language includes t ...
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 In mathematics, specifically category theory, a functor is a mapping between categories. Functors were first considered in algebraic topology, where algebraic objects (such as the fundamental group) are associated to topological spaces, and m ...
. While not strictly wrappers, there are some C++ classes o2scl Object-oriented Scientific Computing Library
yat
that allow C++ users to use the Gnu Scientific Library with wrapper features.


See also

*
List of numerical-analysis software Listed here are notable end-user computer applications intended for use with numerical or data analysis: Numerical-software packages General-purpose computer algebra systems Interface-oriented Language-oriented Historically signific ...
*
List of numerical libraries This is a list of numerical libraries, which are libraries used in software development for performing numerical calculations. It is not a complete listing but is instead a list of numerical libraries with articles on Wikipedia, with few except ...
* Netlib * '' Numerical Recipes''


Notes


References


External links

*
GSL Design Document
* Th

for
R (programming language) R is a programming language for statistical computing and graphics supported by the R Core Team and the R Foundation for Statistical Computing. Created by statisticians Ross Ihaka and Robert Gentleman, R is used among data miners, bioinfor ...
, an R wrapper for the special functions and quasi random number generators.
FLOSS FOR SCIENCE interview
with Mark Galassi on the history of GSL. {{GNU C (programming language) libraries Free computer libraries Free software programmed in C Scientific Library Mathematical libraries Numerical libraries Numerical software Articles with example C code