Click or drag to resize

LineSearchT Class

A class for performing a (soft) line-search for a function with multidimensional input
argmin_{a > 0} { f(x+a*dx) }

It tries to find an alpha such that

x1 = x0 +   alpha*dx
x2 = x0 + 2*alpha*dx
and f(x1) is smaller than f(x0) and f(x2).

A second order polynomial through (0,f(x0)), (1,f(x1)) and (2,f(x2)) is created, and the alpha value corresponding to the minimum function value is returned.

Inheritance Hierarchy
SystemObject
  DHIMath.NumericsLineSearchT

Namespace:  DHIMath.Numerics
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 16.0.0.0 (11.1.1.1111)
Syntax
C#
public class LineSearch<T>
where T : new(), IFunctionValue

Type Parameters

T

The LineSearchT type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyMinimum
Hold the minimum function value for the last search.
Public propertyNumFunctionEval
Hold the number of function evaluations for the last search.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodReset
Reset line search procedure
Public methodSearch(Double, Double, Double)
Search in direction dx, from starting point x0.
Public methodSearch(Double, Double, Double, Double, T, T)
Search in direction dx, from starting point x0 towards point x1.

This method can utilize if some function values have already been computed.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldMaxLineSearchIter
Maximum number of line search iterations. Default 10.
Public fieldStepLimited
Limits the dx search step. Set to false to also allow -dx and a very large multipla of dx.

When true, the largest search step length accepted is

2 * 2^MaxLineSearchIter * initial search step length

Top
See Also