Interactive Educational Modules in
Scientific Computing

Classical Gram-Schmidt QR Factorization

This module illustrates the use of classical 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 classical 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. The current column is first updated by subtracting off components in each preceding column, and then the fully updated column is normalized. 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 column-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.2.

Developers: Jessica Schoen, Jing Zou, and Michael Heath