Skip to main content

SquareMatExt

Trait SquareMatExt 

Source
pub trait SquareMatExt {
    type Vector;

    // Required methods
    fn from_outer_product(a: Self::Vector, b: Self::Vector) -> Self;
    fn diagonal(&self) -> Self::Vector;
    fn inverse_or_zero(&self) -> Self;
    fn is_symmetric(&self) -> bool;
}
Expand description

An extension trait for matrices.

Required Associated Types§

Source

type Vector

The vector type associated with the matrix.

Required Methods§

Source

fn from_outer_product(a: Self::Vector, b: Self::Vector) -> Self

Creates a new matrix from the outer product a * b^T.

Source

fn diagonal(&self) -> Self::Vector

Returns the diagonal of the matrix.

Source

fn inverse_or_zero(&self) -> Self

Returns the inverse of self, or a zero matrix if the matrix is not invertible.

Source

fn is_symmetric(&self) -> bool

Returns true if the matrix is symmetric.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SquareMatExt for DMat2

Available on crate feature f64 only.
Source§

type Vector = DVec2

Source§

fn from_outer_product(a: DVec2, b: DVec2) -> Self

Source§

fn inverse_or_zero(&self) -> Self

Source§

fn diagonal(&self) -> DVec2

Source§

fn is_symmetric(&self) -> bool

Source§

impl SquareMatExt for DMat3

Available on crate feature f64 only.
Source§

type Vector = DVec3

Source§

fn from_outer_product(a: DVec3, b: DVec3) -> Self

Source§

fn inverse_or_zero(&self) -> Self

Source§

fn diagonal(&self) -> DVec3

Source§

fn is_symmetric(&self) -> bool

Source§

impl SquareMatExt for DMat4

Available on crate feature f64 only.
Source§

type Vector = DVec4

Source§

fn from_outer_product(a: DVec4, b: DVec4) -> Self

Source§

fn inverse_or_zero(&self) -> Self

Source§

fn is_symmetric(&self) -> bool

Source§

fn diagonal(&self) -> DVec4

Source§

impl SquareMatExt for Mat2

Source§

type Vector = Vec2

Source§

fn from_outer_product(a: Vec2, b: Vec2) -> Self

Source§

fn inverse_or_zero(&self) -> Self

Source§

fn diagonal(&self) -> Vec2

Source§

fn is_symmetric(&self) -> bool

Source§

impl SquareMatExt for Mat3

Source§

type Vector = Vec3

Source§

fn from_outer_product(a: Vec3, b: Vec3) -> Self

Source§

fn inverse_or_zero(&self) -> Self

Source§

fn diagonal(&self) -> Vec3

Source§

fn is_symmetric(&self) -> bool

Source§

impl SquareMatExt for Mat4

Source§

type Vector = Vec4

Source§

fn from_outer_product(a: Vec4, b: Vec4) -> Self

Source§

fn inverse_or_zero(&self) -> Self

Source§

fn is_symmetric(&self) -> bool

Source§

fn diagonal(&self) -> Vec4

Source§

impl SquareMatExt for Mat3A

Source§

type Vector = Vec3A

Source§

fn from_outer_product(a: Vec3A, b: Vec3A) -> Self

Source§

fn inverse_or_zero(&self) -> Self

Source§

fn diagonal(&self) -> Vec3A

Source§

fn is_symmetric(&self) -> bool

Implementors§