|
|
◆ subplex()
| void subplex |
( |
int |
n, |
|
|
double |
x[], |
|
|
void(*)(int, double *, double *) |
f, |
|
|
double |
tol, |
|
|
int |
maxeval, |
|
|
double |
scale[], |
|
|
double * |
fx, |
|
|
int * |
neval, |
|
|
int |
nsmin, |
|
|
int |
nsmax, |
|
|
int |
icont, |
|
|
int |
nfstop, |
|
|
double |
fstop, |
|
|
int |
minf, |
|
|
double |
alpha, |
|
|
double |
beta, |
|
|
double |
gamma, |
|
|
double |
delta, |
|
|
double |
psi, |
|
|
double |
omega, |
|
|
int |
irepl, |
|
|
int |
ifxsw, |
|
|
double |
bonus, |
|
|
double |
work[], |
|
|
int |
lwork, |
|
|
int |
iwork[], |
|
|
int |
liwork, |
|
|
int * |
info |
|
) |
| |
Minimum of a multivariable nonlinear function (subspace-searching simplex method)
- Purpose
- subplex finds the local minimum point (xs1, xs2, ..., xsn) of general nonlinear function f(x1, x2, ..., xn) (a general real-valued function)
Nelder-Mead simplex method is used. Since it is a direct searching method, it does not require the derivative computation and not assume the smoothness of the objective functions. However, it is reported this method is, in general, slower than the quasi-Newton method and trust region method.
The simplex method may be inefficient when the number of variables is much larger. This routine applies the simplex method to low dimension sub-spaces of the problem in order to make up for this weakness of the simplex method. When the range of subspace dimensions is specified to the entire space of the problem, this routine works as the original simplex method routine with periodic restarts.
- Parameters
-
| [in] | n | The order or dimension of the problem. (n >= 1) |
| [in,out] | x[] | Array x[lx] (lx >= n)
[in] Initial approximation of the solution vector.
[out] Obtained solution vector. |
| [in] | f | The user supplied subroutine which calculates the function f(x1, x2, ..., xn) defined as follows. void f(int n, double x[], double *fval)
{
*fval = calculated function value from given n and x[]
}
The other variables than fval should not be altered. |
| [in] | tol | Relative error tolerance for x[]. (tol >= 0)
(If tol < 0, tol = 0 is assumed) |
| [in] | maxeval | Maximum number of function evaluations of f. (maxeval > 0)
(If maxeval <= 0, the default value (1000) will be used) |
| [in] | scale[] | Array scale[lscale] (lscale >= 1 (scale[0] < 0)、lscale >= n (scale[0] > 0))
Scale and initial stepsizes for corresponding components of x[] (scale[i] != 0).
If scale[0] < 0, abs(scale[0]) is used for all components and scale[1], ..., scale[n-1] are not referenced. |
| [out] | fx | Function value at the obtained solution vector x[]. |
| [out] | neval | Number of function evaluations of f. |
| [in] | nsmin | Lower limits of the range of subspace dimensions. (1 <= nsmin <= nsmax <= n)
If nsmin = nsmax = n, equivalent to Nelder-Mead simplex method with periodic restarts.
(If nsmin < 1 or nsmin > n, nsmin is assumed to be the default value (min(2,n))) |
| [in] | nsmax | Upper limits of the range of subspace dimensions. (1 <= nsmin <= nsmax <= n)
(If nsmax < 1 or nsmax > n, nsmax is assumed to be the default value (min(5,n))) |
| [in] | icont | subplex can restart the previous call after setting tol and/or maxevazl to new values. icont specifies whether new call or restart.
= 0: New call to subplex.
!= 0: Restart of previous call. (Do not alter the variables other than tol and maxeval) |
| [in] | nfstop | Switch to test f(x) value during iteration.
= 0: f(x) is not tested against fstop.
= 1: If f(x) has reached fstop, subplex returns with info = 3.
>= 2: If f(x) has reached fstop and the number of function evaluations at the current best pointn exceeds nfstop, subplex returns with info = 3 (only valid when irepl > 0). |
| [in] | fstop | See nfstop. |
| [in] | minf | Specify minimization or maximization.
= 0: subplex performs minimization.
!= 0: subplex performs maximization. |
| [in] | alpha | Nelder-Mead simplex method parameter. (alpha > 0)
alpha is the reflex coefficient.
(If the parameter value is out of above range, the default value (1) will be used) |
| [in] | beta | Nelder-Mead simplex method parameter. (0 < beta < 1)
beta is the contraction coefficient.
(If the parameter value is out of above range, the default value (0.5) will be used) |
| [in] | gamma | Nelder-Mead simplex method parameter. (gamma > 1)
gamma is the expansion coefficient.
(If the parameter value is out of above range, the default value (2) will be used) |
| [in] | delta | Nelder-Mead simplex method parameters. (0 < delta < 1)
delta is the shrinkage coefficient.
(If the parameter value is out of above range, the default value (0.5) will be used) |
| [in] | psi | subplex startegy parameter. (0 < psi < 1)
psi is the simplex reduction coefficient.
(If the parameter value is out of above range, the default value (0.25) will be used) |
| [in] | omega | subplex startegy parameter. (0 < omega < 1)
omega isthe step reduction coefficient.
(If the parameter value is out of above range, the default value (0.1) will be used) |
| [in] | irepl | Measurement replication switch.
If the objective functions are subject to large amounts of noise, subplex can evaluate f(x) several times at each point and return the average, max or min of these trials as the function value.
= 0: No measurement replication.
= 1: subplex performs measurement replication.
= 2: User performs measurement replication.
(For other values, the default value (0) will be used) |
| [in] | ifxsw | Measurement replication optimization switch.
= 1: Retain mean of trials as best function value.
= 2: Retain max.
= 3: Retain min.
(For other values, the default value (1) will be used) |
| [in] | bonus | Measurement replication bonus coefficient. (bonus >= 0, normally 0 or 1)
A bonus can be added to the function value of the best point so that the best point is not replaced by a new point that only appears better because of noise.
= 0: bonus not used.
= 1: bonus used.
(If the value is out of above range, the default value (1) will be used) |
| [out] | work[] | Array work[lwork]
Work area. |
| [in] | lwork | The length of work[]. (lwork >= 2*n + nsmax*(nsmax+4) + 1) |
| [out] | iwork[] | Array iwork[liwork]
Work area. |
| [in] | liwork | The length of iwork[]. (liwork >= n + n/nsmin) |
| [out] | info | = 0: Successful exit
= -1: The argument n had an illegal value (n < 1)
= -6: The argument scale[] had an illegal value (scale[i] = 0)
= -10: The argument nsmin or nsmax had an illegal value (nsmin > nsmax)
= -10: The argument nsmin or nsmax had an illegal value (n < ((n - 1)/nsmax + 1)*nsmin)
= -25: The argument lwork had an illegal value (lwork < 2*n + nsmax*(nsmax+4) + 1)
= -27: The argument liwork had an illegal value (liwork < n + n/nsmin)
= 1: Maximum number of function evaluations of f (maxeval) exceeded
= 2: Limit of machine precision
= 3: fstop reached (see nfstop) |
- Reference
- netlib/opt
|