Trait faer_core::ComplexField
source · pub trait ComplexField: Copy + Num + Neg<Output = Self> + Conjugate<Num = Self> + Send + Sync + Debug + 'static {
type Real: RealField;
// Required methods
fn from_real(real: Self::Real) -> Self;
fn into_real_imag(self) -> (Self::Real, Self::Real);
fn inv(self) -> Self;
fn conj(self) -> Self;
fn score(self) -> Self::Real;
fn nan() -> Self;
// Provided methods
fn real(self) -> Self::Real { ... }
fn imag(self) -> Self::Real { ... }
fn scale_real(self, factor: Self::Real) -> Self { ... }
fn abs(self) -> Self::Real { ... }
}
Expand description
Required Associated Types§
Required Methods§
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.
sourcefn into_real_imag(self) -> (Self::Real, Self::Real)
fn into_real_imag(self) -> (Self::Real, Self::Real)
Returns the real and imaginary part.
fn inv(self) -> Self
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.
fn nan() -> Self
Provided Methods§
sourcefn scale_real(self, factor: Self::Real) -> Self
fn scale_real(self, factor: Self::Real) -> Self
Returns the input, scaled by factor
.