CachedADProblem

Trait CachedADProblem 

Source
pub trait CachedADProblem<const X: usize>: BasicADProblem<X> {
    type Error;

    // Required method
    fn evaluate<D: DualNum<f64> + Copy>(
        &self,
        x: [D; X],
    ) -> Result<(D, Vec<D>), Self::Error>;
}
Expand description

The interface for an NLP in which it is more efficient to evaluate the objective and constraint value in the same function.

Internally, the results are cached for repeated calls with the same x so that the number of function evaluations is kept to a minimum.

Required Associated Types§

Source

type Error

The error type used in the evaluation.

Required Methods§

Source

fn evaluate<D: DualNum<f64> + Copy>( &self, x: [D; X], ) -> Result<(D, Vec<D>), Self::Error>

Return the objective value and values for all constraints simultaneously.

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§