This TI 85 program calculates the QR factorization of a matrix into a
orthogonal matrix Q times a row echelon matrix R using reflectors.


The program asks for the matrix to be factored, its rank, and
Column Interchange Y/N.  The matrices Q, R and P (if Column 
Interchange is Y) are produced.  If the input matrix is m x n, Q
is a m x m orthogonal matrix, R is a m x n matrix in row echelon
form, and P (if produced) is a n x n permutation matrix.  Let A be the
input matrix.  A=Q*R if Column Interchange is N,  and A*P=Q*R if
Column Interchange is Y.  If the rank of the input matrix is r, and if
Column Interchange is Y (or if the first r columns of the input matrix
are linearly independent), the r x r submatrix of R in the upper left
is upper triangular.  The matrix R is calculated by multiplying A by
successive reflectors (Householder matrices).  The matrix Q is the
transpose of the product of the reflectors.  The program QR calls a
subroutine INTC to accomplish the Column Interchange.  (See
FUNDAMENTALS OF MATRIX COMPUTATIONS by David S. Watkins, John Wiley,
1991 for details.) 
If the rank of the input matrix is unknown, then 0 can be entered
for the rank and Y for Column Interchange.  The rank can be
determined from R.  Then QR can be run again with the correct
rank r and possibly the columns of the input matrix rearranged so
that the first r are linearly independent.  The following
messages may appear:
ZERO MATRIX - the abs of all entries are less than tol,
WARNING GARBAGE - 0 has been entered for the rank but Y has
not been entered for Column Interchange,
SINGULAR - the cnorm of portion of the column on and below the
diagonal is less than tol, 
S=0 - same as singular except replace "cnorm" with "norm".
The input matrix may be singular without the SINGULAR message
being issued.  If for example, the rank is supplied.
Questions or comments should be addressed to James J. Woeppel,
JWOEPPEL@iusmail.ius.indiana.edu
