| Developer(s) | GNU Project |
|---|---|
| Stable release | 1.15 / 6 May 2011 |
| Written in | C |
| Type | Numerical library |
| License | GNU General Public License |
| Website | http://www.gnu.org/software/gsl/ |
In computing, the GNU Scientific Library (or GSL) is a software library written in the C programming language for numerical calculations in applied mathematics and science. The GSL is part of the GNU Project[1] and is distributed under the GNU General Public License.
Software which uses GSL includes PSPP and Perl Data Language.
|
Contents
|
Example
The following example program calculates the value of the Bessel function for 5:[2]
#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:
- Basic mathematical functions
- Complex numbers
- Polynomials
- 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
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.[3] Instead, pointers to static functions have to be used. Another common work around is using a functor. C++ wrappers for GSL are available,[4] although many are not regularly maintained.
See also
References
External links
|
|||||||||||||||||||
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)
This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article GNU Scientific Library.