|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.jhu.bme.smile.commons.optimize.BrentMethod1D
public class BrentMethod1D
Optimizes functions by using Brent's method. It will interpolate a parabola from 3 points when the function is behaving nicely. The minimum of the parabola replaces the worst point, and a new parabola is created. This continues until the 3 points converge. It will then switch to the more robust method of golden section search when things are not nice. Adapted from Numerical Recipes.
Constructor Summary | |
---|---|
BrentMethod1D()
Default constructor. |
|
BrentMethod1D(int maxIter)
Constructor to set maximum number of iterations to run |
Method Summary | |
---|---|
double |
getExtrema()
Gets the extrema that was found |
int |
getIterations()
Gets the number of iterations done. |
java.util.ArrayList<double[]> |
getLog()
Gets the logged data |
void |
initialize(Optimizable1DContinuous function)
Initialize the optimizer with the 1D function. |
void |
logData(boolean turnOn,
int maxSteps)
Turns on logging for each iteration of the optimization. |
boolean |
optimize(boolean findMinima)
Optimizes the function |
java.lang.String |
statusMessage()
Gets the status message from the optimizing process |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BrentMethod1D()
public BrentMethod1D(int maxIter)
maxIter
- maximum number of iterationsMethod Detail |
---|
public void logData(boolean turnOn, int maxSteps)
turnOn
- true if logging, false if notmaxSteps
- maximum number of steps to logpublic java.util.ArrayList<double[]> getLog()
public double getExtrema()
getExtrema
in interface Optimizer1DContinuous
public int getIterations()
getIterations
in interface Optimizer1DContinuous
public void initialize(Optimizable1DContinuous function)
initialize
in interface Optimizer1DContinuous
function
- your Optimizable1DContinuous functionpublic boolean optimize(boolean findMinima)
optimize
in interface Optimizer1DContinuous
findMinima
- true if you want to find the minimum, false if you want to find the maximum
public java.lang.String statusMessage()
statusMessage
in interface Optimizer1DContinuous
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |