Trait MatExt

Source
pub trait MatExt {
    type Scalar;

    // Required methods
    fn inverse_or_zero(self) -> Self;
    fn is_isotropic(&self, epsilon: Self::Scalar) -> bool;
}
Expand description

An extension trait for matrix types.

Required Associated Types§

Source

type Scalar

The scalar type of the matrix.

Required Methods§

Source

fn inverse_or_zero(self) -> Self

Computes the inverse of self if self is not zero, and returns zero otherwise to avoid division by zero.

Source

fn is_isotropic(&self, epsilon: Self::Scalar) -> bool

Checks if the matrix is isotropic, meaning that it is invariant under all rotations of the coordinate system.

For second-order tensors, this means that the diagonal elements are equal and the off-diagonal elements are zero.

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 MatExt for Mat3

Source§

type Scalar = f32

Source§

fn inverse_or_zero(self) -> Self

Source§

fn is_isotropic(&self, epsilon: f32) -> bool

Source§

impl MatExt for Mat2

Source§

type Scalar = f32

Source§

fn inverse_or_zero(self) -> Self

Source§

fn is_isotropic(&self, epsilon: f32) -> bool

Source§

impl MatExt for DMat2

Source§

type Scalar = f64

Source§

fn inverse_or_zero(self) -> Self

Source§

fn is_isotropic(&self, epsilon: f64) -> bool

Source§

impl MatExt for DMat3

Source§

type Scalar = f64

Source§

fn inverse_or_zero(self) -> Self

Source§

fn is_isotropic(&self, epsilon: f64) -> bool

Source§

impl MatExt for SymmetricDMat2

Source§

type Scalar = f64

Source§

fn inverse_or_zero(self) -> Self

Source§

fn is_isotropic(&self, epsilon: f64) -> bool

Source§

impl MatExt for SymmetricMat2

Source§

type Scalar = f32

Source§

fn inverse_or_zero(self) -> Self

Source§

fn is_isotropic(&self, epsilon: f32) -> bool

Source§

impl MatExt for SymmetricDMat3

Source§

type Scalar = f64

Source§

fn inverse_or_zero(self) -> Self

Source§

fn is_isotropic(&self, epsilon: f64) -> bool

Source§

impl MatExt for SymmetricMat3

Source§

type Scalar = f32

Source§

fn inverse_or_zero(self) -> Self

Source§

fn is_isotropic(&self, epsilon: f32) -> bool

Implementors§