## Solution to a Linear System in a QR-Factored General Matrix

The subroutines described in this section solve the linear system Ax = b for a general matrix A, which has been QR-factored by xQRDC, and vectors b and x.

### Arguments xA Part of the QR factorization of matrix A as computed by xSRDC. LDA Leading dimension of the array A as specified in a dimension or type statement. LDA max(1,N). N Number of rows in the matrix AK where AK is described below. N 0. K Number of columns in the matrix AK where AK is described below. K 0. xQRAUX Auxiliary output from xQRDC. xY Vector to be manipulated by xQRSL. xQY On exit, QY contains Q × Y if its computation has been requested in JOB; QY is not referenced if its computation is not requested. xQTY On exit, QTY contains QT × Y if its computation has been requested in JOB; QTY is not referenced if its computation is not requested. xB On entry, the right-hand side vector b. On exit, the solution vector x. B is not referenced if its computation is not requested. xRESID On exit, RESID contains the least squares residual y - AK × b if its computation has been requested. RESID also is the orthogonal projection of y onto the orthogonal complement of the column space of AK. RESID is not referenced if its computation is not requested. xAB On exit, AB contains the least squares approximation AK × b if its computation has been requested. AB is the orthogonal projection of y onto the column space of x. AB is not referenced if its computation is not requested. JOB Integer in the form abcde; determines which operation or operations the subroutine will perform: a 0 compute QY b, c, d, or e 0 compute QTY c 0 compute B d 0 compute RESID e 0 compute AB INFO On exit: INFO = 0 Subroutine completed normally. INFO > 0 Returns a value k if the computation of B has been requested and R is singular; the value of k is then the index of the first zero element of R.

The matrix AK is constructed from the factored orthogonal matrix Q and upper triangular matrix R from xQRDC as follows: