Skip to main content

ObjectiveFunction

Trait ObjectiveFunction 

Source
pub trait ObjectiveFunction {
    // Required method
    fn evaluate(&self, parameters: &ArrayView1<'_, f64>) -> Result<f64>;

    // Provided method
    fn gradient(&self, parameters: &ArrayView1<'_, f64>) -> Result<Array1<f64>> { ... }
}
Expand description

Objective function for optimization

Required Methods§

Source

fn evaluate(&self, parameters: &ArrayView1<'_, f64>) -> Result<f64>

Evaluates the objective function at the given parameters

Provided Methods§

Source

fn gradient(&self, parameters: &ArrayView1<'_, f64>) -> Result<Array1<f64>>

Computes the gradient of the objective function

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§