17.11.2012 Views

Numerical recipes

Numerical recipes

Numerical recipes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11.2 Reduction of a Symmetric Matrix to Tridiagonal Form 471<br />

where e1 is the unit vector [1, 0,...,0] T , and the choice of signs will be made<br />

later. Then<br />

P · x = x − u<br />

H · (x ∓|x|e1) T · x<br />

= x − 2u · (|x|2 ∓|x|x1)<br />

2|x| 2 ∓ 2|x|x1<br />

= x − u<br />

= ±|x|e1<br />

(11.2.6)<br />

This shows that the Householder matrix P acts on a given vector x to zero all its<br />

elements except the first one.<br />

To reduce a symmetric matrix A to tridiagonal form, we choose the vector x<br />

for the first Householder matrix to be the lower n − 1 elements of the first column.<br />

Then the lower n − 2 elements will be zeroed:<br />

⎡<br />

1<br />

⎢ 0<br />

⎢<br />

P1 · A = ⎢ 0<br />

⎢<br />

⎣ .<br />

0 0 ···<br />

(n−1)<br />

P1<br />

⎤ ⎡<br />

0<br />

⎥ ⎢<br />

⎥ ⎢ a21<br />

⎥ ⎢<br />

⎥ · ⎢ a31 ⎢<br />

⎥ ⎢<br />

⎦ ⎣ . irrelevant<br />

0<br />

an1<br />

=<br />

⎡<br />

a11<br />

⎢ k<br />

⎢ 0<br />

⎢<br />

⎣ .<br />

0<br />

a12 a13 ···<br />

irrelevant<br />

⎤<br />

a1n<br />

⎥<br />

⎦<br />

a11 a12 a13 ··· a1n<br />

⎤<br />

⎥<br />

⎦<br />

(11.2.7)<br />

Here we have written the matrices in partitioned form, with (n−1) P denoting a<br />

Householder matrix with dimensions (n − 1) × (n − 1). The quantity k is simply<br />

plus or minus the magnitude of the vector [a 21,...,an1] T .<br />

The complete orthogonal transformation is now<br />

A ′ ⎡<br />

⎤<br />

a11<br />

⎢<br />

k<br />

⎢<br />

= P · A · P = ⎢ 0<br />

⎢<br />

⎣ .<br />

0<br />

k 0 ···<br />

irrelevant<br />

0<br />

⎥<br />

⎦<br />

We have used the fact that P T = P.<br />

(11.2.8)<br />

Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)<br />

Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by <strong>Numerical</strong> Recipes Software.<br />

Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable<br />

files (including this one) to any server computer, is strictly prohibited. To order <strong>Numerical</strong> Recipes books or CDROMs, visit website<br />

http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!