/* qrbdi.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 int qrbdi(double *dm,double *em,int m) { int i,j,k,n; double u,x,y,a,b,c,s,t; for(j=1,t=fabs(dm[0]); jt) t=s; t*=1.e-15; n=100*m; for(j=0; m>1 && j0 ;--k){ if(fabs(em[k-1])0.){ c=sqrt((u+a)/(u+u)); if(c!=0.) s/=(c*u); else s=1.; for(i=k; ik){ a=s*em[i]; b*=c; em[i-1]=u=sqrt(x*x+a*a); c=x/u; s=a/u; } a=c*y+s*b; b=c*b-s*y; s*=dm[i+1]; dm[i]=u=sqrt(a*a+s*s); y=c*dm[i+1]; c=a/u; s/=u; x=c*b+s*y; y=c*y-s*b; } } em[m-2]=x; dm[m-1]=y; if(fabs(x)