use num::Num; use na::{Scalar, Real, DefaultAllocator, U1}; use traits::{Alloc, Dimension, Number}; use aliases::{Mat, Vec}; pub fn determinant(m: &Mat) -> N where DefaultAllocator: Alloc { m.determinant() } pub fn inverse(m: &Mat) -> Mat where DefaultAllocator: Alloc { m.clone().try_inverse().unwrap_or(Mat::::zeros()) } pub fn matrix_comp_mult(x: &Mat, y: &Mat) -> Mat where DefaultAllocator: Alloc { x.component_mul(y) } pub fn outer_product(c: &Vec, r: &Vec) -> Mat where DefaultAllocator: Alloc { c * r.transpose() } pub fn transpose(x: &Mat) -> Mat where DefaultAllocator: Alloc { x.transpose() }