2 releases

0.1.1 Apr 1, 2024
0.1.0 Mar 2, 2024

#625 in Algorithms

Download history 125/week @ 2024-02-27 17/week @ 2024-03-05 5/week @ 2024-03-12 106/week @ 2024-03-26 96/week @ 2024-04-02 5/week @ 2024-04-09

207 downloads per month
Used in 4 crates

MIT license

280KB
7.5K SLoC

ZeNu Matrix

ZeNu Matrix is a linear algebra library for Rust, providing efficient matrix operations and various utilities for working with matrices.

Features

  • Matrix creation, indexing, and slicing
  • Element-wise operations
  • Matrix multiplication (GEMM)
  • Transposition
  • Broadcasting
  • Random matrix generation
  • Integration with BLAS for optimized performance

Getting Started

To use ZeNu Matrix in your Rust project, add the following to your Cargo.toml file:

[dependencies]
zenu-matrix = "0.1.0"

Here's a simple example of using ZeNu Matrix:

use zenu_matrix::{
    matrix::{IndexItem, OwnedMatrix},
    matrix_impl::OwnedMatrixDyn,
    operation::asum::Asum,
};

fn main() {
    let a = OwnedMatrixDyn::from_vec(vec![1., 2., 3., 4., 5., 6.], [2, 3]);
    let b = OwnedMatrixDyn::from_vec(vec![7., 8., 9., 10., 11., 12.], [3, 2]);
    let c = a.clone() * b.clone();

    assert_eq!(c.index_item([0, 0]), 58.);
    assert_eq!(c.index_item([0, 1]), 64.);
    assert_eq!(c.index_item([1, 0]), 139.);
    assert_eq!(c.index_item([1, 1]), 154.);
}

For more details and examples, please refer to the documentation.

License

ZeNu Matrix is licensed under the MIT License.

Dependencies

~1.7–4MB
~76K SLoC