iter+1;
0036   q=A*v;
0037   delta=reshape(q,1,length(q))*reshape(q,length(q),1);
0038   uu=q-delta*u-beta*uold;
0039   vv=(uu'*A)';  <span class="comment">% =A'*uu</span>
0040   beta=norm(vv);
0041   v=vv/beta;
0042   uold=u;
0043   u=uu/beta;
0044 
0045   <span class="keyword">for</span> k = kmin:kmax,
0046     ddk=alpha(k+1)+delta;
0047     gg(k+1)=1/(ddk-ww(k+1)/gg(k+1));
0048     ww(k+1)=(beta*gg(k+1)).^2;
0049     ss(k+1)=-beta*gg(k+1)*ss(k+1);
0050     X(:,k+1)=X(:,k+1)+gg(k+1)*P(:,k+1);
0051     R(: