[][src]Struct liblbfgs::line::LineSearch

pub struct LineSearch {
    pub algorithm: LineSearchAlgorithm,
    pub ftol: f64,
    pub gtol: f64,
    pub xtol: f64,
    pub min_step: f64,
    pub max_step: f64,
    pub max_linesearch: usize,
    pub gradient_only: bool,
}

Fields

algorithm: LineSearchAlgorithm

Various line search algorithms.

ftol: f64

A parameter to control the accuracy of the line search routine.

The default value is 1e-4. This parameter should be greater than zero and smaller than 0.5.

gtol: f64

A parameter to control the accuracy of the line search routine.

The default value is 0.9. If the function and gradient evaluations are inexpensive with respect to the cost of the iteration (which is sometimes the case when solving very large problems) it may be advantageous to set this parameter to a small value. A typical small value is 0.1. This parameter shuold be greater than the ftol parameter (1e-4) and smaller than 1.0.

xtol: f64

xtol is a nonnegative input variable. termination occurs when the relative width of the interval of uncertainty is at most xtol.

The machine precision for floating-point values.

This parameter must be a positive value set by a client program to estimate the machine precision. The line search routine will terminate with the status code (::LBFGSERR_ROUNDING_ERROR) if the relative width of the interval of uncertainty is less than this parameter.

min_step: f64

The minimum step of the line search routine.

The default value is \c 1e-20. This value need not be modified unless the exponents are too large for the machine being used, or unless the problem is extremely badly scaled (in which case the exponents should be increased).

max_step: f64

The maximum step of the line search.

The default value is \c 1e+20. This value need not be modified unless the exponents are too large for the machine being used, or unless the problem is extremely badly scaled (in which case the exponents should be increased).

max_linesearch: usize

The maximum number of trials for the line search.

This parameter controls the number of function and gradients evaluations per iteration for the line search routine. The default value is 40. Set this value to 0, will completely disable line search.

gradient_only: bool

Make line search conditions use only gradients.

Implementations

impl LineSearch[src]

pub fn find<E>(&self, prb: &mut Problem<'_, E>, step: &mut f64) -> Result<usize> where
    E: FnMut(&[f64], &mut [f64]) -> Result<f64>, 
[src]

Unified entry for line searches

Arguments

  • step: initial step size. On output it will be the optimal step size.
  • direction: proposed searching direction
  • eval_fn: a callback function to evaluate Problem

Return

  • On success, return the number of line searching iterations

Trait Implementations

impl Clone for LineSearch[src]

impl Copy for LineSearch[src]

impl Debug for LineSearch[src]

impl Default for LineSearch[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.