pal.math
Class MultivariateMinimum
java.lang.Object
|
+--pal.math.MultivariateMinimum
- Direct Known Subclasses:
- ConjugateDirectionSearch, ConjugateGradientSearch, DifferentialEvolution, GeneralizedDEOptimizer, OrthogonalSearch, StochasticOSearch
- public abstract class MultivariateMinimum
- extends java.lang.Object
abstract base class for minimisation of a multivariate function
Field Summary |
int |
maxFun
maxFun is the maximum number of calls to fun allowed.
the default value of 0 indicates no limit on the number
of calls. |
int |
numFun
total number of function evaluations necessary |
int |
numFuncStops
numFuncStops is the number of consecutive positive
evaluations of the stop criterion based on function evaluation
necessary to cause the abortion of the optimization
(default is 4) |
Method Summary |
void |
copy(double[] target,
double[] source)
Copy source vector into target vector |
double |
findMinimum(MultivariateFunction f,
double[] xvec)
Find minimum close to vector x |
double |
findMinimum(MultivariateFunction f,
double[] xvec,
int fxFracDigits,
int xFracDigits)
Find minimum close to vector x
(desired fractional digits for each parameter is specified) |
abstract void |
optimize(MultivariateFunction f,
double[] xvec,
double tolfx,
double tolx)
The actual optimization routine
(needs to be implemented in a subclass of MultivariateMinimum).
|
boolean |
stopCondition(double fx,
double[] x,
double tolfx,
double tolx,
boolean firstCall)
Checks whether optimization should stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
numFun
public int numFun
- total number of function evaluations necessary
maxFun
public int maxFun
- maxFun is the maximum number of calls to fun allowed.
the default value of 0 indicates no limit on the number
of calls.
numFuncStops
public int numFuncStops
- numFuncStops is the number of consecutive positive
evaluations of the stop criterion based on function evaluation
necessary to cause the abortion of the optimization
(default is 4)
MultivariateMinimum
public MultivariateMinimum()
findMinimum
public double findMinimum(MultivariateFunction f,
double[] xvec)
- Find minimum close to vector x
- Parameters:
f
- multivariate functionxvec
- initial guesses for the minimum
(contains the location of the minimum on return)- Returns:
- minimal function value
findMinimum
public double findMinimum(MultivariateFunction f,
double[] xvec,
int fxFracDigits,
int xFracDigits)
- Find minimum close to vector x
(desired fractional digits for each parameter is specified)
- Parameters:
f
- multivariate functionxvec
- initial guesses for the minimum
(contains the location of the minimum on return)fxFracDigits
- desired fractional digits in the function valuexFracDigits
- desired fractional digits in parameters x- Returns:
- minimal function value
optimize
public abstract void optimize(MultivariateFunction f,
double[] xvec,
double tolfx,
double tolx)
- The actual optimization routine
(needs to be implemented in a subclass of MultivariateMinimum).
It finds a minimum close to vector x when the
absolute tolerance for each parameter is specified.
- Parameters:
f
- multivariate functionxvec
- initial guesses for the minimum
(contains the location of the minimum on return)tolfx
- absolute tolerance of function valuetolx
- absolute tolerance of each parameter
stopCondition
public boolean stopCondition(double fx,
double[] x,
double tolfx,
double tolx,
boolean firstCall)
- Checks whether optimization should stop
- Parameters:
fx
- current function valuex
- current values of function parameterstolfx
- absolute tolerance of function valuetolx
- absolute tolerance of each parameterfirstCall
- needs to be set to true when this routine is first called
otherwise it should be set to false- Returns:
- true if either x and its previous value are sufficiently similar
or if fx and its previous values are sufficiently similar
(test on function value has to be succesful numFuncStops consecutive
times)
copy
public void copy(double[] target,
double[] source)
- Copy source vector into target vector
- Parameters:
target
- parameter arraysource
- parameter array