Trait ScalarComplex

Source
pub trait ScalarComplex
where Self::Complex<Self::Real>: ComplexFloat,
{ type Real: Real; type Complex<T>; // Required methods fn new(real: Self::Real, imag: Self::Real) -> Self::Complex<Self::Real>; fn real(&self) -> Self::Real; fn imag(&self) -> Self::Real; // Provided methods fn abs(&self) -> Self::Real { ... } fn conj(&self) -> Self::Complex<Self::Real> { ... } }

Required Associated Types§

Required Methods§

Source

fn new(real: Self::Real, imag: Self::Real) -> Self::Complex<Self::Real>

create a new complex number

Source

fn real(&self) -> Self::Real

returns a reference to the real part of the object

Source

fn imag(&self) -> Self::Real

returns a reference to the imaginary part of the object

Provided Methods§

Source

fn abs(&self) -> Self::Real

returns the absolute value of the complex number

Source

fn conj(&self) -> Self::Complex<Self::Real>

compute the complex conjugate of the object

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.

Implementors§

Source§

impl<U> ScalarComplex for U
where U: ComplexFloat, U::Real: Scalar,