gov.sandia.cognition.learning.algorithm.minimization.line.interpolator
Class LineBracketInterpolatorGoldenSection

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.minimization.line.interpolator.AbstractLineBracketInterpolator<Evaluator<Double,Double>>
          extended by gov.sandia.cognition.learning.algorithm.minimization.line.interpolator.LineBracketInterpolatorGoldenSection
All Implemented Interfaces:
LineBracketInterpolator<Evaluator<Double,Double>>, CloneableSerializable, Serializable, Cloneable

@PublicationReferences(references={@PublicationReference(author="Wikipedia",title="Golden section search",type=WebPage,url="http://en.wikipedia.org/wiki/Golden_section_search",year=2008),@PublicationReference(author={"Jeffrey Naisbitt","Michael Heath"},title="Golden Section Search",type=WebPage,url="http://www.cse.uiuc.edu/iem/optimization/GoldenSection/",year=2008),@PublicationReference(author={"William H. Press","Saul A. Teukolsky","William T. Vetterling","Brian P. Flannery"},title="Numerical Recipes in C, Second Edition",type=Book,year=1992,pages={401,402},url="http://www.nrbook.com/a/bookcpdf.php")})
public class LineBracketInterpolatorGoldenSection
extends AbstractLineBracketInterpolator<Evaluator<Double,Double>>

Interpolates between the two bound points of a LineBracket using the golden-section step rule, if that step fails, then the interpolator uses a linear (secant) interpolation. Neither of the bound points in the LineBracket need slope information.

Since:
2.1
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
static double GOLDEN_RATIO
          Golden ratio, from the Fibonacci sequence, 1.618034
static double GOLDEN_RATIO_CONJUGATE
          The Golden Ratio conjugate, 0.618034
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.minimization.line.interpolator.AbstractLineBracketInterpolator
DEFAULT_TOLERANCE
 
Constructor Summary
LineBracketInterpolatorGoldenSection()
          Creates a new instance of LineBracketInterpolatorGoldenSection
 
Method Summary
 double findMinimum(LineBracket bracket, double minx, double maxx, Evaluator<Double,Double> function)
          Finds the minimum of the bracket using the interpolation/extrapolation routine, where the minimum must lie between the minx and maxx values on the x-axis.
 boolean hasSufficientPoints(LineBracket bracket)
          Golden section step only needs the bounds to operate, so we'll just check to make sure they're not null.
static double step(InputOutputPair<Double,Double> a, InputOutputPair<Double,Double> b, double tolerance)
          Takes a Golden Section step between the two points
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.minimization.line.interpolator.AbstractLineBracketInterpolator
getTolerance, setTolerance
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

GOLDEN_RATIO

public static final double GOLDEN_RATIO
Golden ratio, from the Fibonacci sequence, 1.618034

See Also:
Constant Field Values

GOLDEN_RATIO_CONJUGATE

public static final double GOLDEN_RATIO_CONJUGATE
The Golden Ratio conjugate, 0.618034

See Also:
Constant Field Values
Constructor Detail

LineBracketInterpolatorGoldenSection

public LineBracketInterpolatorGoldenSection()
Creates a new instance of LineBracketInterpolatorGoldenSection

Method Detail

findMinimum

public double findMinimum(LineBracket bracket,
                          double minx,
                          double maxx,
                          Evaluator<Double,Double> function)
Description copied from interface: LineBracketInterpolator
Finds the minimum of the bracket using the interpolation/extrapolation routine, where the minimum must lie between the minx and maxx values on the x-axis.

Parameters:
bracket - Bracket of points
minx - Minimum x-axis value to search for the minimum
maxx - Maximum x-axis value to search for the minimum
function - Function to consider. The function, or gradient, may be evaluated to generate enough output/slope samples to interpolate.
Returns:
Minimum value of the function between minx and maxx.

step

public static double step(InputOutputPair<Double,Double> a,
                          InputOutputPair<Double,Double> b,
                          double tolerance)
Takes a Golden Section step between the two points

Parameters:
a - First point
b - Second point
tolerance - Minimum below which to consider the points identical.
Returns:
Interpolated Golden Section step between the two points

hasSufficientPoints

public boolean hasSufficientPoints(LineBracket bracket)
Golden section step only needs the bounds to operate, so we'll just check to make sure they're not null.

Parameters:
bracket - LineBracket to consider
Returns:
True if both bounds are not null, false otherwise