qchen-fdii-cardc/nlopt4m/line_search does not have a README file

    ArmijoStep

    pub(all) struct ArmijoStep {
    alpha : Double
    value : Double
    evaluations : Int
    } derive(
    Debug
    )

    A trial accepted by Armijo sufficient-decrease backtracking.

    WolfeStep

    pub(all) struct WolfeStep {
    alpha : Double
    value : Double
    gradient : Array[Double]
    evaluations : Int
    } derive(
    Debug
    )

    A strong-Wolfe trial, including its already evaluated gradient.

    armijo

    fn armijo(value : Double, gradient : ArrayView[Double], direction : ArrayView[Double], objective : (Double) -> Double raise, initial_step? : Double, contraction? : Double, sufficient_decrease? : Double, max_evaluations? : Int) -> ArmijoStep raise

    Backtrack along a descent direction using a value-only trial callback. The caller supplies the origin value and gradient; they are not included in the returned evaluation count. Callback errors propagate.

    test {
    let step = @line_search.armijo(4.0, [-4.0], [1.0], a => (a - 2.0) * (a - 2.0))
    assert_true(step.value < 4.0)
    }

    strong_wolfe

    fn strong_wolfe(value : Double, gradient : ArrayView[Double], direction : ArrayView[Double], objective : (Double) -> (Double, Array[Double]) raise, sufficient_decrease? : Double, curvature? : Double, initial_step? : Double, maximum_step? : Double, max_evaluations? : Int) -> WolfeStep raise

    Find a positive step satisfying sufficient decrease and strong curvature. The callback receives the step length and returns the value and gradient at that trial. Its evaluations are counted separately from the supplied origin. Callback errors and exhausted or unrepresentable brackets are reported; an unchecked trial is never returned.

    test {
    let step = @line_search.strong_wolfe(4.0, [-4.0], [1.0], a => {
    ((a - 2.0) * (a - 2.0), [2.0 * (a - 2.0)])
    })
    assert_true(step.value < 4.0)
    }