[−][src]Function peroxide::structure::matrix::gemm
pub fn gemm(alpha: f64, a: &Matrix, b: &Matrix, beta: f64, c: &mut Matrix)
GEMM wrapper for Matrixmultiply
Examples
#[macro_use] extern crate peroxide; use peroxide::prelude::*; fn main() { let a = ml_matrix("1 2 3;4 5 6"); let b = ml_matrix("1 2;3 4;5 6"); let mut c1 = zeros(2, 2); let mut c2 = matrix(vec![1f64; 9], 3, 3, Col); gemm(1f64, &a, &b, 0f64, &mut c1); gemm(1f64, &b, &a, 2f64, &mut c2); assert_eq!(c1, ml_matrix("22 28; 49 64")); assert_eq!(c2, ml_matrix("11 14 17;21 28 35;31 42 53")); }