nalgebra

Trait ComplexField

Source
pub trait ComplexField:
    SubsetOf<Self>
    + SupersetOf<f32>
    + SupersetOf<f64>
    + FromPrimitive
    + Field<Element = Self, SimdBool = bool, Output = Self>
    + Neg
    + Clone
    + Send
    + Sync
    + Any
    + 'static
    + Debug
    + Display {
    type RealField: RealField;

Show 55 methods // Required methods fn from_real(re: Self::RealField) -> Self; fn real(self) -> Self::RealField; fn imaginary(self) -> Self::RealField; fn modulus(self) -> Self::RealField; fn modulus_squared(self) -> Self::RealField; fn argument(self) -> Self::RealField; fn norm1(self) -> Self::RealField; fn scale(self, factor: Self::RealField) -> Self; fn unscale(self, factor: Self::RealField) -> Self; fn floor(self) -> Self; fn ceil(self) -> Self; fn round(self) -> Self; fn trunc(self) -> Self; fn fract(self) -> Self; fn mul_add(self, a: Self, b: Self) -> Self; fn abs(self) -> Self::RealField; fn hypot(self, other: Self) -> Self::RealField; fn recip(self) -> Self; fn conjugate(self) -> Self; fn sin(self) -> Self; fn cos(self) -> Self; fn sin_cos(self) -> (Self, Self); fn tan(self) -> Self; fn asin(self) -> Self; fn acos(self) -> Self; fn atan(self) -> Self; fn sinh(self) -> Self; fn cosh(self) -> Self; fn tanh(self) -> Self; fn asinh(self) -> Self; fn acosh(self) -> Self; fn atanh(self) -> Self; fn log(self, base: Self::RealField) -> Self; fn log2(self) -> Self; fn log10(self) -> Self; fn ln(self) -> Self; fn ln_1p(self) -> Self; fn sqrt(self) -> Self; fn exp(self) -> Self; fn exp2(self) -> Self; fn exp_m1(self) -> Self; fn powi(self, n: i32) -> Self; fn powf(self, n: Self::RealField) -> Self; fn powc(self, n: Self) -> Self; fn cbrt(self) -> Self; fn is_finite(&self) -> bool; fn try_sqrt(self) -> Option<Self>; // Provided methods fn to_polar(self) -> (Self::RealField, Self::RealField) { ... } fn to_exp(self) -> (Self::RealField, Self) { ... } fn signum(self) -> Self { ... } fn sinh_cosh(self) -> (Self, Self) { ... } fn sinc(self) -> Self { ... } fn sinhc(self) -> Self { ... } fn cosc(self) -> Self { ... } fn coshc(self) -> Self { ... }
}
Expand description

Trait shared by all complex fields and its subfields (like real numbers).

Complex numbers are equipped with functions that are commonly used on complex numbers and reals. The results of those functions only have to be approximately equal to the actual theoretical values.

Required Associated Types§

Required Methods§

Source

fn from_real(re: Self::RealField) -> Self

Builds a pure-real complex number from the given value.

Source

fn real(self) -> Self::RealField

The real part of this complex number.

Source

fn imaginary(self) -> Self::RealField

The imaginary part of this complex number.

Source

fn modulus(self) -> Self::RealField

The modulus of this complex number.

Source

fn modulus_squared(self) -> Self::RealField

The squared modulus of this complex number.

Source

fn argument(self) -> Self::RealField

The argument of this complex number.

Source

fn norm1(self) -> Self::RealField

The sum of the absolute value of this complex number’s real and imaginary part.

Source

fn scale(self, factor: Self::RealField) -> Self

Multiplies this complex number by factor.

Source

fn unscale(self, factor: Self::RealField) -> Self

Divides this complex number by factor.

Source

fn floor(self) -> Self

Source

fn ceil(self) -> Self

Source

fn round(self) -> Self

Source

fn trunc(self) -> Self

Source

fn fract(self) -> Self

Source

fn mul_add(self, a: Self, b: Self) -> Self

Source

fn abs(self) -> Self::RealField

The absolute value of this complex number: self / self.signum().

This is equivalent to self.modulus().

Source

fn hypot(self, other: Self) -> Self::RealField

Computes (self.conjugate() * self + other.conjugate() * other).sqrt()

Source

fn recip(self) -> Self

Source

fn conjugate(self) -> Self

Source

fn sin(self) -> Self

Source

fn cos(self) -> Self

Source

fn sin_cos(self) -> (Self, Self)

Source

fn tan(self) -> Self

Source

fn asin(self) -> Self

Source

fn acos(self) -> Self

Source

fn atan(self) -> Self

Source

fn sinh(self) -> Self

Source

fn cosh(self) -> Self

Source

fn tanh(self) -> Self

Source

fn asinh(self) -> Self

Source

fn acosh(self) -> Self

Source

fn atanh(self) -> Self

Source

fn log(self, base: Self::RealField) -> Self

Source

fn log2(self) -> Self

Source

fn log10(self) -> Self

Source

fn ln(self) -> Self

Source

fn ln_1p(self) -> Self

Source

fn sqrt(self) -> Self

Source

fn exp(self) -> Self

Source

fn exp2(self) -> Self

Source

fn exp_m1(self) -> Self

Source

fn powi(self, n: i32) -> Self

Source

fn powf(self, n: Self::RealField) -> Self

Source

fn powc(self, n: Self) -> Self

Source

fn cbrt(self) -> Self

Source

fn is_finite(&self) -> bool

Source

fn try_sqrt(self) -> Option<Self>

Provided Methods§

Source

fn to_polar(self) -> (Self::RealField, Self::RealField)

The polar form of this complex number: (modulus, arg)

Source

fn to_exp(self) -> (Self::RealField, Self)

The exponential form of this complex number: (modulus, e^{i arg})

Source

fn signum(self) -> Self

The exponential part of this complex number: self / self.modulus()

Source

fn sinh_cosh(self) -> (Self, Self)

Source

fn sinc(self) -> Self

Cardinal sine

Source

fn sinhc(self) -> Self

Source

fn cosc(self) -> Self

Cardinal cos

Source

fn coshc(self) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ComplexField for f32

Source§

type RealField = f32

Source§

fn from_real(re: <f32 as ComplexField>::RealField) -> f32

Source§

fn real(self) -> <f32 as ComplexField>::RealField

Source§

fn imaginary(self) -> <f32 as ComplexField>::RealField

Source§

fn norm1(self) -> <f32 as ComplexField>::RealField

Source§

fn modulus(self) -> <f32 as ComplexField>::RealField

Source§

fn modulus_squared(self) -> <f32 as ComplexField>::RealField

Source§

fn argument(self) -> <f32 as ComplexField>::RealField

Source§

fn to_exp(self) -> (f32, f32)

Source§

fn recip(self) -> f32

Source§

fn conjugate(self) -> f32

Source§

fn scale(self, factor: <f32 as ComplexField>::RealField) -> f32

Source§

fn unscale(self, factor: <f32 as ComplexField>::RealField) -> f32

Source§

fn floor(self) -> f32

Source§

fn ceil(self) -> f32

Source§

fn round(self) -> f32

Source§

fn trunc(self) -> f32

Source§

fn fract(self) -> f32

Source§

fn abs(self) -> f32

Source§

fn signum(self) -> f32

Source§

fn mul_add(self, a: f32, b: f32) -> f32

Source§

fn powi(self, n: i32) -> f32

Source§

fn powf(self, n: f32) -> f32

Source§

fn powc(self, n: f32) -> f32

Source§

fn sqrt(self) -> f32

Source§

fn try_sqrt(self) -> Option<f32>

Source§

fn exp(self) -> f32

Source§

fn exp2(self) -> f32

Source§

fn exp_m1(self) -> f32

Source§

fn ln_1p(self) -> f32

Source§

fn ln(self) -> f32

Source§

fn log(self, base: f32) -> f32

Source§

fn log2(self) -> f32

Source§

fn log10(self) -> f32

Source§

fn cbrt(self) -> f32

Source§

fn hypot(self, other: f32) -> <f32 as ComplexField>::RealField

Source§

fn sin(self) -> f32

Source§

fn cos(self) -> f32

Source§

fn tan(self) -> f32

Source§

fn asin(self) -> f32

Source§

fn acos(self) -> f32

Source§

fn atan(self) -> f32

Source§

fn sin_cos(self) -> (f32, f32)

Source§

fn sinh(self) -> f32

Source§

fn cosh(self) -> f32

Source§

fn tanh(self) -> f32

Source§

fn asinh(self) -> f32

Source§

fn acosh(self) -> f32

Source§

fn atanh(self) -> f32

Source§

fn is_finite(&self) -> bool

Source§

impl ComplexField for f64

Source§

type RealField = f64

Source§

fn from_real(re: <f64 as ComplexField>::RealField) -> f64

Source§

fn real(self) -> <f64 as ComplexField>::RealField

Source§

fn imaginary(self) -> <f64 as ComplexField>::RealField

Source§

fn norm1(self) -> <f64 as ComplexField>::RealField

Source§

fn modulus(self) -> <f64 as ComplexField>::RealField

Source§

fn modulus_squared(self) -> <f64 as ComplexField>::RealField

Source§

fn argument(self) -> <f64 as ComplexField>::RealField

Source§

fn to_exp(self) -> (f64, f64)

Source§

fn recip(self) -> f64

Source§

fn conjugate(self) -> f64

Source§

fn scale(self, factor: <f64 as ComplexField>::RealField) -> f64

Source§

fn unscale(self, factor: <f64 as ComplexField>::RealField) -> f64

Source§

fn floor(self) -> f64

Source§

fn ceil(self) -> f64

Source§

fn round(self) -> f64

Source§

fn trunc(self) -> f64

Source§

fn fract(self) -> f64

Source§

fn abs(self) -> f64

Source§

fn signum(self) -> f64

Source§

fn mul_add(self, a: f64, b: f64) -> f64

Source§

fn powi(self, n: i32) -> f64

Source§

fn powf(self, n: f64) -> f64

Source§

fn powc(self, n: f64) -> f64

Source§

fn sqrt(self) -> f64

Source§

fn try_sqrt(self) -> Option<f64>

Source§

fn exp(self) -> f64

Source§

fn exp2(self) -> f64

Source§

fn exp_m1(self) -> f64

Source§

fn ln_1p(self) -> f64

Source§

fn ln(self) -> f64

Source§

fn log(self, base: f64) -> f64

Source§

fn log2(self) -> f64

Source§

fn log10(self) -> f64

Source§

fn cbrt(self) -> f64

Source§

fn hypot(self, other: f64) -> <f64 as ComplexField>::RealField

Source§

fn sin(self) -> f64

Source§

fn cos(self) -> f64

Source§

fn tan(self) -> f64

Source§

fn asin(self) -> f64

Source§

fn acos(self) -> f64

Source§

fn atan(self) -> f64

Source§

fn sin_cos(self) -> (f64, f64)

Source§

fn sinh(self) -> f64

Source§

fn cosh(self) -> f64

Source§

fn tanh(self) -> f64

Source§

fn asinh(self) -> f64

Source§

fn acosh(self) -> f64

Source§

fn atanh(self) -> f64

Source§

fn is_finite(&self) -> bool

Implementors§