{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# CGSMGS - Classical GramSchmidt vs Modied GramSchmidt Let A...

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

Classical Gram–Schmidt vs Modified Gram–Schmidt Let A R m × n , with m n , and let A have n linearly independent columns a 1 , a 2 , . . . , a n . There are many ways to implement the Gram–Schmidt process. Here are two very different implementations: Classical Modified for k=1:n, for k=1:n, w = a k w = a k for j = 1:k-1, for j=1:k-1, r jk = q t j w end r jk = q t j w for j = 1:k-1, w = w - r jk q j w = w - r jk q j end end r kk = k w k 2 r kk = k w k 2 q k = w/r kk q k = w/r kk end end Please study the pseudocode above carefully. In exact arithmetic, these two methods generate exactly the same output. Before going on think about why, in the presence of rounding errors, they behave so differently. In classical Gram–Schmidt (CGS) we compute the (signed) lengths of the orthogonal projections of w = a k onto q 1 , q 2 , . . . , q k - 1 , and then subtract those projections (and the rounding errors) from w . If Q k - 1 = [ q 1 , q 2 , . . . , q k - 1 ], then the orthogonal projector onto ColSp( Q k - 1 ) is P = Q k - 1 ( Q t k - 1 Q k - 1 ) - 1 Q t k - 1 . If Q k - 1 has orthonormal columns, then P = Q k - 1 Q t k - 1 : w = ( I - Q k - 1 Q
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online