Trait SquareMatrix

Source
pub trait SquareMatrix: Matrix {
    // Required method
    fn identity() -> Self;
}

Required Methods§

Source

fn identity() -> Self

Returns the identity matrix with the given dimensions

§Examples
let a = [
    [1.0, 0.0],
    [0.0, 1.0]
]
assert_eq!(a, SquareMatrix::identity())

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.

Implementations on Foreign Types§

Source§

impl<F: One + Zero, const N: usize> SquareMatrix for [[F; N]; N]
where Self: Matrix, [[F; { _ }]; { _ }]:,

Source§

fn identity() -> Self

Implementors§