pub trait LinalgScalar:
Element<Real = Self::LinalgReal>
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ Neg<Output = Self>
+ PartialEq
+ Sealed {
type LinalgReal: LinalgFloat;
const IS_COMPLEX: bool;
const ZERO: Self;
const ONE: Self;
const NAN: Self;
// Required methods
fn conj(self) -> Self;
fn abs(self) -> Self::LinalgReal;
fn abs1(self) -> Self::LinalgReal;
fn abs2(self) -> Self::LinalgReal;
fn scale(self, r: Self::LinalgReal) -> Self;
fn is_finite(self) -> bool;
fn csqrt(self) -> Self;
// Provided method
fn from_real(r: Self::LinalgReal) -> Self { ... }
}Expand description
The element types of linear algebra: f32, f64, c64, and c128.
Required Associated Constants§
Sourceconst IS_COMPLEX: bool
const IS_COMPLEX: bool
Whether the type is complex.
Required Associated Types§
Sourcetype LinalgReal: LinalgFloat
type LinalgReal: LinalgFloat
The real type of the absolute values (Self for real types; the
element type’s Real, whose re, im, and from_parts the
algorithms use).
Required Methods§
Sourcefn abs(self) -> Self::LinalgReal
fn abs(self) -> Self::LinalgReal
The absolute value (the modulus for complex types).
Sourcefn abs1(self) -> Self::LinalgReal
fn abs1(self) -> Self::LinalgReal
|re| + |im|, by which BLAS’s izamax compares complex values (the
absolute value for real types).
Sourcefn abs2(self) -> Self::LinalgReal
fn abs2(self) -> Self::LinalgReal
|x|^2.
Sourcefn scale(self, r: Self::LinalgReal) -> Self
fn scale(self, r: Self::LinalgReal) -> Self
self * r for a real r.
Provided Methods§
Sourcefn from_real(r: Self::LinalgReal) -> Self
fn from_real(r: Self::LinalgReal) -> Self
The value of a real number.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".