


customized blss for acgc. To solve: Ax-lam<x>=b With <u>=eta*u write (A-lam*nu eta)x=b; and solve by Sherman-Morrison eta=[eta 0] for bordered system


0001 function x=gcblss(A,b,p,lam) 0002 % customized blss for acgc. 0003 % To solve: Ax-lam<x>=b 0004 % With <u>=eta*u write (A-lam*nu eta)x=b; 0005 % and solve by Sherman-Morrison 0006 % eta=[eta 0] for bordered system 0007 global eta nu; enu=[nu; 0]; eeta=[eta 0]; 0008 y=A\b; z=A\enu; al0=lam*eeta*z; al=lam*eeta*y/(1-al0); 0009 x=y+al*z; return % comment out to check Sherman 0010 c1=(A-lam*nu*eta)*x; c2=(A-lam*nu*eta)*y; 0011 err1=norm(c1-b); err2=norm(c2-b); 0012 fprintf('blss: SM-err=%g, noSM-err=%g\n', err1,err2);