Trait nalgebra::ComplexField

source ·
pub trait ComplexField:
    SubsetOf<Self>
    + 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

Object Safety§

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§