[][src]Struct wll::Complex

#[repr(C)]pub struct Complex<T> {
    pub re: T,
    pub im: T,
}

Generic complex number.

Fields

re: T

Real part.

im: T

Imaginary part.

Implementations

impl<T> Complex<T>[src]

pub const fn new(re: T, im: T) -> Self[src]

Construct a new complex number.

impl<T> Complex<T> where
    T: Clone + Add<Output = T> + Mul<Output = T>, 
[src]

pub fn norm_sqr(&self) -> T[src]

Returns the square of the norm.

impl<T> Complex<T> where
    T: Clone + Neg<Output = T>, 
[src]

pub fn conj(&self) -> Self[src]

Returns the complex conjugate.

Trait Implementations

impl<'a, T> Add<&'a Complex<T>> for Complex<T> where
    T: Clone + Add<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the + operator.

impl<'a, 'b, T> Add<&'b Complex<T>> for &'a Complex<T> where
    T: Clone + Add<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the + operator.

impl<T> Add<Complex<T>> for Complex<T> where
    T: Clone + Add<Output = T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<'a, T> Add<Complex<T>> for &'a Complex<T> where
    T: Clone + Add<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the + operator.

impl<T> AddAssign<Complex<T>> for Complex<T> where
    T: AddAssign
[src]

impl<T: Clone> Clone for Complex<T>[src]

impl<T: Copy> Copy for Complex<T>[src]

impl<T: Debug> Debug for Complex<T>[src]

impl<T: Default> Default for Complex<T>[src]

impl<'a, T> Div<&'a Complex<T>> for Complex<T> where
    T: Clone + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the / operator.

impl<'a, 'b, T> Div<&'b Complex<T>> for &'a Complex<T> where
    T: Clone + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the / operator.

impl<T> Div<Complex<T>> for Complex<T> where
    T: Clone + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T>, 
[src]

type Output = Self

The resulting type after applying the / operator.

impl<'a, T> Div<Complex<T>> for &'a Complex<T> where
    T: Clone + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the / operator.

impl<T> DivAssign<Complex<T>> for Complex<T> where
    T: Clone + AddAssign + SubAssign + MulAssign + DivAssign
[src]

impl<T: Eq> Eq for Complex<T>[src]

impl<'a, T> From<&'a T> for Complex<T> where
    T: Clone + Default
[src]

impl<T> From<T> for Complex<T> where
    T: Default
[src]

impl<T: Hash> Hash for Complex<T>[src]

impl InputAdaptor for Complex<f32>[src]

type Input = mcomplex

Input type.

impl InputAdaptor for Complex<f64>[src]

type Input = mcomplex

Input type.

impl<'a, T> Mul<&'a Complex<T>> for Complex<T> where
    T: Clone + Add<Output = T> + Sub<Output = T> + Mul<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the * operator.

impl<'a, 'b, T> Mul<&'b Complex<T>> for &'a Complex<T> where
    T: Clone + Add<Output = T> + Sub<Output = T> + Mul<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the * operator.

impl<T> Mul<Complex<T>> for Complex<T> where
    T: Clone + Add<Output = T> + Sub<Output = T> + Mul<Output = T>, 
[src]

type Output = Self

The resulting type after applying the * operator.

impl<'a, T> Mul<Complex<T>> for &'a Complex<T> where
    T: Clone + Add<Output = T> + Sub<Output = T> + Mul<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the * operator.

impl<T> MulAssign<Complex<T>> for Complex<T> where
    T: Clone + AddAssign + SubAssign + MulAssign
[src]

impl<T> Neg for Complex<T> where
    T: Neg<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<'a, T> Neg for &'a Complex<T> where
    T: Clone + Neg<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the - operator.

impl OutputAdaptor for Complex<f32>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<f64>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<i128>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<u128>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<isize>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<usize>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<i8>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<u8>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<i16>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<u16>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<i32>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<u32>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<i64>[src]

type Output = mcomplex

Output type.

impl OutputAdaptor for Complex<u64>[src]

type Output = mcomplex

Output type.

impl<T: PartialEq> PartialEq<Complex<T>> for Complex<T>[src]

impl<T> StructuralEq for Complex<T>[src]

impl<T> StructuralPartialEq for Complex<T>[src]

impl<'a, T> Sub<&'a Complex<T>> for Complex<T> where
    T: Clone + Sub<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the - operator.

impl<'a, 'b, T> Sub<&'b Complex<T>> for &'a Complex<T> where
    T: Clone + Sub<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the - operator.

impl<T> Sub<Complex<T>> for Complex<T> where
    T: Clone + Sub<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<'a, T> Sub<Complex<T>> for &'a Complex<T> where
    T: Clone + Sub<Output = T>, 
[src]

type Output = Complex<T>

The resulting type after applying the - operator.

impl<T> SubAssign<Complex<T>> for Complex<T> where
    T: SubAssign
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Complex<T> where
    T: RefUnwindSafe

impl<T> Send for Complex<T> where
    T: Send

impl<T> Sync for Complex<T> where
    T: Sync

impl<T> Unpin for Complex<T> where
    T: Unpin

impl<T> UnwindSafe for Complex<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.