SquareMatrix

Trait SquareMatrix 

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

Matrices that have the same number of rows and columns.

Required Methods§

Source

fn identity() -> Self

Construct an N x N identity matrix.

§Example
use hoomd_linear_algebra::{SquareMatrix, matrix::Matrix22};
let m = Matrix22::identity();
assert_eq!(m.rows, [[1.0, 0.0], [0.0, 1.0]]);

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.

Implementors§

Source§

impl<const N: usize> SquareMatrix for Matrix<N, N>