Trait faer_entity::ComplexField
source · pub trait ComplexField: Entity + Conjugate<Canonical = Self> {
type Real: RealField;
type Simd: SimdCtx;
type ScalarSimd: SimdCtx;
Show 50 methods
// Required methods
fn from_f64(value: f64) -> Self;
fn add(self, rhs: Self) -> Self;
fn sub(self, rhs: Self) -> Self;
fn mul(self, rhs: Self) -> Self;
fn neg(self) -> Self;
fn inv(self) -> Self;
fn conj(self) -> Self;
fn sqrt(self) -> Self;
fn scale_real(self, rhs: Self::Real) -> Self;
fn scale_power_of_two(self, rhs: Self::Real) -> Self;
fn score(self) -> Self::Real;
fn abs(self) -> Self::Real;
fn abs2(self) -> Self::Real;
fn nan() -> Self;
fn from_real(real: Self::Real) -> Self;
fn real(self) -> Self::Real;
fn imag(self) -> Self::Real;
fn zero() -> Self;
fn one() -> Self;
fn slice_as_simd<S: Simd>(
slice: &[Self::Unit]
) -> (&[Self::SimdUnit<S>], &[Self::Unit]);
fn slice_as_mut_simd<S: Simd>(
slice: &mut [Self::Unit]
) -> (&mut [Self::SimdUnit<S>], &mut [Self::Unit]);
fn partial_load_unit<S: Simd>(
simd: S,
slice: &[Self::Unit]
) -> Self::SimdUnit<S>;
fn partial_store_unit<S: Simd>(
simd: S,
slice: &mut [Self::Unit],
values: Self::SimdUnit<S>
);
fn partial_load_last_unit<S: Simd>(
simd: S,
slice: &[Self::Unit]
) -> Self::SimdUnit<S>;
fn partial_store_last_unit<S: Simd>(
simd: S,
slice: &mut [Self::Unit],
values: Self::SimdUnit<S>
);
fn simd_splat_unit<S: Simd>(simd: S, unit: Self::Unit) -> Self::SimdUnit<S>;
fn simd_scalar_mul<S: Simd>(simd: S, lhs: Self, rhs: Self) -> Self;
fn simd_scalar_conj_mul<S: Simd>(simd: S, lhs: Self, rhs: Self) -> Self;
fn simd_scalar_mul_adde<S: Simd>(
simd: S,
lhs: Self,
rhs: Self,
acc: Self
) -> Self;
fn simd_scalar_conj_mul_adde<S: Simd>(
simd: S,
lhs: Self,
rhs: Self,
acc: Self
) -> Self;
fn simd_neg<S: Simd>(
simd: S,
values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>;
fn simd_conj<S: Simd>(
simd: S,
values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>;
fn simd_add<S: Simd>(
simd: S,
lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>,
rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>;
fn simd_sub<S: Simd>(
simd: S,
lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>,
rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>;
fn simd_mul<S: Simd>(
simd: S,
lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>,
rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>;
fn simd_scale_real<S: Simd>(
simd: S,
lhs: <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>>,
rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>;
fn simd_conj_mul<S: Simd>(
simd: S,
lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>,
rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>;
fn simd_mul_adde<S: Simd>(
simd: S,
lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>,
rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>,
acc: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>;
fn simd_conj_mul_adde<S: Simd>(
simd: S,
lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>,
rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>,
acc: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>;
fn simd_abs2_adde<S: Simd>(
simd: S,
values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>,
acc: <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>>
) -> <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>>;
fn simd_abs2<S: Simd>(
simd: S,
values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>>;
fn simd_score<S: Simd>(
simd: S,
values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>>;
// Provided methods
fn is_nan(&self) -> bool { ... }
fn is_finite(&self) -> bool { ... }
fn partial_load<S: Simd>(
simd: S,
slice: Self::Group<&[Self::Unit]>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> { ... }
fn partial_store<S: Simd>(
simd: S,
slice: Self::Group<&mut [Self::Unit]>,
values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) { ... }
fn partial_load_last<S: Simd>(
simd: S,
slice: Self::Group<&[Self::Unit]>
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> { ... }
fn partial_store_last<S: Simd>(
simd: S,
slice: Self::Group<&mut [Self::Unit]>,
values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) { ... }
fn simd_splat<S: Simd>(
simd: S,
value: Self
) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> { ... }
fn simd_reduce_add<S: Simd>(
simd: S,
values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
) -> Self { ... }
}Expand description
Unstable trait containing the operations that a number type needs to implement.
Required Associated Types§
Required Methods§
sourcefn from_f64(value: f64) -> Self
fn from_f64(value: f64) -> Self
Converts value from f64 to Self.
The conversion may be lossy when converting to a type with less precision.
sourcefn scale_real(self, rhs: Self::Real) -> Self
fn scale_real(self, rhs: Self::Real) -> Self
Returns the input, scaled by rhs.
sourcefn scale_power_of_two(self, rhs: Self::Real) -> Self
fn scale_power_of_two(self, rhs: Self::Real) -> Self
Returns the input, scaled by rhs.
sourcefn score(self) -> Self::Real
fn score(self) -> Self::Real
Returns either the norm or squared norm of the number.
An implementation may choose either, so long as it chooses consistently.
sourcefn from_real(real: Self::Real) -> Self
fn from_real(real: Self::Real) -> Self
Returns a complex number whose real part is equal to real, and a zero imaginary part.
fn slice_as_simd<S: Simd>( slice: &[Self::Unit] ) -> (&[Self::SimdUnit<S>], &[Self::Unit])
fn slice_as_mut_simd<S: Simd>( slice: &mut [Self::Unit] ) -> (&mut [Self::SimdUnit<S>], &mut [Self::Unit])
fn partial_load_unit<S: Simd>( simd: S, slice: &[Self::Unit] ) -> Self::SimdUnit<S>
fn partial_store_unit<S: Simd>( simd: S, slice: &mut [Self::Unit], values: Self::SimdUnit<S> )
fn partial_load_last_unit<S: Simd>( simd: S, slice: &[Self::Unit] ) -> Self::SimdUnit<S>
fn partial_store_last_unit<S: Simd>( simd: S, slice: &mut [Self::Unit], values: Self::SimdUnit<S> )
fn simd_splat_unit<S: Simd>(simd: S, unit: Self::Unit) -> Self::SimdUnit<S>
fn simd_scalar_mul<S: Simd>(simd: S, lhs: Self, rhs: Self) -> Self
fn simd_scalar_conj_mul<S: Simd>(simd: S, lhs: Self, rhs: Self) -> Self
fn simd_scalar_mul_adde<S: Simd>( simd: S, lhs: Self, rhs: Self, acc: Self ) -> Self
fn simd_scalar_conj_mul_adde<S: Simd>( simd: S, lhs: Self, rhs: Self, acc: Self ) -> Self
fn simd_neg<S: Simd>( simd: S, values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_conj<S: Simd>( simd: S, values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_add<S: Simd>( simd: S, lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>, rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_sub<S: Simd>( simd: S, lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>, rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_mul<S: Simd>( simd: S, lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>, rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_scale_real<S: Simd>( simd: S, lhs: <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>>, rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_conj_mul<S: Simd>( simd: S, lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>, rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_mul_adde<S: Simd>( simd: S, lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>, rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>, acc: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_conj_mul_adde<S: Simd>( simd: S, lhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>, rhs: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>, acc: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_abs2_adde<S: Simd>( simd: S, values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>, acc: <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>> ) -> <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>>
fn simd_abs2<S: Simd>( simd: S, values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>>
fn simd_score<S: Simd>( simd: S, values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> <Self::Real as Entity>::Group<<Self::Real as Entity>::SimdUnit<S>>
Provided Methods§
fn partial_load<S: Simd>( simd: S, slice: Self::Group<&[Self::Unit]> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn partial_store<S: Simd>( simd: S, slice: Self::Group<&mut [Self::Unit]>, values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> )
fn partial_load_last<S: Simd>( simd: S, slice: Self::Group<&[Self::Unit]> ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn partial_store_last<S: Simd>( simd: S, slice: Self::Group<&mut [Self::Unit]>, values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> )
fn simd_splat<S: Simd>( simd: S, value: Self ) -> <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>>
fn simd_reduce_add<S: Simd>( simd: S, values: <Self as Entity>::Group<<Self as Entity>::SimdUnit<S>> ) -> Self
Object Safety§
This trait is not object safe.