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 subr ...
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 mathematical s ...
and
science Science is a systematic endeavor that builds and organizes knowledge in the form of testable explanations and predictions about the universe. Science may be as old as the human species, and some of the earliest archeological evidence for ...
. 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 collaborati ...
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 (Free software), four freedoms to run, study, share, and modify the software. The license was th ...
.


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 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 ...
. 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 Brian (sometimes spelled Bryan in English) is a male given name of Irish and Breton origin, as well as a surname of Occitan origin. It is common in the English-speaking world. It is possible that the name is derived from an Old Celtic word mea ...
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 arbitrary ...
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 Double-precision floating-point format (sometimes called FP64 or float64) is a floating-point number format, usually occupying 64 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point. Flo ...
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 b ...
*
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 lang ...
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 List ...
*
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 Common Lisp (CL) is a dialect of the Lisp programming language, published in ANSI standard document ''ANSI INCITS 226-1994 (S20018)'' (formerly ''X3.226-1994 (R1999)''). The Common Lisp HyperSpec, a hyperlinked HTML version, has been derived fro ...
*
Ocaml OCaml ( , formerly Objective Caml) is a general-purpose programming language, general-purpose, multi-paradigm programming language which extends the Caml dialect of ML (programming language), ML with object-oriented programming, object-oriented ...
*
Octave In music, an octave ( la, octavus: eighth) or perfect octave (sometimes called the diapason) is the interval between one musical pitch and another with double its frequency. The octave relationship is a natural phenomenon that has been refer ...
*
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 sa ...
* 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 Map (mathematics), mapping between Category (mathematics), categories. Functors were first considered in algebraic topology, where algebraic objects (such as the fundamental group) ar ...
. 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 ...
and
free Free may refer to: Concept * Freedom, having the ability to do something, without having to obey anyone/anything * Freethought, a position that beliefs should be formed only on the basis of logic, reason, and empiricism * Emancipate, to procur ...
functions. Some also offer support for also creating workspaces that behave like
Smart pointer In computer science, a smart pointer is an abstract data type that simulates a pointer while providing added features, such as automatic memory management or bounds checking. Such features are intended to reduce bugs caused by the misuse of poin ...
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 Map (mathematics), mapping between Category (mathematics), categories. Functors were first considered in algebraic topology, where algebraic objects (such as the fundamental group) ar ...
. 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 significa ...
*
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 exceptio ...
*
Netlib 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 ...
* ''
Numerical Recipes ''Numerical Recipes'' is the generic title of a series of books on algorithms and numerical analysis by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery. In various editions, the books have been in print since 1 ...
''


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, bioinform ...
, 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 An academic library is a library that is attached to a higher education institution and serves two complementary purposes: to support the curriculum and the research of the university faculty and students. It is unknown how many academic librar ...
Mathematical libraries Numerical libraries Numerical software Articles with example C code