ObjectiveFunction

Trait ObjectiveFunction 

Source
pub trait ObjectiveFunction: Send + Sync {
    // Required methods
    fn evaluate(&self, parameters: &[f64]) -> f64;
    fn bounds(&self) -> Vec<(f64, f64)>;
    fn name(&self) -> &str;

    // Provided methods
    fn gradient(&self, parameters: &[f64]) -> Option<Vec<f64>> { ... }
    fn hessian(&self, parameters: &[f64]) -> Option<Vec<Vec<f64>>> { ... }
}
Expand description

Optimization objective function

Required Methods§

Source

fn evaluate(&self, parameters: &[f64]) -> f64

Evaluate the objective at given parameters

Source

fn bounds(&self) -> Vec<(f64, f64)>

Get parameter bounds

Source

fn name(&self) -> &str

Get objective name

Provided Methods§

Source

fn gradient(&self, parameters: &[f64]) -> Option<Vec<f64>>

Compute gradient if available

Source

fn hessian(&self, parameters: &[f64]) -> Option<Vec<Vec<f64>>>

Compute Hessian if available

Implementors§