[−][src]Struct peroxide::structure::dual::Dual
Dual - Structure for AD
Fields
x: f64
: value
dx: f64
: slope at x
But they are private fields.
You should use value
or slope
function to extract them.
Implementations
impl Dual
[src]
pub fn new<T: Into<f64> + Copy>(x: T, dx: T) -> Dual
[src]
Syntactic sugar to declare dual
Type
(T, T) -> Dual where T: Into<f64> + Copy
Examples
extern crate peroxide; use peroxide::fuga::*; let a = Dual::new(2, 1); // y = x at x = 2 a.print();
pub fn value(&self) -> f64
[src]
Just extract value
pub fn slope(&self) -> f64
[src]
Just extract slope
pub fn extract(&self) -> (f64, f64)
[src]
Just extract both
pub fn set_value(&mut self, v: f64)
[src]
pub fn set_slope(&mut self, dv: f64)
[src]
Trait Implementations
impl<'a, 'b> Add<&'b Dual> for &'a Dual
[src]
type Output = Dual
The resulting type after applying the +
operator.
fn add(self, rhs: &Dual) -> Self::Output
[src]
impl Add<Dual> for Dual
[src]
Add for Dual
type Output = Dual
The resulting type after applying the +
operator.
fn add(self, other: Dual) -> Dual
[src]
impl Add<Dual> for f64
[src]
type Output = Dual
The resulting type after applying the +
operator.
fn add(self, other: Dual) -> Dual
[src]
impl Add<Dual> for Number
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Dual) -> Self::Output
[src]
impl Add<f64> for Dual
[src]
type Output = Dual
The resulting type after applying the +
operator.
fn add(self, other: f64) -> Dual
[src]
impl<'a> Add<f64> for &'a Dual
[src]
type Output = Dual
The resulting type after applying the +
operator.
fn add(self, rhs: f64) -> Self::Output
[src]
impl Clone for Dual
[src]
impl Copy for Dual
[src]
impl Debug for Dual
[src]
impl Default for Dual
[src]
impl Display for Dual
[src]
impl<'a, 'b> Div<&'b Dual> for &'a Dual
[src]
type Output = Dual
The resulting type after applying the /
operator.
fn div(self, rhs: &Dual) -> Self::Output
[src]
impl Div<Dual> for Dual
[src]
Div for Dual
type Output = Dual
The resulting type after applying the /
operator.
fn div(self, other: Dual) -> Dual
[src]
impl Div<Dual> for f64
[src]
type Output = Dual
The resulting type after applying the /
operator.
fn div(self, other: Dual) -> Dual
[src]
impl Div<Dual> for Number
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: Dual) -> Self::Output
[src]
impl Div<f64> for Dual
[src]
type Output = Dual
The resulting type after applying the /
operator.
fn div(self, other: f64) -> Dual
[src]
impl<'a> Div<f64> for &'a Dual
[src]
type Output = Dual
The resulting type after applying the /
operator.
fn div(self, rhs: f64) -> Self::Output
[src]
impl ExpLogOps for Dual
[src]
Exponential & Logarithm for Dual
fn exp(&self) -> Self
[src]
fn ln(&self) -> Self
[src]
fn log(&self, base: f64) -> Self
[src]
fn log2(&self) -> Self
[src]
fn log10(&self) -> Self
[src]
impl<'a, 'b> Mul<&'b Dual> for &'a Dual
[src]
type Output = Dual
The resulting type after applying the *
operator.
fn mul(self, rhs: &Dual) -> Self::Output
[src]
impl Mul<Dual> for Dual
[src]
Mul for Dual
type Output = Dual
The resulting type after applying the *
operator.
fn mul(self, other: Dual) -> Dual
[src]
impl Mul<Dual> for f64
[src]
type Output = Dual
The resulting type after applying the *
operator.
fn mul(self, other: Dual) -> Dual
[src]
impl Mul<Dual> for Number
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Dual) -> Self::Output
[src]
impl Mul<f64> for Dual
[src]
type Output = Dual
The resulting type after applying the *
operator.
fn mul(self, other: f64) -> Dual
[src]
impl<'a> Mul<f64> for &'a Dual
[src]
type Output = Dual
The resulting type after applying the *
operator.
fn mul(self, rhs: f64) -> Self::Output
[src]
impl Neg for Dual
[src]
Neg for Dual
impl<'a> Neg for &'a Dual
[src]
type Output = Dual
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl PartialEq<Dual> for Dual
[src]
impl PartialOrd<Dual> for Dual
[src]
fn partial_cmp(&self, other: &Dual) -> Option<Ordering>
[src]
fn lt(&self, other: &Dual) -> bool
[src]
fn le(&self, other: &Dual) -> bool
[src]
fn gt(&self, other: &Dual) -> bool
[src]
fn ge(&self, other: &Dual) -> bool
[src]
impl PowOps for Dual
[src]
Power for Dual
fn powi(&self, n: i32) -> Self
[src]
fn powf(&self, f: f64) -> Self
[src]
fn pow(&self, f: Self) -> Self
[src]
fn sqrt(&self) -> Self
[src]
impl Printable for Dual
[src]
impl Real for Dual
[src]
fn to_f64(&self) -> f64
[src]
fn from_f64(f: f64) -> Self
[src]
fn to_dual(&self) -> Dual
[src]
fn from_dual(d: Dual) -> Self
[src]
fn to_hyper_dual(&self) -> HyperDual
[src]
fn from_hyper_dual(h: HyperDual) -> Self
[src]
impl Rem<Dual> for Dual
[src]
type Output = Dual
The resulting type after applying the %
operator.
fn rem(self, _rhs: Dual) -> Dual
[src]
impl<'a, 'b> Sub<&'b Dual> for &'a Dual
[src]
type Output = Dual
The resulting type after applying the -
operator.
fn sub(self, rhs: &Dual) -> Self::Output
[src]
impl Sub<Dual> for Dual
[src]
Sub for Dual
type Output = Dual
The resulting type after applying the -
operator.
fn sub(self, other: Dual) -> Dual
[src]
impl Sub<Dual> for f64
[src]
type Output = Dual
The resulting type after applying the -
operator.
fn sub(self, other: Dual) -> Dual
[src]
impl Sub<Dual> for Number
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Dual) -> Self::Output
[src]
impl Sub<f64> for Dual
[src]
type Output = Dual
The resulting type after applying the -
operator.
fn sub(self, other: f64) -> Dual
[src]
impl<'a> Sub<f64> for &'a Dual
[src]
type Output = Dual
The resulting type after applying the -
operator.
fn sub(self, rhs: f64) -> Self::Output
[src]
impl TrigOps for Dual
[src]
Trigonometric function with Dual
fn sin(&self) -> Self
[src]
fn cos(&self) -> Self
[src]
fn tan(&self) -> Self
[src]
fn asin(&self) -> Self
[src]
fn acos(&self) -> Self
[src]
fn atan(&self) -> Self
[src]
fn sinh(&self) -> Self
[src]
fn cosh(&self) -> Self
[src]
fn tanh(&self) -> Self
[src]
fn asinh(&self) -> Self
[src]
fn acosh(&self) -> Self
[src]
fn atanh(&self) -> Self
[src]
fn sin_cos(&self) -> (Self, Self)
[src]
fn sinh_cosh(&self) -> (Self, Self)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Dual
impl Send for Dual
impl Sync for Dual
impl Unpin for Dual
impl UnwindSafe for Dual
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,
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, 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]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
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.
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>,