Computes the status of an optimization.
[statusF, statusX] = uncprb_computestatus ( nprob, xopt, fopt, tolF, tolX )
a 1-by-1 matrix of doubles, integer value, the problem number
a n-by-1 matrix of doubles, the computed optimum X
a 1-by-1 matrix of doubles, the computed optimum F(X)
a 1-by-1 matrix of doubles, positive, a relative tolerance on F
a 1-by-1 matrix of doubles, positive, an absolute tolerance on F
a 1-by-1 matrix of doubles, positive, a relative tolerance on X
a 1-by-1 matrix of doubles, positive, an absolute tolerance on X
a 1-by-1 matrix of booleans. statusF is %t if the convergence condition on F is achieved
a 1-by-1 matrix of booleans. statusX is %t if the convergence condition on X is achieved
Returns the status of the optimization with respect to the function value or the point X.
The xstar input argument may be equal to the empty matrix [], if the expected optimum X is unknown for this case. This depends on the output of the uncprb_getopt function. In this case, statusX is "OK".
The status on F is "OK" if the following condition is satisfied:
The status on X is "OK" if xstar==[] or if the following condition is satisfied:
// Make optim optimize the problem #4 nprob = 4; [n,m,x0]=uncprb_getinitf(nprob) [fopt,xopt,gopt]=optim(list(uncprb_optimfun,nprob,n,m),x0,"gc") rtolX = 1.e-4; atolX = 1.e-10; rtolF = 1.e-4; atolF = 1.e-10; [statusF, statusX] = uncprb_computestatus ( nprob, xopt, fopt, .. rtolF, atolF, rtolX, atolX ) | ![]() | ![]() |