Struct direct::State
[−]
[src]
pub struct State<F> { /* fields omitted */ }
This structure represents the current state of an optimization problem.
Methods
impl<F: Fn(&[f64]) -> f64> State<F>
[src]
fn new(
lower_bounds: Vec<f64>,
upper_bounds: Vec<f64>,
f: F,
epsilon: f64
) -> Self
lower_bounds: Vec<f64>,
upper_bounds: Vec<f64>,
f: F,
epsilon: f64
) -> Self
Create a new optimization state. The function f
will be minimized.
Each entry in the lower_bounds
vector has to be smaller than the corresponding entry in
the upper_bounds
vector. epsilon
has to be > 0.
The optimizer will panic if the function ever returns NaN.
As part of the initialization, f
will be evaluated once.
fn iteration_count(&self) -> usize
The number of iterations that were done. Initialization counts as one iteration.
fn evaluation_count(&self) -> usize
The number of times the function to be optimized has been evaluated.
fn f_min(&self) -> NotNaN<f64>
The current best, i.e. smallest, value that was found.
fn arg_min(&self) -> Vec<f64>
The argument that produced f_min(), i.e. the location where the currently best value was found.
fn iterate_once(&mut self)
Run one iteration of the optimization.