LineSearch (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.ml.maxent.quasinewton

## Class LineSearch

- java.lang.Object
- - opennlp.tools.ml.maxent.quasinewton.LineSearch

-     public class LineSearch
      extends Object

  Class that performs line search to find minimum

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `LineSearch.LineSearchResult` Class to store lineSearch result

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LineSearch()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `doConstrainedLineSearch(Function function, double[] direction, LineSearch.LineSearchResult lsr, double l1Cost, double initialStepSize)` Constrained line search (see section 3.2 in the paper "Scalable Training of L1-Regularized Log-Linear Models", Andrew et al.
    `static void` | `doLineSearch(Function function, double[] direction, LineSearch.LineSearchResult lsr, double initialStepSize)` Backtracking line search (see Nocedal & Wright 2006, Numerical Optimization, p.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LineSearch

          public LineSearch()

  - ### Method Detail

    - #### doLineSearch

          public static void doLineSearch(Function function,
                                          double[] direction,
                                          LineSearch.LineSearchResult lsr,
                                          double initialStepSize)

      Backtracking line search (see Nocedal & Wright 2006, Numerical Optimization, p. 37)

    - #### doConstrainedLineSearch

          public static void doConstrainedLineSearch(Function function,
                                                     double[] direction,
                                                     LineSearch.LineSearchResult lsr,
                                                     double l1Cost,
                                                     double initialStepSize)

      Constrained line search (see section 3.2 in the paper "Scalable Training of L1-Regularized Log-Linear Models", Andrew et al. 2007)

Copyright © 2026 The Apache Software Foundation. All rights reserved.