pub struct Dual {
pub re: f64,
pub eps: f64,
}Expand description
re + eps·ε with ε² = 0. Arithmetic on duals carries the derivative of every intermediate along a single
direction, which is what the Hessian-vector product needs.
Fields§
§re: f64The value.
eps: f64The derivative along the seeded direction.
Implementations§
Trait Implementations§
Source§impl AddAssign for Dual
impl AddAssign for Dual
Source§fn add_assign(&mut self, o: Dual)
fn add_assign(&mut self, o: Dual)
Performs the
+= operation. Read moreimpl Copy for Dual
Source§impl DivAssign for Dual
impl DivAssign for Dual
Source§fn div_assign(&mut self, o: Dual)
fn div_assign(&mut self, o: Dual)
Performs the
/= operation. Read moreSource§impl MulAssign for Dual
impl MulAssign for Dual
Source§fn mul_assign(&mut self, o: Dual)
fn mul_assign(&mut self, o: Dual)
Performs the
*= operation. Read moreSource§impl Num for Dual
impl Num for Dual
type FromStrRadixErr = <f64 as Num>::FromStrRadixErr
Source§fn from_str_radix(s: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix(s: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
Convert from a string and radix (typically
2..=36). Read moreSource§impl PartialOrd for Dual
impl PartialOrd for Dual
Source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Duals order by value alone, so pivoting and max choose the same branch as the f64 computation.
Source§impl RemAssign for Dual
impl RemAssign for Dual
Source§fn rem_assign(&mut self, o: Dual)
fn rem_assign(&mut self, o: Dual)
Performs the
%= operation. Read moreSource§impl Scalar for Dual
impl Scalar for Dual
impl StructuralPartialEq for Dual
Auto Trait Implementations§
impl Forget for Dual
impl Freeze for Dual
impl Move for Dual
impl RefUnwindSafe for Dual
impl Send for Dual
impl Sync for Dual
impl Unpin for Dual
impl UnsafeUnpin for Dual
impl UnwindSafe for Dual
Blanket Implementations§
Source§impl<N, R, C, S> ArgminAdd<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + ClosedAddAssign + Copy,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R, C, S> ArgminAdd<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + ClosedAddAssign + Copy,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
Source§impl<N, R, C, S> ArgminDiv<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedDivAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R, C, S> ArgminDiv<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedDivAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
Source§impl<N, R, C, S> ArgminDot<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedMulAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R, C, S> ArgminDot<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedMulAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
Source§impl<N, R, C, S> ArgminMul<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedMulAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R, C, S> ArgminMul<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for Nwhere
N: Scalar + Copy + ClosedMulAssign,
R: Dim,
C: Dim,
S: Storage<N, R, C>,
DefaultAllocator: Allocator<N, R, C>,
Source§impl<N, R, C, S> ArgminSub<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for N
impl<N, R, C, S> ArgminSub<Matrix<N, R, C, S>, Matrix<N, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<N>>> for N
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, Right> ClosedAdd<Right> for T
impl<T, Right> ClosedAddAssign<Right> for T
impl<T, Right> ClosedDiv<Right> for T
impl<T, Right> ClosedDivAssign<Right> for T
impl<T, Right> ClosedMul<Right> for T
impl<T, Right> ClosedMulAssign<Right> for T
impl<T> ClosedNeg for Twhere
T: Neg<Output = T>,
impl<T, Right> ClosedSub<Right> for T
impl<T, Right> ClosedSubAssign<Right> for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> NumAssign for Twhere
T: Num + NumAssignOps,
impl<T, Rhs> NumAssignOps<Rhs> for T
impl<T, Rhs, Output> NumOps<Rhs, Output> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
impl<T> SendAlias for T
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.