⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chenmh_eigifp.m

📁 Frequently used algorithms for numerical analysis and signal processing
💻 M
字号:
function [x,s,e] = Chenmh_Eigifp(A,B,m,tol)
% m is the dimension of the Krylov subspace.
n = size(A,1); 
x = randn(n,1); 
s = (x'*A*x)/(x'*B*x);
e = norm(A*x-s*B*x)/norm(x);
while (e(end)>tol)
    C = A - s*B;
    V = x/norm(x); H = []; istop = 0; i = 0;
    while (i<m & istop==0)
        [V,H,i,istop] = Chenmh_ArnoldiPro(C,n,i,V,H);
    end
    H_s = H(1:end-1,:); V_s = V(:,1:end-1); 
%     [V_s'*C*V_s H_s]
%     pause
    [U,Sig] = eig(H_s,V_s'*B*V_s);
    [val,ndx] = min(diag(Sig));
    x = V_s*U(:,ndx);
    s = s + val;
    e = [e; norm(A*x-s*B*x)/norm(x)];
    if istop==1 break; end;
end
    
    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -