Skip to main content

LinalgElement

Trait LinalgElement 

Source
pub trait LinalgElement: Element + Sized {
    // Required methods
    fn epsilon_val() -> f64;
    fn abs_val(&self) -> Self;
    fn sqrt_val(&self) -> Self;
    fn neg_val(&self) -> Self;
}
Expand description

Trait for elements that support linear algebra operations.

This trait extends Element with operations needed for numerical linear algebra algorithms. Methods like zero(), one(), to_f64(), and from_f64() are inherited from Element.

Required Methods§

Source

fn epsilon_val() -> f64

Returns machine epsilon for this type

Source

fn abs_val(&self) -> Self

Returns absolute value

Source

fn sqrt_val(&self) -> Self

Returns square root

Source

fn neg_val(&self) -> Self

Returns negation

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 LinalgElement for f32

Source§

fn epsilon_val() -> f64

Source§

fn abs_val(&self) -> Self

Source§

fn sqrt_val(&self) -> Self

Source§

fn neg_val(&self) -> Self

Source§

impl LinalgElement for f64

Source§

fn epsilon_val() -> f64

Source§

fn abs_val(&self) -> Self

Source§

fn sqrt_val(&self) -> Self

Source§

fn neg_val(&self) -> Self

Implementors§