XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ 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]nThe 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]fThe 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]tolRelative error tolerance for x[]. (tol >= 0)
(If tol < 0, tol = 0 is assumed)
[in]maxevalMaximum 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]fxFunction value at the obtained solution vector x[].
[out]nevalNumber of function evaluations of f.
[in]nsminLower 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]nsmaxUpper 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]icontsubplex 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]nfstopSwitch 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]fstopSee nfstop.
[in]minfSpecify minimization or maximization.
= 0: subplex performs minimization.
!= 0: subplex performs maximization.
[in]alphaNelder-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]betaNelder-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]gammaNelder-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]deltaNelder-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]psisubplex 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]omegasubplex 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]ireplMeasurement 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]ifxswMeasurement 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]bonusMeasurement 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]lworkThe length of work[]. (lwork >= 2*n + nsmax*(nsmax+4) + 1)
[out]iwork[]Array iwork[liwork]
Work area.
[in]liworkThe 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