# if x is nearly parallel to e1 then v x jjxjj2e1 has

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: en v = x ; jjxjj2e1 has a small norm which could magnify roundo errors { To minimize this, choose v = x + sign(x1)jjxjj2e1 A program for Householder vectors function v = house(x) % house: Compute the Householder vector v that % annihilates all but the rst component of x. n = length(x) v=x v(1) = x(1) + sign(x(1))*norm (x) 5 (2c) Re ections Example 3 (cf. Golub and Van Loan (1993), Problem 5.1.1). Let x = 1 7 2 3 ;1]T . Find P { jjxjj2 = 8 { v = 9 7 2 3 ;1]T { The re ection is 2 3 81 63 18 27 ;9 6 63 49 14 21 ;7 7 T vv = I ; 1 6 18 14 4 6 ;2 7 6 7 P = I ; 2 vT v 6 7 72 6 27 21 6 9 ;3 7 4 5 ;9 ;7 ;2 ;3 1 2 P ;0:1250 ;0:8750 ;0:2500 ;0:3750 0:1250 0:0972 7 7 0:0278 7 7 0:0417 7 5 0:0417 0:9861 6 ;0:8750 0:3194 ;0:1944 ;0:2917 6 = 6 ;0:2500 ;0:1944 0:9444 ;0:0833 6 6 4 ;0:3750 ;0:2917 ;0:0833 0:8750 0:1250 0:0972 { The result is Px = 0:0278 0 0 0 0]T ;8 6 3 Re ections P never needs explicit generation and storage { Application of P to an n n matrix A would require O(n3) FLOPs { Compute PA = where vvT A = A + vwT I ; 2 vT v w = AT v = ;2=vT v This requires O(n2) operations Function for a pre-Householder update function A = row.house(A v) % row.house: Overwrite A 2 <m n with the product...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online