@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<java.lang.Double,java.lang.Double>>
Modifier and Type | Field and Description |
---|---|
static double |
GOLDEN_RATIO
Golden ratio, from the Fibonacci sequence, 1.618034
|
static double |
GOLDEN_RATIO_CONJUGATE
The Golden Ratio conjugate, 0.618034
|
DEFAULT_TOLERANCE
Constructor and Description |
---|
LineBracketInterpolatorGoldenSection()
Creates a new instance of LineBracketInterpolatorGoldenSection
|
Modifier and Type | Method and Description |
---|---|
double |
findMinimum(LineBracket bracket,
double minx,
double maxx,
Evaluator<java.lang.Double,java.lang.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<java.lang.Double,java.lang.Double> a,
InputOutputPair<java.lang.Double,java.lang.Double> b,
double tolerance)
Takes a Golden Section step between the two points
|
getTolerance, setTolerance
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
public static final double GOLDEN_RATIO
public static final double GOLDEN_RATIO_CONJUGATE
public LineBracketInterpolatorGoldenSection()
public double findMinimum(LineBracket bracket, double minx, double maxx, Evaluator<java.lang.Double,java.lang.Double> function)
LineBracketInterpolator
bracket
- Bracket of pointsminx
- Minimum x-axis value to search for the minimummaxx
- Maximum x-axis value to search for the minimumfunction
- Function to consider. The function, or gradient, may be evaluated to
generate enough output/slope samples to interpolate.public static double step(InputOutputPair<java.lang.Double,java.lang.Double> a, InputOutputPair<java.lang.Double,java.lang.Double> b, double tolerance)
a
- First pointb
- Second pointtolerance
- Minimum below which to consider the points identical.public boolean hasSufficientPoints(LineBracket bracket)
bracket
- LineBracket to consider