pub trait RealValue:
Copy
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ Neg<Output = Self>
+ MulAddExt<Self, Self, Output = Self> {
const VAL_ZERO: Self;
const VAL_ONE: Self;
// Required method
fn val_trunc(self) -> Self;
}Expand description
A value usable as the real/imaginary storage of a Complex.
Implemented for f32/f64 and for every Thermite float
Vector. The arithmetic below is written once
against it and serves both the element level (Complex<f32>) and the vector
level (Complex<Vector<R>>). The math library wants the stronger
RealFloatVector.
Required Associated Constants§
Required Methods§
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<R: FloatRegister> RealValue for Vector<R>
impl<R: FloatRegister> RealValue for Vector<R>
Source§impl<V: DualValue, const N: usize> RealValue for Dual<V, N>
Available on crate feature dual only.Complex<Dual<V, N>>: a complex number whose parts each carry N derivative
components, giving forward-mode AD through the complex functions.
impl<V: DualValue, const N: usize> RealValue for Dual<V, N>
dual only.Complex<Dual<V, N>>: a complex number whose parts each carry N derivative
components, giving forward-mode AD through the complex functions.
Source§impl<V: ScalarValue> RealValue for Compensated<V>
Available on crate feature compensated only.Complex<Compensated<V>>: a complex number whose parts are each a double-double,
roughly doubling the mantissa of the complex arithmetic and of every kernel built
on it.
impl<V: ScalarValue> RealValue for Compensated<V>
compensated only.Complex<Compensated<V>>: a complex number whose parts are each a double-double,
roughly doubling the mantissa of the complex arithmetic and of every kernel built
on it.
Compensated carries no error term of its own through a complex multiply; the
compensation is per component, and the cross terms of (a + bi)(c + di) are
summed in double-double, which is where the precision comes from.