SUBROUTINE CQRDC(X,LDX,N,P,QRAUX,JPVT,WORK,JOB) C***BEGIN PROLOGUE CQRDC C***DATE WRITTEN 780814 (YYMMDD) C***REVISION DATE 820801 (YYMMDD) C***CATEGORY NO. D5 C***KEYWORDS COMPLEX,DECOMPOSITION,LINEAR ALGEBRA,LINPACK,MATRIX, C ORTHOGONAL TRIANGULAR C***AUTHOR STEWART, G. W., (U. OF MARYLAND) C***PURPOSE Uses Householder transformations to compute the QR factori- C zation of an N by P matrix X. Column pivoting is optional. C***DESCRIPTION C C CQRDC uses Householder transformations to compute the QR C factorization of an N by P matrix X. Column pivoting C based on the 2-norms of the reduced columns may be C performed at the users option. C C On Entry C C X COMPLEX(LDX,P), where LDX .GE. N. C X contains the matrix whose decomposition is to be C computed. C C LDX INTEGER. C LDX is the leading dimension of the array X. C C N INTEGER. C N is the number of rows of the matrix X. C C P INTEGER. C P is the number of columns of the matrix X. C C JVPT INTEGER(P). C JVPT contains integers that control the selection C of the pivot columns. The K-th column X(K) of X C is placed in one of three classes according to the C value of JVPT(K). C C If JVPT(K) .GT. 0, then X(K) is an initial C column. C C If JVPT(K) .EQ. 0, then X(K) is a free column. C C If JVPT(K) .LT. 0, then X(K) is a final column. C C Before the decomposition is computed, initial columns C are moved to the beginning of the array X and final C columns to the end. Both initial and final columns C are frozen in place during the computation and only C free columns are moved. At the K-th stage of the C reduction, if X(K) is occupied by a free column C it is interchanged with the free column of largest C reduced norm. JVPT is not referenced if C JOB .EQ. 0. C C WORK COMPLEX(P). C WORK is a work array. WORK is not referenced if C JOB .EQ. 0. C C JOB INTEGER. C JOB is an integer that initiates column pivoting. C If JOB .EQ. 0, no pivoting is done. C If JOB .NE. 0, pivoting is done. C C On Return C C X X contains in its upper triangle the upper C triangular matrix R of the QR factorization. C Below its diagonal X contains information from C which the unitary part of the decomposition C can be recovered. Note that if pivoting has C been requested, the decomposition is not that C of the original matrix X but that of X C with its columns permuted as described by JVPT. C C QRAUX COMPLEX(P). C QRAUX contains further information required to recover C the unitary part of the decomposition. C C JVPT JVPT(K) contains the index of the column of the C original matrix that has been interchanged into C the K-th column, if pivoting was requested. C C LINPACK. This version dated 08/14/78 . C Stewart, G. W., University of Maryland, Argonne National Lab. C C CQRDC uses the following functions and subprograms. C C BLAS CAXPY,CDOTC,CSCAL,CSWAP,SCNRM2 C Fortran ABS,AIMAG,AMAX1,CABS,CMPLX,CSQRT,MIN0,REAL C***REFERENCES DONGARRA J.J., BUNCH J.R., MOLER C.B., STEWART G.W., C *LINPACK USERS GUIDE*, SIAM, 1979. C***ROUTINES CALLED CAXPY,CDOTC,CSCAL,CSWAP,SCNRM2 C***END PROLOGUE CQRDC