[−][src]Struct peroxide::structure::ad::ADLift
Lift AD functions
Description
To lift AD
functions
Implementation
- All
Fn(T) -> T where T:AD
functions can be lift toFn(f64) -> f64
- If
j > i
, thenFn(AD{j}) -> AD{j}
can be lift toFn(AD{i}) -> AD{i}
Usage
extern crate peroxide; use peroxide::fuga::*; fn main() { let ad0 = 2f64; let ad1 = AD1(2f64, 1f64); let lift = ADLift::new(f_ad); let ans_ad0 = ad0.powi(2); let ans_ad1 = ad1.powi(2); // f_0: f64 -> f64 // f: AD -> AD assert_eq!(ans_ad0, lift.f_0(ad0)); assert_eq!(ans_ad1, lift.f(ad1)); } fn f_ad(x: AD) -> AD { x.powi(2) }
Implementations
impl<F: Fn(AD) -> AD> ADLift<F>
[src]
Trait Implementations
Auto Trait Implementations
impl<F> RefUnwindSafe for ADLift<F> where
F: RefUnwindSafe,
[src]
F: RefUnwindSafe,
impl<F> Send for ADLift<F> where
F: Send,
[src]
F: Send,
impl<F> Sync for ADLift<F> where
F: Sync,
[src]
F: Sync,
impl<F> Unpin for ADLift<F>
[src]
impl<F> UnwindSafe for ADLift<F> where
F: UnwindSafe,
[src]
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,