This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Classical Gram–Schmidt vs Modiﬁed Gram–Schmidt
Let A ∈ Rm×n , with m ≥ n, and let A have n linearly independent columns a1 , a2 , . . . , an . There are many ways to implement the Gram–Schmidt process. Here are two very diﬀerent implementations: Classical for k=1:n, w = ak for j = 1:k1, t rjk = qj w end for j = 1:k1, w = w − rjk qj end rkk = w 2 qk = w/rkk end Modiﬁed for k=1:n, w = ak for j=1:k1,
t rjk = qj w w = w − rjk qj end rkk = w 2 qk = w/rkk 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 diﬀerently. In classical Gram–Schmidt (CGS) we compute the (signed) lengths of the orthogonal projections of w = ak onto q1 , q2 , . . . , qk−1 , and then subtract those projections (and the rounding errors) from w. If Qk−1 = [q1 , q2 , . . . , qk−1 ], then the orthogonal projector onto ColSp(Qk−1 ) is P = Qk−1 (Qt −1 Qk−1 )−1 Qt −1 . If Qk−1 has k k orthonormal columns, then P = Qk−1 Qt −1 : k w = (I − Qk−1 Qt −1 )ak . k But because of rounding errors, Qk−1 does not have truly orthogonal columns. In modiﬁed Gram–Schmidt (MGS) we compute the length of the projection of w = ak onto q1 and subtract that projection (and the rounding errors) from w. Next we compute the length of the projection of the computed w onto q2 and subtract that projection (and the rounding errors) from w, and so on, but always orthogonalizing against the computed version of w. Evaluated from right to left:
t t t w = (I − qk−1 qk−1 ) . . . (I − q2 q2 )(I − q1 q1 )ak . If the computed Qt −1 Qk−1 = I + E , then this is very nearly the same w that would k be computed by w = (I − Qk−1 (Qt −1 Qk−1 )−1 Qt −1 )ak k k where we replace (Qt −1 Qk−1 )−1 by I − E , and is much “more orthogonal” to Qk−1 k than the CGS w. ...
View
Full
Document
This note was uploaded on 12/18/2010 for the course PHYS 5073 taught by Professor Mark during the Fall '10 term at Arkansas.
 Fall '10
 MARK

Click to edit the document details