Struct num_dual::Derivative

source ·
pub struct Derivative<T: DualNum<F>, F, R: Dim, C: Dim>(_, _)
where
         DefaultAllocator: Allocator<T, R, C>;
Expand description

Wrapper struct for a derivative vector or matrix.

Implementations§

source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source

pub fn new(derivative: Option<OMatrix<T, R, C>>) -> Self

source

pub fn some(derivative: OMatrix<T, R, C>) -> Self

source

pub fn none() -> Self

source

pub fn derivative_generic(r: R, c: C, i: usize) -> Self

source

pub fn unwrap_generic(self, r: R, c: C) -> OMatrix<T, R, C>

source

pub fn fmt(&self, f: &mut Formatter<'_>, symbol: &str) -> Result

source§

impl<T: DualNum<F>, F> Derivative<T, F, U1, U1>

source

pub fn derivative() -> Self

source

pub fn unwrap(self) -> T

source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source

pub fn tr_mul<R2: Dim, C2: Dim>( &self, rhs: &Derivative<T, F, R2, C2> ) -> Derivative<T, F, C, C2>where DefaultAllocator: Allocator<T, R2, C2> + Allocator<T, C, C2>, ShapeConstraint: SameNumberOfRows<R, R2>,

Trait Implementations§

source§

impl<'a, T: DualNum<F>, F, R: Dim, C: Dim> Add<&'a Derivative<T, F, R, C>> for &'a Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl<'a, T: DualNum<F>, F, R: Dim, C: Dim> Add<&'a Derivative<T, F, R, C>> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Derivative<T, F, R, C>) -> Self::Output

Performs the + operation. Read more
source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> Add<Derivative<T, F, R, C>> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> AddAssign<Derivative<T, F, R, C>> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl<T: Clone + DualNum<F>, F: Clone, R: Clone + Dim, C: Clone + Dim> Clone for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source§

fn clone(&self) -> Derivative<T, F, R, C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + DualNum<F>, F: Debug, R: Debug + Dim, C: Debug + Dim> Debug for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T: DualNum<F>, F, R: Dim, C: Dim> Div<T> for &'a Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> Div<T> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> DivAssign<T> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
source§

impl<'a, 'b, T: DualNum<F>, F, R: Dim, C: Dim, R2: Dim, C2: Dim> Mul<&'b Derivative<T, F, R2, C2>> for &'a Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C> + Allocator<T, R2, C2> + Allocator<T, R, C2>, ShapeConstraint: SameNumberOfRows<C, R2>,

§

type Output = Derivative<T, F, R, C2>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Derivative<T, F, R2, C2>) -> Derivative<T, F, R, C2>

Performs the * operation. Read more
source§

impl<'a, T: DualNum<F>, F, R: Dim, C: Dim> Mul<T> for &'a Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> Mul<T> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> MulAssign<T> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
source§

impl<'a, T: DualNum<F>, F, R: Dim, C: Dim> Neg for &'a Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> Neg for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<T: PartialEq + DualNum<F>, F: PartialEq, R: PartialEq + Dim, C: PartialEq + Dim> PartialEq<Derivative<T, F, R, C>> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source§

fn eq(&self, other: &Derivative<T, F, R, C>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, R: Dim, C: Dim> SimdValue for Derivative<T, T::Element, R, C>where DefaultAllocator: Allocator<T, R, C> + Allocator<T::Element, R, C>, T: DualNum<T::Element> + SimdValue + Scalar, T::Element: DualNum<T::Element> + Scalar + Zero,

§

type Element = Derivative<<T as SimdValue>::Element, <T as SimdValue>::Element, R, C>

The type of the elements of each lane of this SIMD value.
§

type SimdBool = <T as SimdValue>::SimdBool

Type of the result of comparing two SIMD values like self.
source§

fn lanes() -> usize

The number of lanes of this SIMD value.
source§

fn splat(val: Self::Element) -> Self

Initializes an SIMD value with each lanes set to val.
source§

fn extract(&self, i: usize) -> Self::Element

Extracts the i-th lane of self. Read more
source§

unsafe fn extract_unchecked(&self, i: usize) -> Self::Element

Extracts the i-th lane of self without bound-checking.
source§

fn replace(&mut self, i: usize, val: Self::Element)

Replaces the i-th lane of self by val. Read more
source§

unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element)

Replaces the i-th lane of self by val without bound-checking.
source§

fn select(self, cond: Self::SimdBool, other: Self) -> Self

Merges self and other depending on the lanes of cond. Read more
source§

fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Selfwhere Self: Clone,

Applies a function to each lane of self. Read more
source§

fn zip_map_lanes( self, b: Self, f: impl Fn(Self::Element, Self::Element) -> Self::Element ) -> Selfwhere Self: Clone,

Applies a function to each lane of self paired with the corresponding lane of b. Read more
source§

impl<'a, T: DualNum<F>, F, R: Dim, C: Dim> Sub<&'a Derivative<T, F, R, C>> for &'a Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl<'a, T: DualNum<F>, F, R: Dim, C: Dim> Sub<&'a Derivative<T, F, R, C>> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Derivative<T, F, R, C>) -> Self::Output

Performs the - operation. Read more
source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> Sub<Derivative<T, F, R, C>> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

§

type Output = Derivative<T, F, R, C>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> SubAssign<Derivative<T, F, R, C>> for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl<TSuper, FSuper, T, F, R: Dim, C: Dim> SubsetOf<Derivative<TSuper, FSuper, R, C>> for Derivative<T, F, R, C>where TSuper: DualNum<FSuper> + SupersetOf<T>, T: DualNum<F>, DefaultAllocator: Allocator<T, R, C> + Allocator<TSuper, R, C>,

source§

fn to_superset(&self) -> Derivative<TSuper, FSuper, R, C>

The inclusion map: converts self to the equivalent element of its superset.
source§

fn from_superset(element: &Derivative<TSuper, FSuper, R, C>) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn from_superset_unchecked(element: &Derivative<TSuper, FSuper, R, C>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
source§

fn is_in_subset(element: &Derivative<TSuper, FSuper, R, C>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
source§

impl<T: DualNum<F> + Copy, F: Copy, const R: usize, const C: usize> Copy for Derivative<T, F, Const<R>, Const<C>>

source§

impl<T: Eq + DualNum<F>, F: Eq, R: Eq + Dim, C: Eq + Dim> Eq for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> StructuralEq for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

source§

impl<T: DualNum<F>, F, R: Dim, C: Dim> StructuralPartialEq for Derivative<T, F, R, C>where DefaultAllocator: Allocator<T, R, C>,

Auto Trait Implementations§

§

impl<T, F, R, C> !RefUnwindSafe for Derivative<T, F, R, C>

§

impl<T, F, R, C> !Send for Derivative<T, F, R, C>

§

impl<T, F, R, C> !Sync for Derivative<T, F, R, C>

§

impl<T, F, R, C> !Unpin for Derivative<T, F, R, C>

§

impl<T, F, R, C> !UnwindSafe for Derivative<T, F, R, C>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, Right> ClosedAdd<Right> for Twhere T: Add<Right, Output = T> + AddAssign<Right>,

source§

impl<T, Right> ClosedDiv<Right> for Twhere T: Div<Right, Output = T> + DivAssign<Right>,

source§

impl<T, Right> ClosedMul<Right> for Twhere T: Mul<Right, Output = T> + MulAssign<Right>,

source§

impl<T> ClosedNeg for Twhere T: Neg<Output = T>,

source§

impl<T, Right> ClosedSub<Right> for Twhere T: Sub<Right, Output = T> + SubAssign<Right>,

source§

impl<T> Scalar for Twhere T: 'static + Clone + PartialEq<T> + Debug,