use na::{Real, DefaultAllocator}; use traits::{Alloc, Dimension}; use aliases::Mat; /// Fast matrix inverse for affine matrix. pub fn affine_inverse(m: Mat) -> Mat where DefaultAllocator: Alloc { // FIXME: this should be optimized. m.try_inverse().unwrap_or(Mat::<_, D, D>::zeros()) } /// Compute the transpose of the inverse of a matrix. pub fn inverse_transpose(m: Mat) -> Mat where DefaultAllocator: Alloc { m.try_inverse().unwrap_or(Mat::<_, D, D>::zeros()).transpose() }