pub trait ComplexField: Copy + Add<Output = Self> + Sub<Output = Self> + Mul<Output = Self> + Div<Output = Self> + Neg<Output = Self> + Send + Sync + Debug + 'static {
    type Real: RealField;

    fn from_real(real: Self::Real) -> Self;
    fn into_real_imag(self) -> (Self::Real, Self::Real);
    fn zero() -> Self;
    fn one() -> Self;
    fn inv(self) -> Self;
    fn conj(self) -> Self;
    fn sqrt(self) -> Self;
    fn score(self) -> Self::Real;

    fn real(self) -> Self::Real { ... }
    fn imag(self) -> Self::Real { ... }
    fn scale(self, factor: Self::Real) -> Self { ... }
}
Expand description

Trait that describes a complex number field.

Real numbers can also be seen as complex numbers, where the imaginary part is always zero.

Note

The implementation currently implies Copy, but this may be replaced by Clone in a future version of this library.

Required Associated Types

Required Methods

Returns a complex number whose real part is equal to real, and a zero imaginary part.

Returns the real and imaginary part.

Returns the value representing 0.0.

Returns the value representing 1.0.

Returns the inverse of the number.

Returns the conjugate of the number.

Returns the square root of the number.

Returns either the norm or squared norm of the number.

An implementation may choose either, so long as it chooses consistently.

Provided Methods

Returns the real part.

Returns the imaginary part.

Returns the input, scaled by factor.

Implementations on Foreign Types

Implementors