Mathru
Mathru is a numeric library containing algorithms for linear algebra, analysis and statistics written in pure Rust with BLAS/LAPACK support.
Features
The following features are implemented in this create:
-
- Abstract
- Linear algebra
- Vector
- Matrix
- Basic matrix operations(+,-,*)
- Transposition (In-place)
- LU decomposition
- QR decomposition
- Hessenberg decomposition
- Cholesky decomposition
- Eigen decomposition
- Singular value decomposition
- Inverse
- Pseudo inverse
- Determinant
- Trace
- Solve linear system
-
Analysis
- Integration
- Newton-Cotes
- Gauss-Legendre
- Ordinary differential equation (ODE)
- Explicit methods
- Euler method
- Heun's 2nd order method
- Midpoint method
- Ralston's 2nd order method
- Kutta 3rd order
- Heun's 3rd order method
- Ralston's 3rd order method
- Runge-Kutta 4th order
- Runge-Kutta-Felhberg
- Dormand-Prince
- Cash-Karp
- Tsitouras
- Bogacki-Shampine
- Adams-Bashforth
- Automatic step size control with starting step size
- Implicit methods
- Implicit Euler
- Backward differentiation formula (BDF)
- Explicit methods
- Integration
-
- Gauss-Newton algorithm
- Gradient descent
- Newton method
- Levenberg-Marquardt algorithm
- Conjugate gradient method
-
Elementary functions
- trigonometric functions
- hyperbolic functions
- exponential functions
-
- gamma functions
- gamma function
- log-gamma function
- digamma function
- upper incomplete gamma function
- upper incomplete regularized gamma function
- inverse upper incomplete regularized gamma function
- lower incomplete gamma function
- lower regularized incomplete gamma function
- inverse lower regularized incomplete gamma function
- beta functions
- beta function
- incomplete beta function
- incomplete regularized beta function
- error functions
- error function
- complementary error function
- inverse error function
- inverse complementary error function
- hypergeometric functions
- gamma functions
Usage
Add this to your Cargo.toml
for the native Rust implementation:
[]
= "0.10"
Add the following lines to 'Cargo.toml' if the openblas library should be used:
[]
= "0.10"
= false
= "openblas"
One of the following implementations for linear algebra can be activated as a feature:
- native: Native Rust implementation(activated by default)
- openblas: Optimized BLAS library
- netlib: Collection of mathematical software, papers, and databases
- intel-mkl: Intel Math Kernel Library
- accelerate Make large-scale mathematical computations and image calculations, optimized for high performance and low-energy consumption.(macOS only)
Solve a system of linear equations
use ;
/// Solves a system of linear equations
Solve ordinary differential equation with the Dormand-Prince algorithm
use ;
Further examples
For further examples, see project page
Documentation
See project page for more information and examples. The API is documented on docs.rs.
License
Licensed under
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Contribution
Any contribution is welcome!