📄 termcrit.m
字号:
function term = TermCrit(p,betak,f,epsrel,epsabs,cTc,epscon);
%Check if termination
%norm(c)^2 = cTc should be < epscon in order to check the termination criteria
%term is set = 1 if absolute termination is reached: 0.5*norm(f)<epsabs
%term is set = 10 if relative termination is reached: betak/norm(f)<releps
%
term = 0;
if isempty(p)
term = -1003;
elseif cTc < epscon
lenf = norm(f);
if 0.5*lenf^2 <= epsabs
term = 1;
elseif betak <= lenf*epsrel
term = term+10;
else
term = 0;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -