pub struct Problem<'a, E> where
    E: FnMut(&[f64], &mut [f64]) -> Result<f64>, 
{ pub x: &'a mut [f64], pub fx: f64, pub gx: Vec<f64>, /* private fields */ }
Expand description

Represents an optimization problem.

Problem holds input variables x, gradient gx arrays, and function value fx.

Fields

x: &'a mut [f64]

x is an array of length n. on input it must contain the base point for the line search.

fx: f64

fx is a variable. It must contain the value of problem f at x.

gx: Vec<f64>

gx is an array of length n. It must contain the gradient of f at x.

Implementations

Initialize problem with array length n

Compute the initial gradient in the search direction.

Update search direction using evaluated gradient.

Return a reference to current search direction vector

Return a mutable reference to current search direction vector

Compute the gradient in the search direction without sign checking.

Return total number of evaluations.

Test if Problem has been evaluated or not

Copies all elements from src into self.

Take a line step along search direction.

Compute the current value of x: x <- x + (*step) * d.

Return gradient vector norm: ||gx||

Return position vector norm: ||x||

Revert to previous step

Store the current position and gradient vectors.

Constrain the search direction for orthant-wise updates.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.