正在加载图片...
484 Chapter 11. Eigensystems r int last,j,ii float s,r,g,f,c,sqrdx; sqrdx=RADIX*RADIX: last=0; while (last ==0){ last=1; for (i=1;i<=n;i++){ Calculate row and column norms. r=c=0.0; for (j=1;j<=n;j++) 1f(j!=1)[ http://www.nr. c+=fabs(a[i][i]); r +=fabs(a[i][j]); 83 if (c &r){ If both are nonzero, granted for g=r/RADIX: f=1.0; 11-00 s=c+r; while (c<g){ find the integer power of the machine radix that f*=RADIX; comes closest to balancing the matrix. /Cambridge c *sgrdx; from NUMERICAL RECIPES IN 19881992 g=r*RADIX: while (c>g){ f /RADIX; c /sgrdx; America server computer, to make one paper University Press. THE ART 1f((c+r)/f<0.95*s)[ last=0; g=1.0/f; or(j=1;j<=n;j+)a[1][j]*=g; Apply similarity transforma- ictly proh for thei Programs for (j=1;j<=n;j++)a[j][i]*f; tion. 2 2222 to dir 18881920 OF SCIENTIFIC COMPUTING(ISBN Reduction to Hessenberg Form The strategy for finding the eigensystem of a general matrix parallels that of the .Further reproduction, 10-521 symmetric case.First we reduce the matrix to a simpler form,and then we perform Numerical Recipes 43108 an iterative procedure on the simplified matrix.The simpler structure we use here is called Hessenberg form.An upper Hessenberg matrix has zeros everywhere below (outside the diagonal except for the first subdiagonal row.For example,in the 6 x 6 case, the nonzero elements are: North Software. Ame 「X X + + By now you should be able to tell at a glance that such a structure can be achieved by a sequence of Householder transformations,each one zeroing the484 Chapter 11. Eigensystems Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machine￾readable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). { int last,j,i; float s,r,g,f,c,sqrdx; sqrdx=RADIX*RADIX; last=0; while (last == 0) { last=1; for (i=1;i<=n;i++) { Calculate row and column norms. r=c=0.0; for (j=1;j<=n;j++) if (j != i) { c += fabs(a[j][i]); r += fabs(a[i][j]); } if (c && r) { If both are nonzero, g=r/RADIX; f=1.0; s=c+r; while (c<g) { find the integer power of the machine radix that f *= RADIX; comes closest to balancing the matrix. c *= sqrdx; } g=r*RADIX; while (c>g) { f /= RADIX; c /= sqrdx; } if ((c+r)/f < 0.95*s) { last=0; g=1.0/f; for (j=1;j<=n;j++) a[i][j] *= g; Apply similarity transforma￾for (j=1;j<=n;j++) a[j][i] *= f; tion. } } } } } Reduction to Hessenberg Form The strategy for finding the eigensystem of a general matrix parallels that of the symmetric case. First we reduce the matrix to a simpler form, and then we perform an iterative procedure on the simplified matrix. The simpler structure we use here is called Hessenberg form. An upper Hessenberg matrix has zeros everywhere below the diagonal except for the first subdiagonal row. For example, in the 6 × 6 case, the nonzero elements are:        ×××××× ×××××× ××××× ×××× ××× × ×        By now you should be able to tell at a glance that such a structure can be achieved by a sequence of Householder transformations, each one zeroing the
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有