Expand description
§rust-GSL
A Rust binding for the GSL library (the GNU Scientific Library).
The minimum support Rust version is 1.54.
§Installation
This binding requires the GSL library library (version >= 2) to be installed:
§Linux
# on debian based systems:
sudo apt-get install libgsl0-dev
§macOS
brew install gsl
§Apple silicon
Homebrew installs libraries under /opt/homebrew/include
on Apple silicon
to maintain backward compatibility with Rosetta 2.
After gsl
has been installed in the usual way, use
the environment variable:
RUSTFLAGS='-L /opt/homebrew/include'
before cargo run
, cargo build
, etc., to tell the compiler where gsl
is located.
§Windows
Instructions are available there: https://www.gnu.org/software/gsl/extras/native_win_builds.html.
§Usage
This crate works with Cargo and is on crates.io. Just add the following to your Cargo.toml
file:
[dependencies]
GSL = "7.0"
You can see examples in the examples
folder.
§Building
To build rgsl
, just run cargo build
. However, if you want to use a specific version, you’ll
need to use the cargo
features. For example:
cargo build --features v2_1
If a project depends on this version, don’t forget to add in your Cargo.toml
:
[dependencies.GSL]
version = "2"
features = ["v2_1"]
§Documentation
You can access the rgsl documentation locally, just build it:
> cargo doc --open
You can also access the latest build of the documentation via the internet here.
§License
rust-GSL is a wrapper for GSL, therefore inherits the GPL license.
Re-exports§
pub use self::elementary::Elementary;
pub use self::pow::Pow;
pub use self::trigonometric::Trigonometric;
pub use self::types::rng;
pub use self::types::*;
Modules§
- airy
- bessel
- blas
- cblas
- clausen
- The Clausen function is defined by the following integral,
- coulomb
- coupling_
coefficients - The Wigner 3-j, 6-j and 9-j symbols give the coupling coefficients for combined angular momentum vectors. Since the arguments of the standard coupling coefficient functions are integer or half-integer, the arguments of the following functions are, by convention, integers equal to twice the actual spin value. !
- dawson
- The Dawson integral is defined by \exp(-x^2) \int_0^x dt \exp(t^2). A table of Dawson’s integral can be found in Abramowitz & Stegun, Table 7.5. !
- debye
- The Debye functions D_n(x) are defined by the following integral,
- dilogarithm
- eigen
- References and Further Reading
- elementary
- elementary_
operations - elliptic
- Further information about the elliptic integrals can be found in Abramowitz & Stegun, Chapter 17.
- error
- The error function is described in Abramowitz & Stegun, Chapter 7.
- exponential
- exponential_
integrals - fermi_
dirac - fft
- Fast Fourier Transforms (FFTs)
- filter
v2_5
- fit
- Linear Regression
- gamma_
beta - This following routines compute the gamma and beta functions in their full and incomplete forms, as well as various kinds of factorials.
- gegenbauer
- The Gegenbauer polynomials are defined in Abramowitz & Stegun, Chapter 22, where they are known as Ultraspherical polynomials.
- hypergeometric
- Hypergeometric functions are described in Abramowitz & Stegun, Chapters 13 and 15.
- integration
- Introduction
- interpolation
- jacobian_
elliptic - The Jacobian Elliptic functions are defined in Abramowitz & Stegun, Chapter 16. !
- laguerre
- The generalized Laguerre polynomials are defined in terms of confluent hypergeometric functions as L^a_n(x) = ((a+1)n / n!) 1F1(-n,a+1,x), and are sometimes referred to as the associated Laguerre polynomials. They are related to the plain Laguerre polynomials L_n(x) by L^0_n(x) = L_n(x) and L^k_n(x) = (-1)^k (d^k/dx^k) L(n+k)(x). For more information see Abramowitz & Stegun, Chapter 22. !
- lambert_
w - Lambert’s W functions, W(x), are defined to be solutions of the equation W(x) \exp(W(x)) = x. This function has multiple branches for x < 0; however, it has only two real-valued branches. We define W_0(x) to be the principal branch, where W > -1 for x < 0, and W_{-1}(x) to be the other real branch, where W < -1 for x < 0. !
- legendre
- The Legendre Functions and Legendre Polynomials are described in Abramowitz & Stegun, Chapter 8.
- linear_
algebra - Linear Algebra
- logarithm
- Information on the properties of the Logarithm function can be found in Abramowitz & Stegun, Chapter 4.
- minimizer
- multifit
- multilarge
v2_1
- multilinear
- multiroot
- Multiroot test algorithms, See
rgsl::types::multiroot
for solvers. - numerical_
differentiation - Numerical Differentiation
- physical_
constant - Physical Constants
- polynomials
- Polynomials
- pow
- power
- The following functions are equivalent to the function gsl_pow_int (see Small integer powers) with an error estimate.
- psi
- The polygamma functions of order n are defined by
- randist
- Random Number Distributions
- roots
- sort
- Sorting
- statistics
- Statistics
- stats
- synchrotron
- transport
- The transport functions J(n,x) are defined by the integral representations J(n,x) := \int_0^x dt t^n e^t /(e^t - 1)^2.
- trigonometric
- types
- util
- wavelet_
transforms - Transform Functions
- zeta
- The Riemann zeta function is defined in Abramowitz & Stegun, Section 23.2.
Structs§
- IOStream
- A wrapper to handle I/O operations between GSL and rust
- View
- A struct which binds a type to a lifetime and prevent mutable access.
Enums§
- Cblas
Diag - Cblas
Order - Cblas
Side - Cblas
Transpose - Cblas
Uplo - Eigen
Sort - FftDirection
- This gives the sign in the formula:
- Filter
End v2_5
- Filter
Scale v2_5
- Gauss
Kronrod Rule - The low-level integration rules in QUADPACK are identified by small integers (1-6). We’ll use symbolic constants to refer to them.
- Integration
Qawo - Used by workspace for QAWO integrator
- Mode
- ODEiv
- Possible return values for an hadjust() evolution method for ordinary differential equations
- SfLegendre
Norm - Value
- Vegas
Mode - Used by VegasMonteCarlo struct
- Wavelet
Direction
Statics§
- DBL_
EPSILON - DBL_MAX
- DBL_MIN
- LOG_
DBL_ MAX - ROOT3_
DBL_ EPSILON - ROOT3_
DBL_ MAX - ROOT3_
DBL_ MIN - ROOT4_
DBL_ EPSILON - ROOT4_
DBL_ MAX - ROOT4_
DBL_ MIN - ROOT5_
DBL_ EPSILON - ROOT5_
DBL_ MAX - ROOT5_
DBL_ MIN - ROOT6_
DBL_ EPSILON - ROOT6_
DBL_ MAX - ROOT6_
DBL_ MIN - SF_
DOUBLEFACT_ NMAX - The maximum n such that gsl_sf_doublefact(n) does not give an overflow.
- SF_
FACT_ NMAX - The maximum n such that gsl_sf_fact(n) does not give an overflow.
- SF_
GAMMA_ XMAX - The maximum x such that gamma(x) is not considered an overflow.
- SF_
MATHIEU_ COEFF - SQRT_
DBL_ EPSILON - SQRT_
DBL_ MAX - SQRT_
DBL_ MIN