Next: Tests for the Least Up: The Linear Equation Test Previous: Tests for Triangular Matrices   Contents

Tests for the Orthogonal Factorization Routines

The orthogonal factorization routines are contained in the test paths xQR, xRQ, xLQ, xQL, xQP, and xTZ. The first four of these test the QR, RQ, LQ, and QL factorizations without pivoting. The subroutines to generate or multiply by the orthogonal matrix from the factorization are also tested in these paths. There is not a separate test path for the orthogonal transformation routines, since the important thing when generating an orthogonal matrix is not whether or not it is, in fact, orthogonal, but whether or not it is the orthogonal matrix we wanted. The xQP test path is used for QR with pivoting, and xTZ tests the reduction of a trapezoidal matrix by an RQ factorization.

The test paths xQR, xRQ, xLQ, and xQL all use the same set of test matrices and compute similar test ratios, so we will only describe the xQR path. Also, we will refer to the subroutines by their single precision real names, SGEQRF, SGEQRS, SORGQR, and SORMQR. In the complex case, the orthogonal matrices are unitary, so the names beginning with SOR- are changed to CUN-. Each of the orthogonal factorizations can operate on 3#3-by-4#4 matrices, where 60#60, 61#61, or 62#62.

Eight test matrices are used for SQR and the other orthogonal factorization test paths. All are generated with a predetermined condition number (by default, 63#63).


1. 		 Diagonal 		 5. 		 Random, 24#24

2. 		 Upper triangular 		 6. 		 Random, 25#25

3. 		 Lower triangular 		 7. 		 Scaled near underflow

4. 		 Random, 63#63 8. 		 Scaled near overflow


The tests for the SQR path are as follows:

• Compute the QR factorization using SGEQRF, generate the orthogonal matrix 64#64 from the Householder vectors using SORGQR, and compute the ratio
1.
65#65

• Test the orthogonality of the computed matrix 64#64 by computing the ratio
2.
66#66

• Generate a random matrix 67#67 and multiply it by 64#64 or 68#68 using SORMQR with UPLO = `L', and compare the result to the product of 67#67 and 64#64 (or 68#68) using the explicit matrix 64#64 generated by SORGQR. The different options for SORMQR are tested by computing the 4 ratios
3.
69#69
4.
70#70
5.
71#71
6.
72#72
where the first product is computed using SORMQR and the second using the explicit matrix 64#64.

• Compute the least-squares solution to a system of equations 34#34 using SGEQRS, and compute the ratio
7.
35#35

In the SQP test path, we test the QR factorization with column pivoting (SGEQPF or SGEQP3), which decomposes a matrix 16#16 into a product of a permutation matrix 73#73, an orthogonal matrix 64#64, and an upper triangular matrix 74#74 such that 75#75. We generate three types of matrices 16#16 with singular values 52#52 as follows:

• all singular values are zero,
• all singular values are 1, except for 76#76, and
• the singular values are 77#77.
The following tests are performed:
• Compute the QR factorization with column pivoting using SGEQPF (or SGEQP3), compute the singular values 78#78 of 74#74 using SGEBD2 and SBDSQR, and compute the ratio

79#79

• Generate the orthogonal matrix 64#64 from the Householder vectors using SORMQR, and compute the ratio

80#80

• Test the orthogonality of the computed matrix 64#64 by computing the ratio

81#81

In the STZ path, we test the trapezoidal reduction (STZRQF or STZRZF), which decomposes an 3#3-by-4#4 (m 82#82 n) upper trapezoidal matrix 74#74 (i.e. 83#83 if 84#84) into a product of a strictly upper triangular matrix 85#85 (i.e. 86#86 if 84#84 or 87#87) and an orthogonal matrix 88#88 such that 89#89. We generate matrices with the following three singular value distributions 52#52:

• all singular values are zero,
• all singular values are 1, except for 76#76, and
• the singular values are 77#77.
To obtain an upper trapezoidal matrix with the specified singular value distribution, we generate a dense matrix using SLATMS and reduce it to upper triangular form using SGEQR2. The following tests are performed:
• Compute the trapezoidal reduction STZRQF (or STZRZF), compute the singular values 78#78 of 85#85 using SGEBD2 and SBDSQR, and compute the ratio

79#79

• Apply the orthogonal matrix 88#88 to 85#85 from the right using SLATZM, and compute the ratio

90#90

• Form 91#91 using SLATZM, and compute the ratio

92#92

Next: Tests for the Least Up: The Linear Equation Test Previous: Tests for Triangular Matrices   Contents
Susan Blackford 2001-08-13