pub struct State<F> { /* private fields */ }
Expand description
This structure represents the current state of an optimization problem.
Implementations§
Source§impl<F: Fn(&[f64]) -> f64> State<F>
impl<F: Fn(&[f64]) -> f64> State<F>
Sourcepub fn new(
lower_bounds: Vec<f64>,
upper_bounds: Vec<f64>,
f: F,
epsilon: f64,
) -> Self
pub fn new( 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.
Sourcepub fn iteration_count(&self) -> usize
pub fn iteration_count(&self) -> usize
The number of iterations that were done. Initialization counts as one iteration.
Sourcepub fn evaluation_count(&self) -> usize
pub fn evaluation_count(&self) -> usize
The number of times the function to be optimized has been evaluated.
Sourcepub fn arg_min(&self) -> Vec<f64>
pub fn arg_min(&self) -> Vec<f64>
The argument that produced f_min(), i.e. the location where the currently best value was found.
Sourcepub fn iterate_once(&mut self)
pub fn iterate_once(&mut self)
Run one iteration of the optimization.
Auto Trait Implementations§
impl<F> Freeze for State<F>where
F: Freeze,
impl<F> RefUnwindSafe for State<F>where
F: RefUnwindSafe,
impl<F> Send for State<F>where
F: Send,
impl<F> Sync for State<F>where
F: Sync,
impl<F> Unpin for State<F>where
F: Unpin,
impl<F> UnwindSafe for State<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more