[−][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.
Methods
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::*; 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
Trait Implementations
impl Printable for Dual
[src]
impl PowOps for Dual
[src]
Power for Dual
type Output = Dual
fn pow(&self, n: usize) -> Dual
[src]
fn powf(&self, f: f64) -> Dual
[src]
fn sqrt(&self) -> Dual
[src]
impl TrigOps for Dual
[src]
Trigonometric function with Dual
impl ExpLogOps for Dual
[src]
Exponential & Logarithm for Dual
impl Copy for Dual
[src]
impl Default for Dual
[src]
impl Clone for Dual
[src]
fn clone(&self) -> Dual
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Display for Dual
[src]
impl Debug for Dual
[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<f64> for Dual
[src]
type Output = Dual
The resulting type after applying the -
operator.
fn sub(self, other: f64) -> 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 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<f64> for Dual
[src]
type Output = Dual
The resulting type after applying the +
operator.
fn add(self, other: f64) -> 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 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<f64> for Dual
[src]
type Output = Dual
The resulting type after applying the *
operator.
fn mul(self, other: f64) -> 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 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<f64> for Dual
[src]
type Output = Dual
The resulting type after applying the /
operator.
fn div(self, other: f64) -> 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 Neg for Dual
[src]
Neg for Dual
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,