mathru 0.1.5

Simple mathematics library written in Rust
Documentation

mathru

crate documentation minimum rustc 1.37.0


mathru is a numeric library containing algorithms for linear algebra, analysis and statistics written in pure Rust with BLAS/LAPACK support.

Features

- Linear algebra
    - Vector
    - Matrix
        - Basic matrix operations(+,-,*)
        - Transposition
        - LU decomposition (native/lapack)
        - QR decomposition (native/lapack)
        - Hessenberg decomposition (native/lapack)
        - Singular value decomposition
        - Inverse matrix (native/lapack)
        - Determinant (native/lapack)
        - Trace
        - Eigenvalue (native/lapack)

- Ordinary differential equation (ODE)
    - Heun's method
    - Runge-Kutta 4th order
    - Euler

- Statistics
    - probability distribution
        - normal
        - gamma
        - binomial
        - poisson
        - exponential
        - chi squared
        - beta
        - bernoulli

- elementary functions
    - trigonometric functions
    - hyperbolic functions
    - exponential functions

- special functions
    - gamma functions
    - beta functions

Usage

Add this to your Cargo.toml for the native Rust implementation:

[dependencies.mathru]
version = "0.1"

Add the following lines to 'Cargo.toml' if the blas/lapack backend should be used:

[dependencies.mathru]
version = "0.1"
default-features = false
features = ["blaslapack"]

Then import the modules and it is ready to be used:

use mathru::algebra::linear::{Matrix};

// Compute the LU decomposition of a 2x2 matrix
let a: Matrix<f64> = Matrix::new(2, 2, vec![1.0, -2.0, 3.0, -7.0]);
let l_ref: Matrix<f64> = Matrix::new(2, 2, vec![1.0, 0.0, 1.0 / 3.0, 1.0]);

let (l, u, p): (Matrix<f64>, Matrix<f64>, Matrix<f64>) = a.dec_lu();

assert_eq!(l_ref, l);

Contributions

Any contribution is welcome!