The LLS test program tests the PxGELS driver routine for computing solutions to over- and underdetermined, full-rank systems of linear equations ( is -by-). For each test matrix type, we generate three matrices: One which is scaled near underflow, a matrix with moderate norm, and one which is scaled near overflow.

The PxGELS driver computes the least-squares solutions (when ) and the minimum-norm solution (when ) for an -by- matrix of full rank. To test PxGELS, we generate a diagonally dominant matrix , and for and , we

- generate a consistent right-hand side such that is in
the range space of , compute a matrix using PxGELS, and compute
the ratio

- If has more rows than columns (i.e. we are solving a
least-squares problem), form , and check whether
is orthogonal to the column space of by computing

- If has more columns than rows (i.e. we are solving an
overdetermined system), check whether the solution is
in the row space of by scaling both and to have
norm one, and forming the QR factorization
of if , and the LQ factorization of
if . Letting
in the
first case, and
in the latter,
we compute