Struct dual_num::Dual[][src]

pub struct Dual<T: Scalar>(_);

Dual Number structure

Although Dual does implement PartialEq and PartialOrd, it only compares the real part.

Additionally, min and max only compare the real parts, and keep the dual parts.

Lastly, the Rem remainder operator is not correctly or fully defined for Dual, and will panic.

Methods

impl<T: Scalar> Dual<T>
[src]

Create a new dual number from its real and dual parts.

Create a new dual number from a real number.

The dual part is set to zero.

Returns the real part

Returns the dual part

Returns both real and dual parts as a tuple

Important traits for &'a mut R

Returns a reference to the real part

Important traits for &'a mut R

Returns a reference to the dual part

Important traits for &'a mut R

Returns a mutable reference to the real part

Important traits for &'a mut R

Returns a mutable reference to the dual part

impl<T: Scalar + Neg<Output = T>> Dual<T>
[src]

Returns the conjugate of the dual number.

Trait Implementations

impl<T: Clone + Scalar> Clone for Dual<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Copy + Scalar> Copy for Dual<T>
[src]

impl<T: Scalar> Debug for Dual<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Scalar + Zero> From<T> for Dual<T>
[src]

Performs the conversion.

impl<T: Scalar> Deref for Dual<T>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<T: Scalar> DerefMut for Dual<T>
[src]

Mutably dereferences the value.

impl<T: Scalar + Display> Display for Dual<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Scalar + PartialEq> PartialEq<Self> for Dual<T>
[src]

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

This method tests for !=.

impl<T: Scalar + PartialOrd> PartialOrd<Self> for Dual<T>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Scalar + PartialEq> PartialEq<T> for Dual<T>
[src]

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

This method tests for !=.

impl<T: Scalar + PartialOrd> PartialOrd<T> for Dual<T>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Scalar + ToPrimitive> ToPrimitive for Dual<T>
[src]

Converts the value of self to an isize.

Converts the value of self to an i8.

Converts the value of self to an i16.

Converts the value of self to an i32.

Converts the value of self to an i64.

Converts the value of self to a usize.

Converts the value of self to an u8.

Converts the value of self to an u16.

Converts the value of self to an u32.

Converts the value of self to an u64.

Converts the value of self to an f32.

Converts the value of self to an f64.

Converts the value of self to an i128. Read more

Converts the value of self to an u128. Read more

impl<T: Scalar + FromPrimitive> FromPrimitive for Dual<T> where
    T: Zero
[src]

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl<T: Scalar + Num> Add<T> for Dual<T>
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<T: Scalar + Num> AddAssign<T> for Dual<T>
[src]

Performs the += operation.

impl<T: Scalar + Num> Sub<T> for Dual<T>
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<T: Scalar + Num> SubAssign<T> for Dual<T>
[src]

Performs the -= operation.

impl<T: Scalar + Num> Mul<T> for Dual<T>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T: Scalar + Num> MulAssign<T> for Dual<T>
[src]

Performs the *= operation.

impl<T: Scalar + Num> Div<T> for Dual<T>
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<T: Scalar + Num> DivAssign<T> for Dual<T>
[src]

Performs the /= operation.

impl<T: Scalar + Signed> Neg for Dual<T>
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<T: Scalar + Num> Add<Self> for Dual<T>
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<T: Scalar + Num> AddAssign<Self> for Dual<T>
[src]

Performs the += operation.

impl<T: Scalar + Num> Sub<Self> for Dual<T>
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<T: Scalar + Num> SubAssign<Self> for Dual<T>
[src]

Performs the -= operation.

impl<T: Scalar + Num> Mul<Self> for Dual<T>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T: Scalar + Num> MulAssign<Self> for Dual<T>
[src]

Performs the *= operation.

impl<T: Scalar + Num + Mul + Add> MulAdd<Self, Self> for Dual<T>
[src]

The resulting type after applying the fused multiply-add.

Performs the fused multiply-add operation.

impl<T: Scalar + Num + Mul + Add> MulAddAssign<Self, Self> for Dual<T>
[src]

Performs the fused multiply-add operation.

impl<T: Scalar + Num + Mul + Add> MulAdd<T, Self> for Dual<T>
[src]

The resulting type after applying the fused multiply-add.

Performs the fused multiply-add operation.

impl<T: Scalar + Num + Mul + Add> MulAddAssign<T, Self> for Dual<T>
[src]

Performs the fused multiply-add operation.

impl<T: Scalar + Num + Mul + Add> MulAdd<Self, T> for Dual<T>
[src]

The resulting type after applying the fused multiply-add.

Performs the fused multiply-add operation.

impl<T: Scalar + Num + Mul + Add> MulAddAssign<Self, T> for Dual<T>
[src]

Performs the fused multiply-add operation.

impl<T: Scalar + Num + Mul + Add> MulAdd<T, T> for Dual<T>
[src]

The resulting type after applying the fused multiply-add.

Performs the fused multiply-add operation.

impl<T: Scalar + Num + Mul + Add> MulAddAssign<T, T> for Dual<T>
[src]

Performs the fused multiply-add operation.

impl<T: Scalar + Num> Div<Self> for Dual<T>
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<T: Scalar + Num> DivAssign<Self> for Dual<T>
[src]

Performs the /= operation.

impl<T: Scalar + Num> Rem<Self> for Dual<T>
[src]

The resulting type after applying the % operator.

UNIMPLEMENTED!!!

As far as I know, remainder is not a valid operation on dual numbers, but is required for the Float trait to be implemented.

impl<T: Scalar, P: Into<Dual<T>>> Pow<P> for Dual<T> where
    Dual<T>: Float
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T: Scalar> Inv for Dual<T> where
    Self: One + Div<Output = Self>, 
[src]

The result after applying the operator.

Returns the multiplicative inverse of self. Read more

impl<T: Scalar> Signed for Dual<T> where
    T: Signed + PartialOrd
[src]

Computes the absolute value. Read more

The positive difference of two numbers. Read more

Returns the sign of the number. Read more

Returns true if the number is positive and false if the number is zero or negative.

Returns true if the number is negative and false if the number is zero or positive.

impl<T: Scalar + Unsigned> Unsigned for Dual<T> where
    Self: Num
[src]

impl<T: Scalar + Num + Zero> Zero for Dual<T>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl<T: Scalar + Num + One> One for Dual<T>
[src]

Returns the multiplicative identity element of Self, 1. Read more

Returns true if self is equal to the multiplicative identity. Read more

impl<T: Scalar + Num> Num for Dual<T>
[src]

Convert from a string and radix <= 36. Read more

impl<T: Scalar + Float> NumCast for Dual<T>
[src]

Creates a number from another value that can be converted into a primitive via the ToPrimitive trait. Read more

impl<T: Scalar + FloatConst + Zero> FloatConst for Dual<T>
[src]

Return Euler’s number.

Return 1.0 / π.

Return 1.0 / sqrt(2.0).

Return 2.0 / π.

Return 2.0 / sqrt(π).

Return π / 2.0.

Return π / 3.0.

Return π / 4.0.

Return π / 6.0.

Return π / 8.0.

Return ln(10.0).

Return ln(2.0).

Return log10(e).

Return log2(e).

Return Archimedes’ constant.

Return sqrt(2.0).

impl<T: Scalar> Float for Dual<T> where
    T: Float + Signed + FloatConst
[src]

Returns the NaN value. Read more

Returns the infinite value. Read more

Returns the negative infinite value. Read more

Returns -0.0. Read more

Returns the smallest positive, normalized value that this type can represent. Read more

Returns epsilon, a small positive value. Read more

Returns the smallest finite value that this type can represent. Read more

Returns the largest finite value that this type can represent. Read more

Returns true if this value is NaN and false otherwise. Read more

Returns true if this value is positive infinity or negative infinity and false otherwise. Read more

Returns true if this number is neither infinite nor NaN. Read more

Returns true if the number is neither zero, infinite, [subnormal][subnormal], or NaN. Read more

Returns true if self is positive, including +0.0, Float::infinity(), and since Rust 1.20 also Float::nan(). Read more

Returns true if self is negative, including -0.0, Float::neg_infinity(), and since Rust 1.20 also -Float::nan(). Read more

Returns the floating point category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead. Read more

Returns the largest integer less than or equal to a number. Read more

Returns the smallest integer greater than or equal to a number. Read more

Returns the nearest integer to a number. Round half-way cases away from 0.0. Read more

Return the integer part of a number. Read more

Returns the fractional part of a number. Read more

Returns a number that represents the sign of self. Read more

Computes the absolute value of self. Returns Float::nan() if the number is Float::nan(). Read more

Returns the maximum of the two numbers. Read more

Returns the minimum of the two numbers. Read more

The positive difference of two numbers. Read more

Fused multiply-add. Computes (self * a) + b with only one rounding error, yielding a more accurate result than an unfused multiply-add. Read more

Take the reciprocal (inverse) of a number, 1/x. Read more

Raise a number to an integer power. Read more

Raise a number to a floating point power. Read more

Returns e^(self), (the exponential function). Read more

Returns 2^(self). Read more

Returns the natural logarithm of the number. Read more

Returns the logarithm of the number with respect to an arbitrary base. Read more

Returns the base 2 logarithm of the number. Read more

Returns the base 10 logarithm of the number. Read more

Take the square root of a number. Read more

Take the cubic root of a number. Read more

Calculate the length of the hypotenuse of a right-angle triangle given legs of length x and y. Read more

Computes the sine of a number (in radians). Read more

Computes the cosine of a number (in radians). Read more

Computes the tangent of a number (in radians). Read more

Computes the arcsine of a number. Return value is in radians in the range [-pi/2, pi/2] or NaN if the number is outside the range [-1, 1]. Read more

Computes the arccosine of a number. Return value is in radians in the range [0, pi] or NaN if the number is outside the range [-1, 1]. Read more

Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2]; Read more

Computes the four quadrant arctangent of self (y) and other (x). Read more

Simultaneously computes the sine and cosine of the number, x. Returns (sin(x), cos(x)). Read more

Returns e^(self) - 1 in a way that is accurate even if the number is close to zero. Read more

Returns ln(1+n) (natural logarithm) more accurately than if the operations were performed separately. Read more

Hyperbolic sine function. Read more

Hyperbolic cosine function. Read more

Hyperbolic tangent function. Read more

Inverse hyperbolic sine function. Read more

Inverse hyperbolic cosine function. Read more

Inverse hyperbolic tangent function. Read more

Returns the mantissa, base 2 exponent, and sign as integers, respectively. The original number can be recovered by sign * mantissa * 2 ^ exponent. Read more

Converts radians to degrees. Read more

Converts degrees to radians. Read more

Auto Trait Implementations

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

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