[][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 PowOps for Dual[src]

Power for Dual

impl TrigOps for Dual[src]

Trigonometric function with Dual

impl ExpLogOps for Dual[src]

Exponential & Logarithm for Dual

impl Real for Dual[src]

impl Printable 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 Default for Dual[src]

impl PartialEq<Dual> for Dual[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Copy for Dual[src]

impl Display for Dual[src]

impl Debug for Dual[src]

impl Div<Dual> for Dual[src]

Div for Dual

type Output = Dual

The resulting type after applying the / operator.

impl<'a, 'b> Div<&'b Dual> for &'a Dual[src]

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<'a> Div<f64> for &'a Dual[src]

type Output = Dual

The resulting type after applying the / operator.

impl Div<Dual> for Number[src]

type Output = Self

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<'a, 'b> Add<&'b Dual> for &'a Dual[src]

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<'a> Add<f64> for &'a Dual[src]

type Output = Dual

The resulting type after applying the + operator.

impl Add<Dual> for Number[src]

type Output = Self

The resulting type after applying the + operator.

impl Sub<Dual> for Dual[src]

Sub for Dual

type Output = Dual

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'b Dual> for &'a Dual[src]

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<'a> Sub<f64> for &'a Dual[src]

type Output = Dual

The resulting type after applying the - operator.

impl Sub<Dual> for Number[src]

type Output = Self

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<'a, 'b> Mul<&'b Dual> for &'a Dual[src]

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<'a> Mul<f64> for &'a Dual[src]

type Output = Dual

The resulting type after applying the * operator.

impl Mul<Dual> for Number[src]

type Output = Self

The resulting type after applying the * operator.

impl Rem<Dual> for Dual[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.

impl<'a> Neg for &'a Dual[src]

type Output = Dual

The resulting type after applying the - operator.

Auto Trait Implementations

impl Sync for Dual

impl Send for Dual

impl Unpin for Dual

impl RefUnwindSafe for Dual

impl UnwindSafe for Dual

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<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]

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

impl<T, U> IntoPy<U> for T where
    U: FromPy<T>, 
[src]