[][src]Struct liblbfgs::Problem

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>, // some fields omitted }

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

impl<'a, E> Problem<'a, E> where
    E: FnMut(&[f64], &mut [f64]) -> Result<f64>, 
[src]

pub fn new(x: &'a mut [f64], eval: E, owlqn: Option<Orthantwise>) -> Self[src]

Initialize problem with array length n

pub fn dginit(&self) -> Result<f64>[src]

Compute the initial gradient in the search direction.

pub fn update_search_direction(&mut self)[src]

Update search direction using evaluated gradient.

pub fn search_direction(&self) -> &[f64][src]

Return a reference to current search direction vector

pub fn search_direction_mut(&mut self) -> &mut [f64][src]

Return a mutable reference to current search direction vector

pub fn dg_unchecked(&self) -> f64[src]

Compute the gradient in the search direction without sign checking.

pub fn evaluate(&mut self) -> Result<()>[src]

pub fn number_of_evaluation(&self) -> usize[src]

Return total number of evaluations.

pub fn evaluated(&self) -> bool[src]

Test if Problem has been evaluated or not

pub fn clone_from(&mut self, src: &Problem<'_, E>)[src]

Copies all elements from src into self.

pub fn take_line_step(&mut self, step: f64)[src]

Take a line step along search direction.

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

pub fn gnorm(&self) -> f64[src]

Return gradient vector norm: ||gx||

pub fn xnorm(&self) -> f64[src]

Return position vector norm: ||x||

pub fn orthantwise(&self) -> bool[src]

pub fn revert(&mut self)[src]

Revert to previous step

pub fn save_state(&mut self)[src]

Store the current position and gradient vectors.

pub fn constrain_search_direction(&mut self)[src]

Constrain the search direction for orthant-wise updates.

pub fn update_owlqn_gradient(&mut self)[src]

Auto Trait Implementations

impl<'a, E> RefUnwindSafe for Problem<'a, E> where
    E: RefUnwindSafe

impl<'a, E> Send for Problem<'a, E> where
    E: Send

impl<'a, E> Sync for Problem<'a, E> where
    E: Sync

impl<'a, E> Unpin for Problem<'a, E> where
    E: Unpin

impl<'a, E> !UnwindSafe for Problem<'a, E>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.