public class CGMinimizer extends java.lang.Object implements Minimizer<DiffFunction>
The basic way to use the minimizer is with a null constructor, then the simple minimize method:
Minimizer cgm = new CGMinimizer();
DiffFunction df = new SomeDiffFunction();
double tol = 1e-4;
double[] initial = getInitialGuess();
double[] minimum = cgm.minimize(df,tol,initial);
Constructor and Description |
---|
CGMinimizer()
Basic constructor, use this.
|
CGMinimizer(boolean silent)
Pass in
false to get per-iteration progress reports
(to stderr). |
CGMinimizer(Function monitor)
Perform minimization with monitoring.
|
Modifier and Type | Method and Description |
---|---|
double[] |
minimize(DiffFunction function,
double functionTolerance,
double[] initial)
Attempts to find an unconstrained minimum of the objective
function starting at initial , accurate to
within functionTolerance (normally implemented as
a multiplier of the range value to give range tolerance). |
double[] |
minimize(DiffFunction dFunction,
double functionTolerance,
double[] initial,
int maxIterations)
Attempts to find an unconstrained minimum of the objective
function starting at initial , accurate to
within functionTolerance (normally implemented as
a multiplier of the range value to give range tolerance), but
running only for at most maxIterations iterations. |
void |
setIterationCallbackFunction(CallbackFunction func) |
public CGMinimizer()
public CGMinimizer(boolean silent)
false
to get per-iteration progress reports
(to stderr).silent
- a boolean
valuepublic CGMinimizer(Function monitor)
x
being that iteration's ending point. A return < tol
forces convergence (terminates the CG procedure).
Specially for Kristina.monitor
- a Function
valuepublic double[] minimize(DiffFunction function, double functionTolerance, double[] initial)
Minimizer
function
starting at initial
, accurate to
within functionTolerance
(normally implemented as
a multiplier of the range value to give range tolerance).minimize
in interface Minimizer<DiffFunction>
function
- The objective functionfunctionTolerance
- A double
valueinitial
- An initial feasible pointpublic double[] minimize(DiffFunction dFunction, double functionTolerance, double[] initial, int maxIterations)
Minimizer
function
starting at initial
, accurate to
within functionTolerance
(normally implemented as
a multiplier of the range value to give range tolerance), but
running only for at most maxIterations
iterations.minimize
in interface Minimizer<DiffFunction>
dFunction
- The objective functionfunctionTolerance
- A double
valueinitial
- An initial feasible pointmaxIterations
- Maximum number of iterationspublic void setIterationCallbackFunction(CallbackFunction func)