Interactive Educational Modules in
Scientific Computing

Modified Gram-Schmidt QR Factorization

This module illustrates the use of modified Gram-Schmidt orthogonalization to compute the QR factorization of a matrix.

The user first selects a matrix size, then selects a matrix A by choosing a preset example, a random matrix, or typing in desired entries. The successive steps of modified Gram-Schmidt QR factorization are then carried out sequentially by repeatedly clicking on NEXT or on the currently highlighted step. The current column is indicated by an arrow. After the current column is normalized, the component in the current column is subtracted from each of the succeeding columns. The resulting orthonormalized columns, which form Q, replace the corresponding columns of A on the left, and the resulting entries of R, which are generated row-wise, are shown on the right. The factorization process is complete when all the columns are orthonormal. Formats provided for displaying numeric entries include exponential (e), fixed (f), and generic (g), with g the default.

Reference: Michael T. Heath, Scientific Computing, An Introductory Survey, 2nd edition, McGraw-Hill, New York, 2002. See Section 3.5.3, especially Algorithm 3.3 and Example 3.11.

Developers: Jessica Schoen and Michael Heath