[][src]Struct hcomplex::Construct

pub struct Construct<T, U> { /* fields omitted */ }

Cayley–Dickson construction, a basic building block.

Structure takes two type parameters: + The first one, T: a scalar type the algebra is built over. + The second one, U: is a type of two components of the construction: re and im.

Implementations

impl<T, U> Construct<T, U>[src]

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

Create from real and imaginary parts.

pub fn split(self) -> (U, U)[src]

Split by real and imaginary parts.

pub fn re_ref(&self) -> &U[src]

pub fn im_ref(&self) -> &U[src]

pub fn re_mut(&mut self) -> &mut U[src]

pub fn im_mut(&mut self) -> &mut U[src]

impl<T, U> Construct<T, U> where
    U: Clone
[src]

pub fn re(&self) -> U[src]

pub fn im(&self) -> U[src]

impl<T, U> Construct<T, U> where
    Self: Clone + Norm<Output = T> + Div<T, Output = Self>, 
[src]

pub fn normalize(self) -> Self[src]

impl<T, U> Construct<T, Construct<T, U>>[src]

pub fn new2(w: U, x: U, y: U, z: U) -> Self[src]

Create from four parts.

impl<T, U> Construct<T, Construct<T, U>> where
    U: Clone,
    Construct<T, U>: Clone
[src]

pub fn w(&self) -> U[src]

pub fn x(&self) -> U[src]

pub fn y(&self) -> U[src]

pub fn z(&self) -> U[src]

impl<T, U> Construct<T, Construct<T, U>>[src]

pub fn w_ref(&self) -> &U[src]

pub fn x_ref(&self) -> &U[src]

pub fn y_ref(&self) -> &U[src]

pub fn z_ref(&self) -> &U[src]

pub fn w_mut(&mut self) -> &mut U[src]

pub fn x_mut(&mut self) -> &mut U[src]

pub fn y_mut(&mut self) -> &mut U[src]

pub fn z_mut(&mut self) -> &mut U[src]

impl<T: Float> Construct<T, T>[src]

pub fn into_num(self) -> NumComplex<T>[src]

Convert into num_complex::Complex struct.

pub fn arg(self) -> T[src]

Calculate the principal Arg of self.

pub fn exp(self) -> Self[src]

Computes e^(self), where e is the base of the natural logarithm.

pub fn ln(self) -> Self[src]

Computes the principal value of natural logarithm of self.

pub fn sqrt(self) -> Self[src]

Computes the principal value of the square root of self.

pub fn cbrt(self) -> Self[src]

Computes the principal value of the cube root of self.

Note that this does not match the usual result for the cube root of negative real numbers. For example, the real cube root of -8 is -2, but the principal complex cube root of -8 is 1 + i√3.

pub fn powu(self, exp: u32) -> Self[src]

Raises self to an unsigned integer power.

pub fn powi(self, exp: i32) -> Self[src]

Raises self to a signed integer power.

pub fn powf(self, exp: T) -> Self[src]

Raises self to a floating point power.

pub fn powc(self, exp: Self) -> Self[src]

Raises self to a complex power.

pub fn log(self, base: T) -> Self[src]

Returns the logarithm of self with respect to an arbitrary base.

pub fn expf(self, base: T) -> Self[src]

Raises a floating point number to the complex power self.

pub fn sin(self) -> Self[src]

Computes the sine of self.

pub fn cos(self) -> Self[src]

Computes the cosine of self.

pub fn tan(self) -> Self[src]

Computes the tangent of self.

pub fn asin(self) -> Self[src]

Computes the principal value of the inverse sine of self.

pub fn acos(self) -> Self[src]

Computes the principal value of the inverse cosine of self.

pub fn atan(self) -> Self[src]

Computes the principal value of the inverse tangent of self.

pub fn sinh(self) -> Self[src]

Computes the hyperbolic sine of self.

pub fn cosh(self) -> Self[src]

Computes the hyperbolic cosine of self.

pub fn tanh(self) -> Self[src]

Computes the hyperbolic tangent of self.

pub fn asinh(self) -> Self[src]

Computes the principal value of the inverse hyperbolic sine of self.

pub fn acosh(self) -> Self[src]

Computes the principal value of the inverse hyperbolic cosine of self.

pub fn atanh(self) -> Self[src]

Computes the principal value of the inverse hyperbolic tangent of self.

pub fn finv(self) -> Self[src]

Returns 1/self using floating-point operations.

impl<T: Float + Clone> Construct<T, T> where
    Self: Norm<Output = T>, 
[src]

pub fn to_polar(self) -> (T, T)[src]

Convert to polar form.

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

Convert a polar representation into a complex number.

impl<T: One + Zero> Construct<T, T>[src]

pub fn i() -> Self[src]

impl<T: One + Zero> Construct<T, Construct<T, T>>[src]

pub fn i() -> Self[src]

pub fn j() -> Self[src]

pub fn k() -> Self[src]

Trait Implementations

impl<T: Clone, U> AbsDiffEq<Construct<T, U>> for Construct<T, U> where
    T: AbsDiffEq<Epsilon = T>,
    U: AbsDiffEq<Epsilon = T>, 
[src]

type Epsilon = T

Used for specifying relative comparisons.

impl<T, U> Add<Construct<T, Construct<T, U>>> for Construct<T, U> where
    Construct<T, U>: Add<Output = Construct<T, U>>, 
[src]

type Output = Construct<T, Construct<T, U>>

The resulting type after applying the + operator.

impl<T, U> Add<Construct<T, U>> for Construct<T, U> where
    U: Add<Output = U>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<T, U> Add<Construct<T, U>> for Construct<T, Construct<T, U>> where
    Construct<T, U>: Add<Output = Construct<T, U>>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<U> Add<Construct<f32, U>> for f32 where
    Construct<f32, U>: Add<f32, Output = Construct<f32, U>>, 
[src]

Workaround for reverse addition.

type Output = Construct<f32, U>

The resulting type after applying the + operator.

impl<U> Add<Construct<f64, U>> for f64 where
    Construct<f64, U>: Add<f64, Output = Construct<f64, U>>, 
[src]

Workaround for reverse addition.

type Output = Construct<f64, U>

The resulting type after applying the + operator.

impl<T, U> Add<T> for Construct<T, U> where
    U: Add<T, Output = U>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<T, U> AddAssign<Construct<T, U>> for Construct<T, U> where
    U: AddAssign
[src]

impl<T, U> AddAssign<Construct<T, U>> for Construct<T, Construct<T, U>> where
    Construct<T, U>: AddAssign
[src]

impl<T, U> AddAssign<T> for Construct<T, U> where
    U: AddAssign<T>, 
[src]

impl<T, U> Algebra<T> for Construct<T, U> where
    T: Algebra + Clone,
    U: Algebra<T> + Clone
[src]

impl<T: Clone, U: Clone> Clone for Construct<T, U>[src]

impl<T, U> Conj for Construct<T, U> where
    U: Conj + Neg<Output = U>, 
[src]

impl<T: Copy, U: Copy> Copy for Construct<T, U>[src]

impl<T: Debug, U> Debug for Construct<T, U> where
    Self: Format<T>, 
[src]

impl<T: Algebra + Clone> Deriv<Construct<T, T>> for Moebius<Complex<T>>[src]

impl<T: NumCast + Algebra + Dot<Output = T> + Clone> DerivDir<Construct<T, Construct<T, T>>> for Moebius<Complex<T>>[src]

impl<T: Display, U> Display for Construct<T, U> where
    Self: Format<T>, 
[src]

impl<T, U> Distribution<Construct<T, U>> for StandardNormal where
    StandardNormal: Distribution<U>, 
[src]

impl<T: Float, U: NormSqr<Output = T> + Clone> Distribution<Construct<T, U>> for NonZero where
    StandardNormal: Distribution<Construct<T, U>>, 
[src]

impl<T: Float, U: NormSqr<Output = T> + Div<T, Output = U> + Clone> Distribution<Construct<T, U>> for Unit where
    NonZero: Distribution<Construct<T, U>>, 
[src]

impl<T, U> Div<Construct<T, Construct<T, U>>> for Construct<T, U> where
    Construct<T, Self>: Inv<Output = Construct<T, Self>>,
    Self: Mul<Construct<T, Self>, Output = Construct<T, Self>>, 
[src]

type Output = Construct<T, Construct<T, U>>

The resulting type after applying the / operator.

impl<T, U> Div<Construct<T, U>> for Construct<T, U> where
    Self: Inv<Output = Self> + Mul<Output = Self>, 
[src]

type Output = Self

The resulting type after applying the / operator.

impl<T, U> Div<Construct<T, U>> for Construct<T, Construct<T, U>> where
    Construct<T, U>: Div<Output = Construct<T, U>> + Clone
[src]

type Output = Self

The resulting type after applying the / operator.

impl<U> Div<Construct<f32, U>> for f32 where
    Construct<f32, U>: Inv<Output = Construct<f32, U>> + Mul<f32, Output = Construct<f32, U>> + Clone
[src]

Workaround for reverse division.

type Output = Construct<f32, U>

The resulting type after applying the / operator.

impl<U> Div<Construct<f64, U>> for f64 where
    Construct<f64, U>: Inv<Output = Construct<f64, U>> + Mul<f64, Output = Construct<f64, U>> + Clone
[src]

Workaround for reverse division.

type Output = Construct<f64, U>

The resulting type after applying the / operator.

impl<T, U> Div<T> for Construct<T, U> where
    T: Clone,
    U: Div<T, Output = U>, 
[src]

type Output = Self

The resulting type after applying the / operator.

impl<T, U> DivAssign<Construct<T, U>> for Construct<T, U> where
    Self: Clone + Div<Output = Self>, 
[src]

impl<T, U> DivAssign<Construct<T, U>> for Construct<T, Construct<T, U>> where
    Self: Div<Construct<T, U>, Output = Self> + Clone
[src]

impl<T, U> DivAssign<T> for Construct<T, U> where
    Self: Clone + Div<T, Output = Self>, 
[src]

impl<T, U> Dot for Construct<T, U> where
    T: Add<Output = T>,
    U: Dot<Output = T>, 
[src]

type Output = T

Dot product output type.

impl<T, U> Format<T> for Construct<T, Construct<T, U>> where
    Construct<T, U>: Format<T>, 
[src]

impl<T> Format<T> for Construct<T, T>[src]

impl<T, U> Inv for Construct<T, U> where
    Self: Clone + Conj + NormSqr<Output = T> + Div<T, Output = Self>, 
[src]

type Output = Self

The result after applying the operator.

impl<T, U> Mul<Construct<T, Construct<T, U>>> for Construct<T, U> where
    Construct<T, U>: Mul<Output = Construct<T, U>> + Clone
[src]

type Output = Construct<T, Construct<T, U>>

The resulting type after applying the * operator.

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

type Output = Self

The resulting type after applying the * operator.

impl<T, U> Mul<Construct<T, U>> for Construct<T, Construct<T, U>> where
    Construct<T, U>: Mul<Output = Construct<T, U>> + Clone
[src]

type Output = Self

The resulting type after applying the * operator.

impl<U> Mul<Construct<f32, U>> for f32 where
    Construct<f32, U>: Mul<f32, Output = Construct<f32, U>>, 
[src]

Workaround for reverse multiplication.

type Output = Construct<f32, U>

The resulting type after applying the * operator.

impl<U> Mul<Construct<f64, U>> for f64 where
    Construct<f64, U>: Mul<f64, Output = Construct<f64, U>>, 
[src]

Workaround for reverse multiplication.

type Output = Construct<f64, U>

The resulting type after applying the * operator.

impl<T, U> Mul<T> for Construct<T, U> where
    T: Clone,
    U: Mul<T, Output = U>, 
[src]

type Output = Self

The resulting type after applying the * operator.

impl<T, U> MulAssign<Construct<T, U>> for Construct<T, U> where
    Self: Clone + Mul<Output = Self>, 
[src]

impl<T, U> MulAssign<Construct<T, U>> for Construct<T, Construct<T, U>> where
    Self: Mul<Construct<T, U>, Output = Self> + Clone
[src]

impl<T, U> MulAssign<T> for Construct<T, U> where
    Self: Clone + Mul<T, Output = Self>, 
[src]

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

type Output = Self

The resulting type after applying the - operator.

impl<T, U> Norm for Construct<T, U> where
    T: Float,
    Self: NormSqr<Output = T>, 
[src]

type Output = T

impl<T, U> NormL1 for Construct<T, U> where
    T: Add<Output = T>,
    U: NormL1<Output = T>, 
[src]

type Output = T

impl<T, U> NormSqr for Construct<T, U> where
    T: Add<Output = T>,
    U: NormSqr<Output = T>, 
[src]

type Output = T

impl<T: Num + Algebra + Clone, U: Num + Algebra<T> + Clone> Num for Construct<T, U>[src]

Not implemented yet.

type FromStrRadixErr = ()

impl<T, U> One for Construct<T, U> where
    U: Zero + One,
    Self: Mul<Output = Self>, 
[src]

impl<T: PartialEq, U: PartialEq> PartialEq<Construct<T, U>> for Construct<T, U>[src]

impl<T: Clone, U> RelativeEq<Construct<T, U>> for Construct<T, U> where
    T: RelativeEq<Epsilon = T>,
    U: RelativeEq<Epsilon = T>, 
[src]

impl<T: Num + Algebra + Clone, U: Num + Algebra<T> + Clone> Rem<Construct<T, U>> for Construct<T, U>[src]

Not implemented yet.

type Output = Self

The resulting type after applying the % operator.

impl<T, U> StructuralPartialEq for Construct<T, U>[src]

impl<T, U> Sub<Construct<T, Construct<T, U>>> for Construct<T, U> where
    Construct<T, U>: Sub<Output = Construct<T, U>>, 
[src]

type Output = Construct<T, Construct<T, U>>

The resulting type after applying the - operator.

impl<T, U> Sub<Construct<T, U>> for Construct<T, U> where
    U: Sub<Output = U>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T, U> Sub<Construct<T, U>> for Construct<T, Construct<T, U>> where
    Construct<T, U>: Sub<Output = Construct<T, U>>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<U> Sub<Construct<f32, U>> for f32 where
    Construct<f32, U>: Neg<Output = Construct<f32, U>> + Add<f32, Output = Construct<f32, U>>, 
[src]

Workaround for reverse subtraction.

type Output = Construct<f32, U>

The resulting type after applying the - operator.

impl<U> Sub<Construct<f64, U>> for f64 where
    Construct<f64, U>: Neg<Output = Construct<f64, U>> + Add<f64, Output = Construct<f64, U>>, 
[src]

Workaround for reverse subtraction.

type Output = Construct<f64, U>

The resulting type after applying the - operator.

impl<T, U> Sub<T> for Construct<T, U> where
    U: Sub<T, Output = U>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T, U> SubAssign<Construct<T, U>> for Construct<T, U> where
    U: SubAssign
[src]

impl<T, U> SubAssign<Construct<T, U>> for Construct<T, Construct<T, U>> where
    Construct<T, U>: SubAssign
[src]

impl<T, U> SubAssign<T> for Construct<T, U> where
    U: SubAssign<T>, 
[src]

impl<T: Algebra + Clone, U: Algebra<T> + Clone> Transform<Construct<T, Construct<T, U>>> for Moebius<Construct<T, U>>[src]

impl<T: Clone, U> UlpsEq<Construct<T, U>> for Construct<T, U> where
    T: UlpsEq<Epsilon = T>,
    U: UlpsEq<Epsilon = T>, 
[src]

impl<T, U> Zero for Construct<T, U> where
    U: Zero
[src]

Auto Trait Implementations

impl<T, U> RefUnwindSafe for Construct<T, U> where
    T: RefUnwindSafe,
    U: RefUnwindSafe

impl<T, U> Send for Construct<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for Construct<T, U> where
    T: Sync,
    U: Sync

impl<T, U> Unpin for Construct<T, U> where
    T: Unpin,
    U: Unpin

impl<T, U> UnwindSafe for Construct<T, U> where
    T: UnwindSafe,
    U: 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, 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>, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,