% % Hyperbolic Givens transformation - % a special treatment in the case of zero hyperbolic energy % % explanation: % suppose that the hyperbolic energy of the reduced vector is in some % step of the algorithm equal to zero. In this case the procedure % hypgiv gives the matrix Psi with Psi(p,p)=\pm 2. In the next % step, i.e. annihilating the next component of x, we call instead % of hypgiv the procedure zerogiv, which gives again % the diagonal matrix Psi with all diagonal elements \pm 1 % (except the case a=4), see the Table 3 % % [y,G,Psi,a]=zerogiv(n,p,q,x,Phi) % % input data: % n ... dimension of x % p,q (p0 a=2; ro=sqrt(abs(x(p))*abs(x(p))-abs(x(q))*abs(x(q))); z=1; else a=3; ro=sqrt(abs(x(q))*abs(x(q))-abs(x(p))*abs(x(p))); z=-1; end ro1=1/ro; G(p,p)=ro1*x(p)'/sqrt(2); G(p,q)=-ro1*x(q)'/sqrt(2); G(q,p)=ro1*x(q); G(q,q)=-ro1*x(p); y(p)=z*ro/sqrt(2); y(q)=0; end end Psi=G'*Phi*G;