Trait complex::Complex [] [src]

pub trait Complex: Add<Output=Self> + Div<Output=Self> + Mul<Output=Self> + Neg<Output=Self> + Sub<Output=Self> + Copy + Debug + PartialEq {
    type Real: Add<Output=Self::Real> + Div<Output=Self::Real> + Mul<Output=Self::Real> + Neg<Output=Self::Real> + Sub<Output=Self::Real> + Copy + Debug + PartialEq;
    fn new(Self::Real, Self::Real) -> Self;
    fn re(&self) -> Self::Real;
    fn re_mut(&mut self) -> &mut Self::Real;
    fn im(&self) -> Self::Real;
    fn im_mut(&mut self) -> &mut Self::Real;

    fn conj(&self) -> Self { ... }
}

A complex number.

Associated Types

type Real: Add<Output=Self::Real> + Div<Output=Self::Real> + Mul<Output=Self::Real> + Neg<Output=Self::Real> + Sub<Output=Self::Real> + Copy + Debug + PartialEq

Required Methods

fn new(Self::Real, Self::Real) -> Self

Create a complex number from a real and an imaginary part.

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

Return the real part.

fn re_mut(&mut self) -> &mut Self::Real

Return the real part as a mutable reference.

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

Return the imaginary part.

fn im_mut(&mut self) -> &mut Self::Real

Return the imaginary part as a mutable reference.

Provided Methods

fn conj(&self) -> Self

Compute the complex conjugate.

Implementors