LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
kpcfit_manual_outfun.m
1 function stop = kpcfit_manual_outfun(x,optimValues,state)
2 stop = false;
3 if ~isnan(optimValues.fval) & ~isnan(x)
4 lgkx = x;
5 else
6 stop = true;
7 % fprintf('optimization stop: numerical difficulties detected\n')
8 end
9 if stagnval == 0
10 stagnval = optimValues.fval;
11 end
12 delta = abs(optimValues.fval-stagnval)/stagnval;
13 if delta < 0.01
14 stagniter = stagniter + 1;
15 if stagniter == 100
16 % fprintf('optimization stop: stagnation detected\n')
17 stop = true;
18 end
19 end
20 stagnval = optimValues.fval;
21 end