Skip to main content

Complex

Struct Complex 

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

The complex number re + im·i.

§Examples

use a::math::complex::Complex;

let z = Complex::new(3.0, 4.0);
assert_eq!(z.abs(), 5.0);
assert_eq!(z * z.conj(), Complex::new(25.0, 0.0));
assert_eq!(Complex::new(-4.0, 0.0).sqrt(), Complex::new(0.0, 2.0));
assert_eq!(format!("{}", z - 2.0 * Complex::I), "3+2i");

Fields§

§re: T

The real part.

§im: T

The imaginary part.

Implementations§

Source§

impl<T> Complex<T>

Source

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

The number re + im·i.

Source§

impl<T: Float> Complex<T>

Source

pub const ZERO: Self

Zero.

Source

pub const ONE: Self

One.

Source

pub const I: Self

The imaginary unit i.

Source

pub fn from_polar(r: T, theta: T) -> Self

The number with the absolute value r and the argument theta: r·e^(i·theta).

Source

pub fn to_polar(self) -> (T, T)

The absolute value and the argument, as abs and arg give them.

Source

pub fn conj(self) -> Self

The complex conjugate, re - im·i.

Source

pub fn abs(self) -> T

The absolute value √(re² + im²), without an overflow or underflow in the squares.

Source

pub fn norm_sqr(self) -> T

The square of the absolute value, re² + im²: cheaper than abs, but it overflows and underflows where the squares do.

Source

pub fn arg(self) -> T

The argument, the angle from the positive real axis, in (-π, π]; -π for a negative real number with a negative zero imaginary part.

Source

pub fn recip(self) -> Self

1 / self.

Source

pub fn is_finite(self) -> bool

Whether both parts are finite.

Source

pub fn is_nan(self) -> bool

Whether either part is NaN.

Source

pub fn exp(self) -> Self

e^self: e^re·(cos im + i·sin im). A real number stays real, with the sign of its zero imaginary part.

Source

pub fn ln(self) -> Self

The principal natural logarithm, ln |self| + i·arg(self), whose imaginary part is in (-π, π]. The logarithm of zero is -∞. Near the unit circle the real part is ln(1 + (|self|² - 1)) / 2, so that it keeps its digits where ln |self| is small; where |self| overflows, or is subnormal, it is ln(big) + ln(1 + (small/big)²) / 2 of the larger and the smaller part, so that ln(MAX + MAX·i) is finite.

Source

pub fn sqrt(self) -> Self

The principal square root, whose real part is not negative, by Kahan’s method, which neither overflows nor cancels: for re ≥ 0, t = √((re + |self|) / 2) and the root t + i·im / (2t), and the other way round for re < 0. Infinities and NaNs give what C99’s csqrt gives.

Source

pub fn powi(self, n: i32) -> Self

self to the integer power n, by repeated squaring: exact as long as the products are. A negative power is the power of the reciprocal, and 0^0 is 1.

Source

pub fn powf(self, x: T) -> Self

The principal value of self to the real power x: e^(x·ln self), with 0^x = 0 for x ≠ 0 and 0^0 = 1.

Source

pub fn powc(self, w: Self) -> Self

The principal value of self to the complex power w: e^(w·ln self), with 0^w = 0 for w ≠ 0 and 0^0 = 1.

Trait Implementations§

Source§

impl<T: Float> Add for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl<T: Float> Add<&Complex<T>> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Self) -> Self

Performs the + operation. Read more
Source§

impl<T: Float> Add<&Complex<T>> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Complex<T>) -> Complex<T>

Performs the + operation. Read more
Source§

impl Add<&Complex<f32>> for f32

Source§

type Output = Complex<f32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Complex<f32>) -> Complex<f32>

Performs the + operation. Read more
Source§

impl Add<&Complex<f32>> for &f32

Source§

type Output = Complex<f32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Complex<f32>) -> Complex<f32>

Performs the + operation. Read more
Source§

impl Add<&Complex<f64>> for f64

Source§

type Output = Complex<f64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Complex<f64>) -> Complex<f64>

Performs the + operation. Read more
Source§

impl Add<&Complex<f64>> for &f64

Source§

type Output = Complex<f64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Complex<f64>) -> Complex<f64>

Performs the + operation. Read more
Source§

impl<T: Float> Add<&T> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &T) -> Self

Performs the + operation. Read more
Source§

impl<T: Float> Add<&T> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &T) -> Complex<T>

Performs the + operation. Read more
Source§

impl<T: Float> Add<Complex<T>> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Complex<T>) -> Complex<T>

Performs the + operation. Read more
Source§

impl Add<Complex<f32>> for f32

Source§

type Output = Complex<f32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Complex<f32>) -> Complex<f32>

Performs the + operation. Read more
Source§

impl Add<Complex<f32>> for &f32

Source§

type Output = Complex<f32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Complex<f32>) -> Complex<f32>

Performs the + operation. Read more
Source§

impl Add<Complex<f64>> for f64

Source§

type Output = Complex<f64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Complex<f64>) -> Complex<f64>

Performs the + operation. Read more
Source§

impl Add<Complex<f64>> for &f64

Source§

type Output = Complex<f64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Complex<f64>) -> Complex<f64>

Performs the + operation. Read more
Source§

impl<T: Float> Add<T> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: T) -> Self

Performs the + operation. Read more
Source§

impl<T: Float> Add<T> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: T) -> Complex<T>

Performs the + operation. Read more
Source§

impl<T: Float> AddAssign for Complex<T>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<T: Float> AddAssign<&Complex<T>> for Complex<T>

Source§

fn add_assign(&mut self, rhs: &Self)

Performs the += operation. Read more
Source§

impl<T: Float> AddAssign<&T> for Complex<T>

Source§

fn add_assign(&mut self, rhs: &T)

Performs the += operation. Read more
Source§

impl<T: Float> AddAssign<T> for Complex<T>

Source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
Source§

impl<T: Clone> Clone for Complex<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Copy> Copy for Complex<T>

Source§

impl<T: Debug> Debug for Complex<T>

Source§

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

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

impl<T: Default> Default for Complex<T>

Source§

fn default() -> Self

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

impl<T: Float> Display for Complex<T>

Source§

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

Writes re+imi or re-imi, each part as Display writes the float, with the precision given: 1.5-2i, or 1.50-2.00i with {:.2}.

Source§

impl<T: Float> Div for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self

Performs the / operation. Read more
Source§

impl<T: Float> Div<&Complex<T>> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Self) -> Self

Performs the / operation. Read more
Source§

impl<T: Float> Div<&Complex<T>> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Complex<T>) -> Complex<T>

Performs the / operation. Read more
Source§

impl Div<&Complex<f32>> for f32

Source§

type Output = Complex<f32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Complex<f32>) -> Complex<f32>

Performs the / operation. Read more
Source§

impl Div<&Complex<f32>> for &f32

Source§

type Output = Complex<f32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Complex<f32>) -> Complex<f32>

Performs the / operation. Read more
Source§

impl Div<&Complex<f64>> for f64

Source§

type Output = Complex<f64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Complex<f64>) -> Complex<f64>

Performs the / operation. Read more
Source§

impl Div<&Complex<f64>> for &f64

Source§

type Output = Complex<f64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Complex<f64>) -> Complex<f64>

Performs the / operation. Read more
Source§

impl<T: Float> Div<&T> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &T) -> Self

Performs the / operation. Read more
Source§

impl<T: Float> Div<&T> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &T) -> Complex<T>

Performs the / operation. Read more
Source§

impl<T: Float> Div<Complex<T>> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Complex<T>) -> Complex<T>

Performs the / operation. Read more
Source§

impl Div<Complex<f32>> for f32

Source§

type Output = Complex<f32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Complex<f32>) -> Complex<f32>

Performs the / operation. Read more
Source§

impl Div<Complex<f32>> for &f32

Source§

type Output = Complex<f32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Complex<f32>) -> Complex<f32>

Performs the / operation. Read more
Source§

impl Div<Complex<f64>> for f64

Source§

type Output = Complex<f64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Complex<f64>) -> Complex<f64>

Performs the / operation. Read more
Source§

impl Div<Complex<f64>> for &f64

Source§

type Output = Complex<f64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Complex<f64>) -> Complex<f64>

Performs the / operation. Read more
Source§

impl<T: Float> Div<T> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> Self

Performs the / operation. Read more
Source§

impl<T: Float> Div<T> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> Complex<T>

Performs the / operation. Read more
Source§

impl<T: Float> DivAssign for Complex<T>

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<T: Float> DivAssign<&Complex<T>> for Complex<T>

Source§

fn div_assign(&mut self, rhs: &Self)

Performs the /= operation. Read more
Source§

impl<T: Float> DivAssign<&T> for Complex<T>

Source§

fn div_assign(&mut self, rhs: &T)

Performs the /= operation. Read more
Source§

impl<T: Float> DivAssign<T> for Complex<T>

Source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Source§

impl Element for Complex<f32>

Source§

impl Element for Complex<f64>

Source§

impl<T: Float> From<T> for Complex<T>

Source§

fn from(re: T) -> Self

The real number re + 0·i.

Source§

impl<T: Float> Mul for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
Source§

impl<T: Float> Mul<&Complex<T>> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Self) -> Self

Performs the * operation. Read more
Source§

impl<T: Float> Mul<&Complex<T>> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Complex<T>) -> Complex<T>

Performs the * operation. Read more
Source§

impl Mul<&Complex<f32>> for f32

Source§

type Output = Complex<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Complex<f32>) -> Complex<f32>

Performs the * operation. Read more
Source§

impl Mul<&Complex<f32>> for &f32

Source§

type Output = Complex<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Complex<f32>) -> Complex<f32>

Performs the * operation. Read more
Source§

impl Mul<&Complex<f64>> for f64

Source§

type Output = Complex<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Complex<f64>) -> Complex<f64>

Performs the * operation. Read more
Source§

impl Mul<&Complex<f64>> for &f64

Source§

type Output = Complex<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Complex<f64>) -> Complex<f64>

Performs the * operation. Read more
Source§

impl Mul<&Matrix<Complex<f32>>> for &Complex<f32>

Source§

type Output = Matrix<Complex<f32>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Matrix<Complex<f32>>) -> Matrix<Complex<f32>>

Performs the * operation. Read more
Source§

impl Mul<&Matrix<Complex<f32>>> for Complex<f32>

Source§

type Output = Matrix<Complex<f32>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Matrix<Complex<f32>>) -> Matrix<Complex<f32>>

Performs the * operation. Read more
Source§

impl Mul<&Matrix<Complex<f64>>> for &Complex<f64>

Source§

type Output = Matrix<Complex<f64>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Matrix<Complex<f64>>) -> Matrix<Complex<f64>>

Performs the * operation. Read more
Source§

impl Mul<&Matrix<Complex<f64>>> for Complex<f64>

Source§

type Output = Matrix<Complex<f64>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Matrix<Complex<f64>>) -> Matrix<Complex<f64>>

Performs the * operation. Read more
Source§

impl<T: Float> Mul<&T> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &T) -> Self

Performs the * operation. Read more
Source§

impl<T: Float> Mul<&T> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &T) -> Complex<T>

Performs the * operation. Read more
Source§

impl<T: Float> Mul<Complex<T>> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Complex<T>) -> Complex<T>

Performs the * operation. Read more
Source§

impl Mul<Complex<f32>> for f32

Source§

type Output = Complex<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Complex<f32>) -> Complex<f32>

Performs the * operation. Read more
Source§

impl Mul<Complex<f32>> for &f32

Source§

type Output = Complex<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Complex<f32>) -> Complex<f32>

Performs the * operation. Read more
Source§

impl Mul<Complex<f64>> for f64

Source§

type Output = Complex<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Complex<f64>) -> Complex<f64>

Performs the * operation. Read more
Source§

impl Mul<Complex<f64>> for &f64

Source§

type Output = Complex<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Complex<f64>) -> Complex<f64>

Performs the * operation. Read more
Source§

impl Mul<Matrix<Complex<f32>>> for &Complex<f32>

Source§

type Output = Matrix<Complex<f32>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Matrix<Complex<f32>>) -> Matrix<Complex<f32>>

Performs the * operation. Read more
Source§

impl Mul<Matrix<Complex<f32>>> for Complex<f32>

Source§

type Output = Matrix<Complex<f32>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Matrix<Complex<f32>>) -> Matrix<Complex<f32>>

Performs the * operation. Read more
Source§

impl Mul<Matrix<Complex<f64>>> for &Complex<f64>

Source§

type Output = Matrix<Complex<f64>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Matrix<Complex<f64>>) -> Matrix<Complex<f64>>

Performs the * operation. Read more
Source§

impl Mul<Matrix<Complex<f64>>> for Complex<f64>

Source§

type Output = Matrix<Complex<f64>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Matrix<Complex<f64>>) -> Matrix<Complex<f64>>

Performs the * operation. Read more
Source§

impl<T: Float> Mul<T> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> Self

Performs the * operation. Read more
Source§

impl<T: Float> Mul<T> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> Complex<T>

Performs the * operation. Read more
Source§

impl<T: Float> MulAssign for Complex<T>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<T: Float> MulAssign<&Complex<T>> for Complex<T>

Source§

fn mul_assign(&mut self, rhs: &Self)

Performs the *= operation. Read more
Source§

impl<T: Float> MulAssign<&T> for Complex<T>

Source§

fn mul_assign(&mut self, rhs: &T)

Performs the *= operation. Read more
Source§

impl<T: Float> MulAssign<T> for Complex<T>

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl<T: Float> Neg for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<T: Float> Neg for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Complex<T>

Performs the unary - operation. Read more
Source§

impl<T: PartialEq> PartialEq for Complex<T>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<T: Float> Product for Complex<T>

Source§

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

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<'a, T: Float> Product<&'a Complex<T>> for Complex<T>

Source§

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

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl Scalar for Complex<f32>

Source§

type Real = f32

The float type of the parts and the absolute values, as of norms and singular values: f32 for f32 and Complex<f32>, f64 for f64 and Complex<f64>.
Source§

impl Scalar for Complex<f64>

Source§

type Real = f64

The float type of the parts and the absolute values, as of norms and singular values: f32 for f32 and Complex<f32>, f64 for f64 and Complex<f64>.
Source§

impl<T: PartialEq> StructuralPartialEq for Complex<T>

Source§

impl<T: Float> Sub for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl<T: Float> Sub<&Complex<T>> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Self) -> Self

Performs the - operation. Read more
Source§

impl<T: Float> Sub<&Complex<T>> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Complex<T>) -> Complex<T>

Performs the - operation. Read more
Source§

impl Sub<&Complex<f32>> for f32

Source§

type Output = Complex<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Complex<f32>) -> Complex<f32>

Performs the - operation. Read more
Source§

impl Sub<&Complex<f32>> for &f32

Source§

type Output = Complex<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Complex<f32>) -> Complex<f32>

Performs the - operation. Read more
Source§

impl Sub<&Complex<f64>> for f64

Source§

type Output = Complex<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Complex<f64>) -> Complex<f64>

Performs the - operation. Read more
Source§

impl Sub<&Complex<f64>> for &f64

Source§

type Output = Complex<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Complex<f64>) -> Complex<f64>

Performs the - operation. Read more
Source§

impl<T: Float> Sub<&T> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &T) -> Self

Performs the - operation. Read more
Source§

impl<T: Float> Sub<&T> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &T) -> Complex<T>

Performs the - operation. Read more
Source§

impl<T: Float> Sub<Complex<T>> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Complex<T>) -> Complex<T>

Performs the - operation. Read more
Source§

impl Sub<Complex<f32>> for f32

Source§

type Output = Complex<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Complex<f32>) -> Complex<f32>

Performs the - operation. Read more
Source§

impl Sub<Complex<f32>> for &f32

Source§

type Output = Complex<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Complex<f32>) -> Complex<f32>

Performs the - operation. Read more
Source§

impl Sub<Complex<f64>> for f64

Source§

type Output = Complex<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Complex<f64>) -> Complex<f64>

Performs the - operation. Read more
Source§

impl Sub<Complex<f64>> for &f64

Source§

type Output = Complex<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Complex<f64>) -> Complex<f64>

Performs the - operation. Read more
Source§

impl<T: Float> Sub<T> for Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: T) -> Self

Performs the - operation. Read more
Source§

impl<T: Float> Sub<T> for &Complex<T>

Source§

type Output = Complex<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: T) -> Complex<T>

Performs the - operation. Read more
Source§

impl<T: Float> SubAssign for Complex<T>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<T: Float> SubAssign<&Complex<T>> for Complex<T>

Source§

fn sub_assign(&mut self, rhs: &Self)

Performs the -= operation. Read more
Source§

impl<T: Float> SubAssign<&T> for Complex<T>

Source§

fn sub_assign(&mut self, rhs: &T)

Performs the -= operation. Read more
Source§

impl<T: Float> SubAssign<T> for Complex<T>

Source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
Source§

impl<T: Float> Sum for Complex<T>

Source§

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

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<'a, T: Float> Sum<&'a Complex<T>> for Complex<T>

Source§

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

Takes an iterator and generates Self from the elements by “summing up” the items.

Auto Trait Implementations§

§

impl<T> Freeze for Complex<T>
where T: Freeze,

§

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> UnsafeUnpin for Complex<T>
where T: UnsafeUnpin,

§

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

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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<T> ToOwned for T
where T: Clone,

Source§

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§

fn to_string(&self) -> String

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

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.