org.apache.commons.math3.optim.nonlinear.scalar.gradient

## Class NonLinearConjugateGradientOptimizer.LineSearchFunction

- java.lang.Object
- - org.apache.commons.math3.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizer.LineSearchFunction

All Implemented Interfaces:
  UnivariateFunction

Enclosing class:
  NonLinearConjugateGradientOptimizer

    private class NonLinearConjugateGradientOptimizer.LineSearchFunction
    extends java.lang.Object
    implements UnivariateFunction

Internal class for line search.

The function represented by this class is the dot product of the objective function gradient and the search direction. Its value is zero when the gradient is orthogonal to the search direction, i.e. when the objective function value is a local extremum along the search direction.

### Field Summary

Fields
`private double[]` `currentPoint` Current point.
`private double[]` `searchDirection` Search direction.

### Constructor Summary

Constructors
Constructor and Description
`NonLinearConjugateGradientOptimizer.LineSearchFunction(double[] point, double[] direction)`

### Method Summary

Methods
`double` `value(double x)` Compute the value of the function.

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

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

### Field Detail

#### currentPoint

    private final double[] currentPoint

Current point.

#### searchDirection

    private final double[] searchDirection

Search direction.

### Constructor Detail

#### NonLinearConjugateGradientOptimizer.LineSearchFunction

    public NonLinearConjugateGradientOptimizer.LineSearchFunction(double[] point,
                                                          double[] direction)

Parameters:
  `point` - Current point.
  `direction` - Search direction.

### Method Detail

#### value

    public double value(double x)

Compute the value of the function.

Specified by:
  `value` in interface `UnivariateFunction`
Parameters:
  `x` - Point at which the function value should be computed.
Returns:
  the value of the function.