2 releases

0.1.1 Sep 7, 2022
0.1.0 Sep 3, 2022

#1964 in Math

GPL-3.0-only

48KB
698 lines

Lineas

Linear algebra in Rust

crate.io version badge docs.rs docs status badge

This fast and simple-to-use library provides the ability to perform linear algebra within Rust. It provides matrices and vectors as well as complex numbers for all your computing needs.

Examples

Use lines

If you want to use a matrix, you ned to import it. Operations are included as default too.

use lineas::Matrix;

A new matrix

Matrix::new([[1, 2, 3], [4, 5, 6]]);

Make sure that the array you give is two dimensional and that each element is the same size

DTypes

You can change the dtype (data type taken from NumPy) with the dtype function

Matrix::new([[1, 2], [3, 4]]).dtype::<f32>();

Decomposition

If you need to use decompositions, you'll need to specify that:

use lineas::decompose::{
    LUDecompose,
    PLUDecompose,
    Diagonalise
};

let a = Matrix::new([[1, 2], [3, 4]]);

a.lu_decompose();
a.plu_decompose();
a.diagonalise();

Contribute

If you want to contribute, feel free. That is the nature of open source after all. Do a pull request or something.

Dependencies

~0.5–2.8MB
~50K SLoC