LAPACK provides a number of routines for factorizing a general rectangular m-by-n matrix A, as the product of an orthogonal matrix (unitary if complex) and a triangular (or possibly trapezoidal) matrix.
A real matrix Q is orthogonal if QT Q = I;
a complex matrix Q is unitary if QH Q = I.
Orthogonal or unitary matrices have the important property that they leave the
two-norm of a vector invariant:
Orthogonal factorizations are used in the solution of linear least squares problems. They may also be used to perform preliminary steps in the solution of eigenvalue or singular value problems.