Struct num_dual::Dual3

source ·
pub struct Dual3<T, F = T> {
    pub re: T,
    pub v1: T,
    pub v2: T,
    pub v3: T,
    /* private fields */
}
Expand description

A scalar third order dual number for the calculation of third derivatives.

Fields§

§re: T

Real part of the third order dual number

§v1: T

First derivative part of the third order dual number

§v2: T

Second derivative part of the third order dual number

§v3: T

Third derivative part of the third order dual number

Implementations§

Create a new third order dual number from its fields.

Create a new third order dual number from the real part.

Derive a third order dual number, i.e. set the first derivative part to 1.

let x = Dual3::from_re(5.0).derive().powi(3);
assert_eq!(x.re, 125.0);
assert_eq!(x.v1, 75.0);
assert_eq!(x.v2, 30.0);
assert_eq!(x.v3, 6.0);

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
Performs the += operation. Read more
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
Formats the value using the given formatter. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Highest derivative that can be calculated with this struct
Real part (0th derivative) of the number
Multiply the number with the scalar f inplace.
Reciprocal (inverse) of a number 1/x.
Power with integer exponent x^n
Power with real exponent x^n
Square root
Cubic root
Exponential e^x
Exponential with base 2 2^x
Exponential minus 1 e^x-1
Natural logarithm
Logarithm with arbitrary base
Logarithm with base 2
Logarithm with base 10
Logarithm on x plus one ln(1+x)
Sine
Cosine
Calculate sine and cosine simultaneously
Tangent
Arcsine
Arccosine
Arctangent
Hyperbolic sine
Hyperbolic cosine
Hyperbolic tangent
Area hyperbolic sine
Area hyperbolic cosine
Area hyperbolic tangent
0th order spherical Bessel function of the first kind
1st order spherical Bessel function of the first kind
2nd order spherical Bessel function of the first kind
Fused multiply-add
Power with dual exponent x^n
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).
Return the full circle constant τ.
Return log10(2.0).
Return log2(10.0).
Converts to this type from the input type.
Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
The result after applying the operator.
Returns the multiplicative inverse of self. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
Convert from a string and radix (typically 2..=36). Read more
Returns the multiplicative identity element of Self, 1. Read more
Returns true if self is equal to the multiplicative identity. Read more
Sets self to the multiplicative identity element of Self, 1.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Method which takes an iterator and generates Self from the elements by multiplying the items.
Method which takes an iterator and generates Self from the elements by multiplying the items.
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
Performs the %= operation. Read more
Performs the %= operation. Read more
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.
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
Method which takes an iterator and generates Self from the elements by “summing up” the items.
Method which takes an iterator and generates Self from the elements by “summing up” the items.
Returns the additive identity element of Self, 0. Read more
Returns true if self is equal to the additive identity.
Sets self to the additive identity element of Self, 0.

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
Converts to this type from the input type.

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.