📄 analysis.m
字号:
function [phaseout, termout, X, Aset, Abounds, alphalate, Wklate, betalate] = ...
Analysis(k,Xin,n,p,f,c,Teq,Tineq,LB,UB,alpha,alphakm1,Wk,Wkm1,betak,betakm1,phase,term)
%Call: [phaseout, termout, X, Aset, Abounds, alphalate, Wklate, betalate] = ...
% Analysis(k,Xin,n,p,f,c,Teq,Tineq,LB,UB,alpha,alphakm1,Wk,Wkm1,betak,betakm1,phase,term)
%Do some analysis in order to see if GN is working -later!
%Update some quantities
%
%disp('In Analysis')
delta1 = 0.5;
delta2 = 0.1;
delta3 = 1e-3; %***********************
betalate = betak;
Wklate = Wk;
alphalate = alpha;
phaseout = phase;
termout = term;
Aset = 1:Teq;
IndNeg = find(c(Teq+1:Teq+Tineq) <= 0);
if (max(size(IndNeg))+Teq) <= n
Aset = [Aset IndNeg];
else
disp('T exceeds n in working set')
phaseout = 123
termout = -1000
end
X = Xin;
Abounds = zeros(n,1);
i = find(Xin<=LB);
X(i)=LB(i);
Abounds(i) = 1;
j = find(Xin>=UB);
X(j) = UB(j);
Abounds(j) = -1;
%Check to see if Newton's method should be used
%
if phase == 2 %Newton already in use
%the closeness to the solution should not decrease
if betak >= betakm1
phaseout = 124
termout = -1001
else
disp('Newton ok!')
end
else %check to see if Newton should be used
if (k ~= 0) & (betak>betakm1*delta1) & (betak<=delta2*norm(f)) & (norm(c(Aset))<delta3)...
& (alpha<0.25)
phaseout = 2;
disp('Newton suggested')
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -