QRSOLV(3)

SYNOPSIS
SUBROUTINE QRSOLV (N, R, LDR, IPVT, DIAG, QTB, X, SIGMA, WA)

NAME
qrsolv - Subsidiary to SNLS1 and SNLS1E

LIBRARY
SLATEC

TYPE
SINGLE PRECISION (QRSOLV-S, DQRSLV-D)

AUTHOR
(UNKNOWN)

DESCRIPTION
Given an M by N matrix A, an N by N diagonal matrix D, and an M-vector B, the problem is to determine an X which solves the system A*X = B , D*X = 0 , in the least squares sense. This subroutine completes the solution of the problem if it is provided with the necessary information from the QR factorization, with column pivoting, of A. That is, if A*P = Q*R, where P is a permutation matrix, Q has orthogonal columns, and R is an upper triangular matrix with diagonal elements of nonincreasing magnitude, then QRSOLV expects the full upper triangle of R, the permutation matrix P, and the first N components of (Q TRANSPOSE)*B. The system A*X = B, D*X = 0, is then equivalent to T T R*Z = Q *B , P *D*P*Z = 0 , where X = P*Z. If this system does not have full rank, then a least squares solution is obtained. On output QRSOLV also provides an upper triangular matrix S such that T T T P *(A *A + D*D)*P = S *S . S is computed within QRSOLV and may be of separate interest. The subroutine statement is SUBROUTINE QRSOLV(N,R,LDR,IPVT,DIAG,QTB,X,SIGMA,WA) where N is a positive integer input variable set to the order of R. R is an N by N array. On input the full upper triangle must contain the full upper triangle of the matrix R. On output the full upper triangle is unaltered, and the strict lower triangle contains the strict upper triangle (transposed) of the upper triangular matrix S. LDR is a positive integer input variable not less than N which specifies the leading dimension of the array R. IPVT is an integer input array of length N which defines the permutation matrix P such that A*P = Q*R. Column J of P is column IPVT(J) of the identity matrix. DIAG is an input array of length N which must contain the diagonal elements of the matrix D. QTB is an input array of length N which must contain the first N elements of the vector (Q TRANSPOSE)*B. X is an output array of length N which contains the least squares solution of the system A*X = B, D*X = 0. SIGMA is an output array of length N which contains the diagonal elements of the upper triangular matrix S. WA is a work array of length N.

SEE ALSO
SNLS1, SNLS1E

ROUTINES CALLED
(NONE)

REVISION HISTORY (YYMMDD)
800301 DATE WRITTEN
890831 Modified array declarations. (WRB)
891214 Prologue converted to Version 4.0 format. (BAB)
900326 Removed duplicate information from DESCRIPTION section. (WRB)
900328 Added TYPE section. (WRB)