21.06.2014 Views

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Recall:<br />

e i ˆ= i-th unit vector<br />

Changing a single row: given x ∈ K n<br />

{<br />

A,Ã ∈ Kn,n a<br />

: ã ij = ij , if i ≠ i ∗ ,<br />

x j + a ij , if i = i ∗ ,<br />

à = A + x · e i ∗e T j ∗ . (2.9.2)<br />

, i ∗ ,j ∗ ∈ {1, ...,n} .<br />

Apply Lemma 2.9.1 for k = 1:<br />

x = ( I −<br />

A−1 uv H )<br />

A −1 1 + v H A −1 b .<br />

u<br />

Efficient implementation !<br />

Code 2.9.4: solving a rank-1 modified LSE<br />

1 function x = smw( L ,U, u , v , b )<br />

2 t = L \ b ; z = U\ t ;<br />

3 t = L \ u ; w = U\ t ;<br />

4 alpha = 1+dot ( v ,w) ;<br />

5 i f ( abs ( alpha ) < eps∗norm(U, 1 ) ) ,<br />

➤<br />

error ( ’ Nearly s i n g u l a r<br />

m a trix ’ ) ; end ;<br />

6 x = z − w∗dot ( v , z ) / alpha ;<br />

△<br />

à = A + e i ∗x T . (2.9.3)<br />

The approach of Rem. 2.9.3 is certainly efficient, but may suffer from instability similar to Gaussian<br />

elimination without pivoting, cf. Ex. 2.3.1.<br />

Both matrix modifications (2.9.1) and (2.9.3) are specimens of a rank-1-modifications.<br />

This can be avoided by using QR-factorization (→ Sect. 2.8) and corresponding update techniques.<br />

This is the principal rationale for studying QR-factorization for the solution of linear system of equations.<br />

✸<br />

Ôº¾½ ¾º<br />

Other important applications of QR-factorization will be discussed later in Chapter 6.<br />

Ôº¾½ ¾º<br />

A ∈ K n,n ↦→ Ã := A + uvH , u,v ∈ K n . (2.9.4)<br />

Task:<br />

Efficient computation of QR-factorization (→ Sect. 2.8) à = ˜Q˜R of à from (2.9.4), when<br />

QR-factorization A = QR already known<br />

Remark 2.9.3 (Solving LSE in the case of rank-1-modification).<br />

general rank-1-matrix<br />

1 With w := Q H u: A + uv H = Q(R + wv H )<br />

➡<br />

Asymptotic complexity O(n 2 ) (depends on how Q is stored)<br />

✬<br />

✩<br />

Lemma 2.9.1 (Sherman-Morrison-Woodbury formula). For regular A ∈ K n,n , and U,V ∈<br />

K n,k , n, k ∈ N, k ≤ n, holds<br />

if<br />

✫<br />

(A + UV H ) −1 = A −1 − A −1 U(I + V H A −1 U) −1 V H A −1 ,<br />

I + V H A −1 U regular.<br />

Task: Solve Ãx = b, when LU-factorization A = LU already known<br />

✪<br />

2 Objective: w → ‖w‖e 1 ➤ via n − 1 Givens rotations, see (2.8.3).<br />

⎛ ⎞ ⎛ ⎞ ⎛ ⎞<br />

⎛ ⎞<br />

∗<br />

∗<br />

∗<br />

∗<br />

∗.<br />

G<br />

w =<br />

∗<br />

n−1,n<br />

∗.<br />

G −−−−−→<br />

∗<br />

n−2,n−1<br />

∗.<br />

G −−−−−−→<br />

∗<br />

n−3,n−2 G 1,2<br />

0.<br />

−−−−−−→ · · · −−−→<br />

0<br />

⎜<br />

∗<br />

⎟ ⎜<br />

∗<br />

⎟ ⎜<br />

∗<br />

⎟<br />

⎜<br />

0<br />

⎟<br />

⎝∗⎠<br />

⎝∗⎠<br />

⎝0⎠<br />

⎝0⎠<br />

∗ 0<br />

0<br />

0<br />

(2.9.5)<br />

Ôº¾½ ¾º<br />

Note the difference between this arrangement of successive Givens rotations to turn w into a multiple<br />

of the first unit vector e 1 , and the different sequence of Givens rotations discussed in Sect. 2.8. Both<br />

serve the same purpose, but we shall see in a moment that the smart selection of Givens rotations in<br />

crucial in the current context.<br />

Ôº¾¾¼ ¾º

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

Saved successfully!

Ooh no, something went wrong!