pub enum Complex {
    C32(Complex<f32>),
    C64(Complex<f64>),
}
Expand description

A complex number.

Variants§

Implementations§

source§

impl Complex

source

pub fn im(&self) -> Float

Borrow the imaginary part of this Complex number

source

pub fn re(&self) -> Float

Borrow the real part of this Complex number

Trait Implementations§

source§

impl Add for Complex

§

type Output = Complex

The resulting type after applying the + operator.
source§

fn add(self, other: Complex) -> Self

Performs the + operation. Read more
source§

impl AddAssign for Complex

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl CastFrom<Complex> for Boolean

source§

fn cast_from(c: Complex) -> Self

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Complex> for Complex<f32>

source§

fn cast_from(c: Complex) -> Self

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Complex> for Float

source§

fn cast_from(c: Complex) -> Float

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Complex> for Int

source§

fn cast_from(c: Complex) -> Int

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Complex> for UInt

source§

fn cast_from(c: Complex) -> UInt

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Number> for Complex

source§

fn cast_from(number: Number) -> Complex

Cast an instance of T into an instance of Self.
source§

impl Clone for Complex

source§

fn clone(&self) -> Complex

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Complex

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Complex

source§

fn default() -> Complex

Returns the “default value” for a type. Read more
source§

impl Display for Complex

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div for Complex

§

type Output = Complex

The resulting type after applying the / operator.
source§

fn div(self, other: Complex) -> Self

Performs the / operation. Read more
source§

impl DivAssign for Complex

source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
source§

impl FloatInstance for Complex

source§

fn is_infinite(&self) -> bool

Return true if this Number is infinite (e.g. f32::INFINITY).
source§

fn is_nan(&self) -> bool

Return true if this is not a valid number (NaN).
source§

impl From<[f32; 2]> for Complex

source§

fn from(arr: [f32; 2]) -> Self

Converts to this type from the input type.
source§

impl From<[f64; 2]> for Complex

source§

fn from(arr: [f64; 2]) -> Self

Converts to this type from the input type.
source§

impl<R, I> From<(R, I)> for Complex
where R: Into<f64>, I: Into<f64>,

source§

fn from(value: (R, I)) -> Self

Converts to this type from the input type.
source§

impl From<Boolean> for Complex

source§

fn from(b: Boolean) -> Self

Converts to this type from the input type.
source§

impl From<Complex<f32>> for Complex

source§

fn from(c: Complex<f32>) -> Self

Converts to this type from the input type.
source§

impl From<Complex<f64>> for Complex

source§

fn from(c: Complex<f64>) -> Self

Converts to this type from the input type.
source§

impl From<Complex> for [Float; 2]

source§

fn from(n: Complex) -> Self

Converts to this type from the input type.
source§

impl From<Complex> for (Float, Float)

source§

fn from(n: Complex) -> Self

Converts to this type from the input type.
source§

impl From<Complex> for Complex<f64>

source§

fn from(c: Complex) -> Self

Converts to this type from the input type.
source§

impl From<Complex> for Number

source§

fn from(c: Complex) -> Number

Converts to this type from the input type.
source§

impl From<Float> for Complex

source§

fn from(f: Float) -> Self

Converts to this type from the input type.
source§

impl From<Int> for Complex

source§

fn from(i: Int) -> Self

Converts to this type from the input type.
source§

impl From<UInt> for Complex

source§

fn from(u: UInt) -> Self

Converts to this type from the input type.
source§

impl FromStr for Complex

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl GetSize for Complex

source§

fn get_size(&self) -> usize

Determines the total size of the object. Read more
source§

fn get_stack_size() -> usize

Determines how may bytes this object occupies inside the stack. Read more
source§

fn get_heap_size(&self) -> usize

Determines how many bytes this object occupies inside the heap. Read more
source§

impl Hash for Complex

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul for Complex

§

type Output = Complex

The resulting type after applying the * operator.
source§

fn mul(self, other: Complex) -> Self

Performs the * operation. Read more
source§

impl MulAssign for Complex

source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
source§

impl NumberInstance for Complex

§

type Abs = Float

§

type Exp = Complex

§

type Log = Complex

§

type Round = Complex

§

type Class = ComplexType

source§

fn class(&self) -> ComplexType

Get an impl of NumberClass describing this number.
source§

fn into_type(self, dtype: ComplexType) -> Complex

Cast this number into the specified NumberClass.
source§

fn abs(self) -> Float

Calculate the absolute value of this number.
source§

fn exp(self) -> Self::Exp

Raise e to the power of this number.
source§

fn ln(self) -> Self::Log

Compute the natural logarithm of this number.
source§

fn log<N: NumberInstance>(self, base: N) -> Self::Log
where Float: From<N>,

Compute the logarithm of this number with respect to the given base.
source§

fn pow(self, exp: Number) -> Self

Raise this number to the given exponent. Read more
source§

fn round(self) -> Self::Round

Return this number rounded to the nearest integer.
source§

fn and(self, other: Self) -> Self
where Boolean: CastFrom<Self>,

Return true if self and other are nonzero.
source§

fn not(self) -> Self
where Boolean: CastFrom<Self>,

Return true if this number is zero.
source§

fn or(self, other: Self) -> Self
where Boolean: CastFrom<Self>,

Return true if self or other is nonzero.
source§

fn xor(self, other: Self) -> Self
where Boolean: CastFrom<Self>,

Return true if exactly one of self and other is zero.
source§

impl PartialEq for Complex

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Product for Complex

source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl Rem for Complex

§

type Output = Complex

The resulting type after applying the % operator.
source§

fn rem(self, other: Self) -> Self::Output

Performs the % operation. Read more
source§

impl Sub for Complex

§

type Output = Complex

The resulting type after applying the - operator.
source§

fn sub(self, other: Complex) -> Self

Performs the - operation. Read more
source§

impl SubAssign for Complex

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl Sum for Complex

source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl Trigonometry for Complex

§

type Out = Complex

source§

fn asin(self) -> Self

Arcsine
source§

fn sin(self) -> Self

Sine
source§

fn sinh(self) -> Self

Hyperbolic sine
source§

fn asinh(self) -> Self

Hyperbolic arcsine
source§

fn acos(self) -> Self

Hyperbolic arccosine
source§

fn cos(self) -> Self

Cosine
source§

fn cosh(self) -> Self

Hyperbolic cosine
source§

fn acosh(self) -> Self

Hyperbolic arccosine
source§

fn atan(self) -> Self

Arctangent
source§

fn tan(self) -> Self

Tangent
source§

fn tanh(self) -> Self

Hyperbolic tangent
source§

fn atanh(self) -> Self

Hyperbolic arctangent
source§

impl Copy for Complex

source§

impl Eq for Complex

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<F, T> CastFrom<F> for T
where T: From<F>,

source§

fn cast_from(f: F) -> T

Cast an instance of T into an instance of Self.
source§

impl<T, F> CastInto<F> for T
where F: CastFrom<T>,

source§

fn cast_into(self) -> F

Cast an instance of Self into an instance of T.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<F> Match for F

source§

fn matches<T>(&self) -> bool
where T: TryCastFrom<Self>,

Returns true if self can be cast into the target type T.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<F, T> TryCastFrom<F> for T
where T: CastFrom<F>,

source§

fn can_cast_from(_: &F) -> bool

Test if value can be cast into Self.
source§

fn opt_cast_from(f: F) -> Option<T>

Returns Some(Self) if the source value can be cast into Self, otherwise None.
source§

fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err>
where OnErr: FnOnce(&T) -> Err,

Returns Ok(Self) if the source value can be cast into Self, otherwise calls on_err.
source§

impl<F, T> TryCastInto<T> for F
where T: TryCastFrom<F>,

source§

fn can_cast_into(&self) -> bool

Test if self can be cast into T.
source§

fn opt_cast_into(self) -> Option<T>

Returns Some(T) if self can be cast into T, otherwise None.
source§

fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>
where OnErr: FnOnce(&Self) -> Err,

Returns Ok(T) if self can be cast into T, otherwise calls on_err.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,