Skip to main content

DenseScalar

Trait DenseScalar 

pub trait DenseScalar:
    Copy
    + PartialEq
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Neg<Output = Self> {
    const ZERO: Self;
    const ONE: Self;

    // Required methods
    fn magnitude(self) -> f64;
    fn is_finite(self) -> bool;
    fn unscaled_magnitude(self) -> f64;
    fn reciprocal(self) -> Self;
    fn ratio_quotient(self, divisor: Self) -> Self;
}
Expand description

A scalar invert_dense_matrix works over: real (f64) or complex (Complex64).

Required Associated Constants§

const ZERO: Self

The additive identity.

const ONE: Self

The multiplicative identity.

Required Methods§

fn magnitude(self) -> f64

The magnitude a pivot is compared by.

fn is_finite(self) -> bool

Whether every component is finite.

fn unscaled_magnitude(self) -> f64

The magnitude as √(re² + im²) without rescaling, so an extreme component’s square overflows or underflows as Free Pascal’s Cabs does (DensePivot::OpenDssDiagonal). The absolute value for a real.

fn reciprocal(self) -> Self

The reciprocal, formed so that neither an extreme magnitude’s square nor its reciprocal overflows or underflows (Complex::finv).

fn ratio_quotient(self, divisor: Self) -> Self

The quotient by Smith’s ratio division, the order Free Pascal’s ucomplex divides in (DensePivot::OpenDssDiagonal). Plain division for a real.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

§

impl DenseScalar for Complex<f64>

§

const ZERO: Complex<f64>

§

const ONE: Complex<f64>

§

fn magnitude(self) -> f64

§

fn is_finite(self) -> bool

§

fn unscaled_magnitude(self) -> f64

§

fn reciprocal(self) -> Complex<f64>

§

fn ratio_quotient(self, divisor: Complex<f64>) -> Complex<f64>

§

impl DenseScalar for f64

§

const ZERO: f64 = 0.0

§

const ONE: f64 = 1.0

§

fn magnitude(self) -> f64

§

fn is_finite(self) -> bool

§

fn unscaled_magnitude(self) -> f64

§

fn reciprocal(self) -> f64

§

fn ratio_quotient(self, divisor: f64) -> f64

Implementors§