DualNumber

pub trait DualNumber: Clone + Copy {
    // Required methods
    fn value(self) -> f64;
    fn derivative(self) -> f64;
    fn new(value: f64, derivative: f64) -> Self;
    fn constant(value: f64) -> Self;
    fn variable(value: f64) -> Self;
}
Expand description

Trait for dual number operations

Required Methods§

Source

fn value(self) -> f64

Get the value part

Source

fn derivative(self) -> f64

Get the derivative part

Source

fn new(value: f64, derivative: f64) -> Self

Create from value and derivative

Source

fn constant(value: f64) -> Self

Create constant (derivative = 0)

Source

fn variable(value: f64) -> Self

Create variable (derivative = 1)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§