Struct State

Source
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>

Source

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.

Source

pub fn iteration_count(&self) -> usize

The number of iterations that were done. Initialization counts as one iteration.

Source

pub fn evaluation_count(&self) -> usize

The number of times the function to be optimized has been evaluated.

Source

pub fn f_min(&self) -> NotNaN<f64>

The current best, i.e. smallest, value that was found.

Source

pub fn arg_min(&self) -> Vec<f64>

The argument that produced f_min(), i.e. the location where the currently best value was found.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.