/* qrecvc.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ #include "complex.h" void qrecvc(double *ev,Cpx *evec,double *dp,int n) { double cc,sc,d,x,y,h,tzr=1.e-15; int i,j,k,m,nqr=50*n; Cpx *p; for(j=0,m=n-1;j1 && fabs(dp[m-2])>fabs(ev[k])*tzr) break; if((cc=sqrt((1.+x/h)/2.))!=0.) sc=dp[k]/(2.*cc*h); else sc=1.; x+=ev[m]; ev[m--]=x-h; ev[m--]=x+h; for(i=0,p=evec+n*(m+1); i0.) d=ev[m]+x-h; else d=ev[m]+x+h; cc=1.; y=0.; ev[0]-=d; for(k=0; k0) dp[k-1]=sc*h; ev[k]=cc*h; cc=x/h; sc=dp[k]/h; ev[k+1]-=d; y*=sc; ev[k]=cc*(ev[k]+y)+ev[k+1]*sc*sc+d; for(i=0,p=evec+n*k; i