Trait Function

Source
pub trait Function: Send + Sync {
    // Required methods
    fn n(&self) -> usize;
    fn m(&self) -> usize;
    fn eval(&self, x: DVector<ADouble>) -> DVector<ADouble>;

    // Provided methods
    fn eval_float(&self, x: DVector<f64>) -> DVector<f64> { ... }
    fn chain(&self) -> Option<&FunctionChain> { ... }
    fn tape(&self, x: &DVector<f64>) -> Box<dyn Tape> { ... }
}
Expand description

Abstraction of a function that can be examined by AD

Required Methods§

Source

fn n(&self) -> usize

Dimension of argument vector

Source

fn m(&self) -> usize

Dimension of result vector

Source

fn eval(&self, x: DVector<ADouble>) -> DVector<ADouble>

Evaluate the function

Provided Methods§

Source

fn eval_float(&self, x: DVector<f64>) -> DVector<f64>

Evaluate the function with floating point values

Source

fn chain(&self) -> Option<&FunctionChain>

Inner chain structure if it exists

Source

fn tape(&self, x: &DVector<f64>) -> Box<dyn Tape>

Create a tape of the function

Implementors§