#linear-algebra

opensrdk-linear-algebra

Standard linear algebra library using blas and lapack for OpenSRDK toolchain

10 releases (5 breaking)

new 0.6.1 Nov 21, 2020
0.6.0 Sep 19, 2020
0.5.0 Sep 8, 2020
0.4.0 Aug 23, 2020
0.1.0 Jul 7, 2020

#94 in Math

Download history 1/week @ 2020-08-04 6/week @ 2020-08-11 81/week @ 2020-08-18 18/week @ 2020-08-25 25/week @ 2020-09-01 31/week @ 2020-09-08 16/week @ 2020-09-15 13/week @ 2020-09-22 21/week @ 2020-09-29 2/week @ 2020-10-06 11/week @ 2020-10-13 19/week @ 2020-10-20 12/week @ 2020-10-27 22/week @ 2020-11-03 11/week @ 2020-11-10 16/week @ 2020-11-17

72 downloads per month
Used in 2 crates

Apache-2.0

66KB
2.5K SLoC

linear-algebra-rs

Usage

[dependencies]
opensrdk-linear-algebra = "0.1.0"
blas-src = { version = "0.6", features = ["openblas"] }
lapack-src = { version = "0.6", features = ["openblas"] }
extern crate opensrdk_linear_algebra;
extern crate blas_src;
extern crate lapack_src;

You can also use accelerate, intel-mkl, or netlib instead. See here.

Macro

#[cfg(test)]
mod tests {
    use crate::prelude::*;
    #[test]
    fn it_works() {
        let a = mat!(
            1.0, 0.0;
            0.0, 1.0
        );
        assert_eq!(a[(0,0)], 1.0);
        assert_eq!(a[(0,1)], 0.0);
        assert_eq!(a[(1,0)], 0.0);
        assert_eq!(a[(1,1)], 1.0);

        let b = mat!(
            &a, zeros!(2, 2);
            zeros!(2, 2), &a
        );

        assert_eq!(b[(0,0)], 1.0);
        assert_eq!(b[(0,1)], 0.0);
        assert_eq!(b[(3,0)], 0.0);
        assert_eq!(b[(3,3)], 1.0);
    }
}
#[cfg(test)]
mod tests {
    use crate::prelude::*;
    #[test]
    fn it_works() {
        let a = mat!(
            1.0, 2.0;
            3.0, 4.0
        ) * mat!(
            5.0, 6.0;
            7.0, 8.0
        );
        assert_eq!(a[(0,0)], 19.0)
    }
}

Dependencies

~4MB
~109K SLoC