pub trait Invertiblewhere
Self: Sized,{
// Required method
fn inverse(&self) -> Option<Self>;
}Expand description
Compute the inverse of a matrix.
A matrix $A$ has an inverse $A^{-1}$ such that $AA^{-1} = A^{-1}A = I$.
Required Methods§
Sourcefn inverse(&self) -> Option<Self>
fn inverse(&self) -> Option<Self>
Compute the inverse of a matrix.
Returns None when the matrix is not invertible.
§Example
use hoomd_linear_algebra::{Invertible, SquareMatrix, matrix::Matrix};
let m = Matrix::identity() * 5.0;
let m_inv = m.inverse();
assert_eq!(m_inv, Some(Matrix::with_diagonal([1.0 / 5.0; 3])));Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.