Struct qoqo_calculator::CalculatorComplex[][src]

pub struct CalculatorComplex {
    pub re: CalculatorFloat,
    pub im: CalculatorFloat,
}
Expand description

Struct CalculatorComplex.

Fields

re: CalculatorFloat

CalculatorFloat value of real part of CalculatorComplex

im: CalculatorFloat

CalculatorFloat value of imaginary part of CalculatorComplex

Implementations

Constant zero for CalculatorComplex

Constant one for CalculatorFloat

Constant imaginary number for CalculatorFloat

Return CalculatorComplex constructed form pair of real values.

Arguments

  • re - Real part given as type that can be converted to CalculatorFloat
  • im - Imaginary part given as type that can be converted to CalculatorFloat

Return phase of complex number x: arg(x).

Return square norm of complex number x: |x|^2=x.re^2+x.im^2.

Return norm of complex number x: |x|=(x.re^2+x.im^2)^1/2.

Return complex conjugate of x: x*=x.re-i*x.im.

Return true when x is close to y.

Implement Inverse 1/x for CalculatorFloat.

Returns Inverse 1/x for CalculatorFloat.

Trait Implementations

Implement + for CalculatorComplex and generic type T.

Arguments

  • other - Any type T for which CalculatorComplex::From trait is implemented

The resulting type after applying the + operator.

Performs the + operation. Read more

Implement += for CalculatorComplex and generic type T.

Arguments

  • other - Any type T for which CalculatorComplex::From trait is implemented

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Implement Default value 0 for CalculatorComplex.

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

Deserialize this value from the given Serde deserializer. Read more

Implement Display trait for CalculatorComplex.

Allows use of simple text formating

Formats the value using the given formatter. Read more

Implement * for CalculatorComplex and generic type T.

Arguments

  • other - Any type T for which CalculatorComplex::From trait is implemented

The resulting type after applying the / operator.

Performs the / operation. Read more

Implement *= for CalculatorComplex and generic type T.

Arguments

  • other - Any type T for which CalculatorComplex::From trait is implemented

Performs the /= operation. Read more

Initialize CalculatorComplex from CalculatorComplex reference &CalculatorComplex.

Returns

  • CalculatorFloat

Performs the conversion.

Initialize CalculatorComplex from Complex.

Returns

  • CalculatorComplex

Performs the conversion.

Initialize CalculatorComplex from type that can be cast to CalculatorFloat.

Returns

  • CalculatorComplex

Performs the conversion.

Implement * for CalculatorComplex and generic type T.

Arguments

  • other - Any type T for which CalculatorComplex::From trait is implemented

The resulting type after applying the * operator.

Performs the * operation. Read more

Implement *= for CalculatorComplex and generic type T.

Arguments

  • other - Any type T for which CalculatorComplex::From trait is implemented

Performs the *= operation. Read more

Implement minus sign for CalculatorComplex.

The resulting type after applying the - operator.

Performs the unary - operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Implement - for CalculatorComplex and generic type T.

Arguments

  • other - Any type T for which CalculatorComplex::From trait is implemented

The resulting type after applying the - operator.

Performs the - operation. Read more

Implement -= for CalculatorComplex and generic type T.

Arguments

  • other - Any type T for which CalculatorComplex::From trait is implemented

Performs the -= operation. Read more

Implements summing over an iterator of CalculatorComplex

Arguments

  • iter - Any iterator over CalculatorComplex items

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

Try turning CalculatorComplex into f64 float.

Returns

  • f64

Panics

Panics when CalculatorFloat contains symbolic string value

The type returned in the event of a conversion error.

Performs the conversion.

Try turning CalculatorComplex into Complex float.

Returns

  • f64

Panics

Panics when CalculatorFloat contains symbolic string value

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.