[][src]Struct hyperdual::Hyperdual

pub struct Hyperdual<T: Scalar, N: Dim + DimName>(_)
where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
;

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, N: Dim + DimName> Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

pub fn from_slice(v: &[T]) -> Hyperdual<T, N>[src]

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

pub fn from_real(real: T) -> Hyperdual<T, N> where
    T: Zero
[src]

Create a new dual number from a real number.

The dual part is set to zero.

pub fn real(&self) -> T[src]

Returns the real part

pub fn real_ref(&self) -> &T[src]

Returns a reference to the real part

pub fn real_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the real part

pub fn map_dual<F>(&self, r: T, f: F) -> Hyperdual<T, N> where
    F: Fn(&T) -> T, 
[src]

pub fn from_fn<F>(f: F) -> Hyperdual<T, N> where
    F: FnMut(usize) -> T, 
[src]

Create a new dual number from a function

impl<T: Scalar + Neg<Output = T>, N: Dim + DimName> Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

pub fn conjugate(self) -> Self[src]

Returns the conjugate of the dual number.

impl<T: Scalar> Hyperdual<T, U2>[src]

pub fn new(real: T, dual: T) -> Dual<T>[src]

pub fn dual(&self) -> T[src]

pub fn dual_ref(&self) -> &T[src]

Returns a reference to the dual part

pub fn dual_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the dual part

Trait Implementations

impl<T: Scalar + Num, N: Dim + DimName> Add<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Self

The resulting type after applying the + operator.

impl<T: Scalar + Num, N: Dim + DimName> Add<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Hyperdual<T, N>

The resulting type after applying the + operator.

impl<T: Scalar + Num, N: Dim + DimName> AddAssign<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num, N: Dim + DimName> AddAssign<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar, N: Dim + DimName> AsMut<Matrix<T, N, U1, <DefaultAllocator as Allocator<T, N, U1>>::Buffer>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar, N: Dim + DimName> AsRef<Matrix<T, N, U1, <DefaultAllocator as Allocator<T, N, U1>>::Buffer>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Clone + Scalar, N: Clone + Dim + DimName> Clone for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Copy + Scalar, N: Copy + Dim + DimName> Copy for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar, N: Dim + DimName> Debug for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num + Zero, N: Dim + DimName> Default for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar, N: Dim + DimName> Deref for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Target = VectorN<T, N>

The resulting type after dereferencing.

impl<T: Scalar, N: Dim + DimName> DerefMut for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Display, N: Dim + DimName> Display for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num, N: Dim + DimName> Div<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Self

The resulting type after applying the / operator.

impl<T: Scalar + Num, N: Dim + DimName> Div<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Hyperdual<T, N>

The resulting type after applying the / operator.

impl<T: Scalar + Num, N: Dim + DimName> DivAssign<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num, N: Dim + DimName> DivAssign<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar, N: Dim + DimName> Float for Hyperdual<T, N> where
    T: Float + Signed + FloatConst,
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + FloatConst + Zero, N: Dim + DimName> FloatConst for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Zero, N: Dim + DimName> From<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + FromPrimitive, N: Dim + DimName> FromPrimitive for Hyperdual<T, N> where
    T: Zero,
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar, N: Dim + DimName> Inv for Hyperdual<T, N> where
    Self: One + Div<Output = Self>,
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Self

The result after applying the operator.

impl<T: Scalar + Num, N: Dim + DimName> Mul<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Self

The resulting type after applying the * operator.

impl<T: Scalar + Num, N: Dim + DimName> Mul<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Hyperdual<T, N>

The resulting type after applying the * operator.

impl<T: Scalar + Num + Mul + Add, N: Dim + DimName> MulAdd<Hyperdual<T, N>, Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Hyperdual<T, N>

The resulting type after applying the fused multiply-add.

impl<T: Scalar + Num + Mul + Add, N: Dim + DimName> MulAdd<Hyperdual<T, N>, T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Hyperdual<T, N>

The resulting type after applying the fused multiply-add.

impl<T: Scalar + Num + Mul + Add, N: Dim + DimName> MulAdd<T, Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Hyperdual<T, N>

The resulting type after applying the fused multiply-add.

impl<T: Scalar + Num + Mul + Add, N: Dim + DimName> MulAdd<T, T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Hyperdual<T, N>

The resulting type after applying the fused multiply-add.

impl<T: Scalar + Num + Mul + Add, N: Dim + DimName> MulAddAssign<Hyperdual<T, N>, Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num + Mul + Add, N: Dim + DimName> MulAddAssign<Hyperdual<T, N>, T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num + Mul + Add, N: Dim + DimName> MulAddAssign<T, Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num + Mul + Add, N: Dim + DimName> MulAddAssign<T, T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num, N: Dim + DimName> MulAssign<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num, N: Dim + DimName> MulAssign<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Signed, N: Dim + DimName> Neg for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T: Scalar + Num, N: Dim + DimName> Num for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type FromStrRadixErr = <T as Num>::FromStrRadixErr

impl<T: Scalar + Float, N: Dim + DimName> NumCast for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num + One, N: Dim + DimName> One for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + PartialEq, N: Dim + DimName> PartialEq<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + PartialEq, N: Dim + DimName> PartialEq<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + PartialOrd, N: Dim + DimName> PartialOrd<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + PartialOrd, N: Dim + DimName> PartialOrd<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar, P: Into<Hyperdual<T, N>>, N: Dim + DimName> Pow<P> for Hyperdual<T, N> where
    Hyperdual<T, N>: Float,
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Self

The result after applying the operator.

impl<'a, T: Scalar + Num + One, N: Dim + DimName> Product<&'a Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num + One, N: Dim + DimName> Product<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num, N: Dim + DimName> Rem<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Self

The resulting type after applying the % operator.

fn rem(self, _: Self) -> Self[src]

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, N: Dim + DimName> Signed for Hyperdual<T, N> where
    T: Signed + PartialOrd,
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num, N: Dim + DimName> Sub<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T: Scalar + Num, N: Dim + DimName> Sub<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

type Output = Hyperdual<T, N>

The resulting type after applying the - operator.

impl<T: Scalar + Num, N: Dim + DimName> SubAssign<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num, N: Dim + DimName> SubAssign<T> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<'a, T: Scalar + Num + Zero, N: Dim + DimName> Sum<&'a Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num + Zero, N: Dim + DimName> Sum<Hyperdual<T, N>> for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + ToPrimitive, N: Dim + DimName> ToPrimitive for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Unsigned, N: Dim + DimName> Unsigned for Hyperdual<T, N> where
    Self: Num,
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

impl<T: Scalar + Num + Zero, N: Dim + DimName> Zero for Hyperdual<T, N> where
    DefaultAllocator: Allocator<T, N>,
    Owned<T, N>: Copy
[src]

Auto Trait Implementations

impl<T, N> !RefUnwindSafe for Hyperdual<T, N>

impl<T, N> !Send for Hyperdual<T, N>

impl<T, N> !Sync for Hyperdual<T, N>

impl<T, N> !Unpin for Hyperdual<T, N>

impl<T, N> !UnwindSafe for Hyperdual<T, N>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

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

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

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> Real for T where
    T: Float
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,