pub struct HyperDual<T: DualNum<F>, F> {
pub re: T,
pub eps1: T,
pub eps2: T,
pub eps1eps2: T,
/* private fields */
}Expand description
A scalar hyper-dual number for the calculation of second partial derivatives.
Fields§
§re: TReal part of the hyper-dual number
eps1: TPartial derivative part of the hyper-dual number
eps2: TPartial derivative part of the hyper-dual number
eps1eps2: TSecond partial derivative part of the hyper-dual number
Implementations§
source§impl<T: DualNum<F>, F> HyperDual<T, F>
impl<T: DualNum<F>, F> HyperDual<T, F>
sourcepub fn derivative1(self) -> Self
pub fn derivative1(self) -> Self
Set the partial derivative part w.r.t. the 1st variable to 1.
sourcepub fn derivative2(self) -> Self
pub fn derivative2(self) -> Self
Set the partial derivative part w.r.t. the 2nd variable to 1.
Trait Implementations§
source§impl<T: DualNum<F>, F> AddAssign<F> for HyperDual<T, F>
impl<T: DualNum<F>, F> AddAssign<F> for HyperDual<T, F>
source§fn add_assign(&mut self, other: F)
fn add_assign(&mut self, other: F)
Performs the
+= operation. Read moresource§impl<T: DualNum<F>, F> AddAssign<HyperDual<T, F>> for HyperDual<T, F>
impl<T: DualNum<F>, F> AddAssign<HyperDual<T, F>> for HyperDual<T, F>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moresource§impl<T: DualNum<F>, F: DualNumFloat> DivAssign<F> for HyperDual<T, F>
impl<T: DualNum<F>, F: DualNumFloat> DivAssign<F> for HyperDual<T, F>
source§fn div_assign(&mut self, other: F)
fn div_assign(&mut self, other: F)
Performs the
/= operation. Read moresource§impl<T: DualNum<F>, F: Float> DivAssign<HyperDual<T, F>> for HyperDual<T, F>
impl<T: DualNum<F>, F: Float> DivAssign<HyperDual<T, F>> for HyperDual<T, F>
source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/= operation. Read moresource§impl<T: DualNum<F>, F: DualNumFloat> DualNum<F> for HyperDual<T, F>
impl<T: DualNum<F>, F: DualNumFloat> DualNum<F> for HyperDual<T, F>
source§fn sin_cos(&self) -> (Self, Self)
fn sin_cos(&self) -> (Self, Self)
Calculate sine and cosine simultaneously
source§impl<T: DualNum<F>, F: Float + FloatConst> FloatConst for HyperDual<T, F>
impl<T: DualNum<F>, F: Float + FloatConst> FloatConst for HyperDual<T, F>
source§impl<T: DualNum<F>, F: Float + FromPrimitive> FromPrimitive for HyperDual<T, F>
impl<T: DualNum<F>, F: Float + FromPrimitive> FromPrimitive for HyperDual<T, F>
source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
Converts an
isize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
Converts an
i8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
Converts an
i16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
Converts an
i32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
Converts an
i64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
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 moresource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
Converts a
usize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
Converts an
u8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
Converts an
u16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
Converts an
u32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
Converts an
u64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
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 moresource§impl<T: DualNum<F>, F: DualNumFloat> MulAssign<F> for HyperDual<T, F>
impl<T: DualNum<F>, F: DualNumFloat> MulAssign<F> for HyperDual<T, F>
source§fn mul_assign(&mut self, other: F)
fn mul_assign(&mut self, other: F)
Performs the
*= operation. Read moresource§impl<T: DualNum<F>, F: Float> MulAssign<HyperDual<T, F>> for HyperDual<T, F>
impl<T: DualNum<F>, F: Float> MulAssign<HyperDual<T, F>> for HyperDual<T, F>
source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*= operation. Read moresource§impl<T: DualNum<F> + Signed, F: Float> Num for HyperDual<T, F>
impl<T: DualNum<F> + Signed, F: Float> Num for HyperDual<T, F>
type FromStrRadixErr = <F as Num>::FromStrRadixErr
source§fn from_str_radix(
_str: &str,
_radix: u32
) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix( _str: &str, _radix: u32 ) -> Result<Self, Self::FromStrRadixErr>
Convert from a string and radix (typically
2..=36). Read moresource§impl<T: PartialEq + DualNum<F>, F: PartialEq> PartialEq<HyperDual<T, F>> for HyperDual<T, F>
impl<T: PartialEq + DualNum<F>, F: PartialEq> PartialEq<HyperDual<T, F>> for HyperDual<T, F>
source§impl<T: DualNum<F>, F> RemAssign<F> for HyperDual<T, F>
impl<T: DualNum<F>, F> RemAssign<F> for HyperDual<T, F>
source§fn rem_assign(&mut self, _other: F)
fn rem_assign(&mut self, _other: F)
Performs the
%= operation. Read moresource§impl<T: DualNum<F>, F> RemAssign<HyperDual<T, F>> for HyperDual<T, F>
impl<T: DualNum<F>, F> RemAssign<HyperDual<T, F>> for HyperDual<T, F>
source§fn rem_assign(&mut self, _other: Self)
fn rem_assign(&mut self, _other: Self)
Performs the
%= operation. Read moresource§impl<T: DualNum<F>, F: DualNumFloat> Signed for HyperDual<T, F>
impl<T: DualNum<F>, F: DualNumFloat> Signed for HyperDual<T, F>
source§fn is_positive(&self) -> bool
fn is_positive(&self) -> bool
Returns true if the number is positive and false if the number is zero or negative.
source§fn is_negative(&self) -> bool
fn is_negative(&self) -> bool
Returns true if the number is negative and false if the number is zero or positive.
source§impl<T: DualNum<F>, F> SubAssign<F> for HyperDual<T, F>
impl<T: DualNum<F>, F> SubAssign<F> for HyperDual<T, F>
source§fn sub_assign(&mut self, other: F)
fn sub_assign(&mut self, other: F)
Performs the
-= operation. Read moresource§impl<T: DualNum<F>, F> SubAssign<HyperDual<T, F>> for HyperDual<T, F>
impl<T: DualNum<F>, F> SubAssign<HyperDual<T, F>> for HyperDual<T, F>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreimpl<T: Copy + DualNum<F>, F: Copy> Copy for HyperDual<T, F>
impl<T: Eq + DualNum<F>, F: Eq> Eq for HyperDual<T, F>
impl<T: DualNum<F>, F> StructuralEq for HyperDual<T, F>
impl<T: DualNum<F>, F> StructuralPartialEq for HyperDual<T, F>
Auto Trait Implementations§
impl<T, F> RefUnwindSafe for HyperDual<T, F>where F: RefUnwindSafe, T: RefUnwindSafe,
impl<T, F> Send for HyperDual<T, F>where F: Send, T: Send,
impl<T, F> Sync for HyperDual<T, F>where F: Sync, T: Sync,
impl<T, F> Unpin for HyperDual<T, F>where F: Unpin, T: Unpin,
impl<T, F> UnwindSafe for HyperDual<T, F>where F: UnwindSafe, T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.