[][src]Struct peroxide::structure::dual::Dual

pub struct Dual { /* fields omitted */ }

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

impl TrigOps for Dual[src]

Trigonometric function with Dual

type Output = Dual

impl ExpLogOps for Dual[src]

Exponential & Logarithm for Dual

type Output = Dual

impl Copy for Dual[src]

impl Default for Dual[src]

impl Clone for 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.

impl Sub<f64> for Dual[src]

type Output = Dual

The resulting type after applying the - operator.

impl Sub<Dual> for f64[src]

type Output = Dual

The resulting type after applying the - operator.

impl Add<Dual> for Dual[src]

Add for Dual

type Output = Dual

The resulting type after applying the + operator.

impl Add<f64> for Dual[src]

type Output = Dual

The resulting type after applying the + operator.

impl Add<Dual> for f64[src]

type Output = Dual

The resulting type after applying the + operator.

impl Mul<Dual> for Dual[src]

Mul for Dual

type Output = Dual

The resulting type after applying the * operator.

impl Mul<f64> for Dual[src]

type Output = Dual

The resulting type after applying the * operator.

impl Mul<Dual> for f64[src]

type Output = Dual

The resulting type after applying the * operator.

impl Div<Dual> for Dual[src]

Div for Dual

type Output = Dual

The resulting type after applying the / operator.

impl Div<f64> for Dual[src]

type Output = Dual

The resulting type after applying the / operator.

impl Div<Dual> for f64[src]

type Output = Dual

The resulting type after applying the / operator.

impl Neg for Dual[src]

Neg for Dual

type Output = Dual

The resulting type after applying the - operator.

Auto Trait Implementations

impl Send for Dual

impl Sync for Dual

Blanket Implementations

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

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

type Owned = T

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.