1
SUBROUTINE DGEQRF( M, N, A, LDA, TAU, WORK, LWORK, INFO )
3
* -- LAPACK routine (version 3.2) --
4
* -- LAPACK is a software package provided by Univ. of Tennessee, --
5
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
8
* -- Modified by R. Clint Whaley for ATLAS Fortran77 LAPACK interface, 2009
10
* .. Scalar Arguments ..
11
INTEGER INFO, LDA, LWORK, M, N
13
* .. Array Arguments ..
14
DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
20
* DGEQRF computes a QR factorization of a real M-by-N matrix A:
27
* The number of rows of the matrix A. M >= 0.
30
* The number of columns of the matrix A. N >= 0.
32
* A (input/output) COMPLEX*16 array, dimension (LDA,N)
33
* On entry, the M-by-N matrix A.
34
* On exit, the elements on and above the diagonal of the array
35
* contain the min(M,N)-by-N upper trapezoidal matrix R (R is
36
* upper triangular if m >= n); the elements below the diagonal,
37
* with the array TAU, represent the orthogonal matrix Q as a
38
* product of min(m,n) elementary reflectors (see Further
42
* The leading dimension of the array A. LDA >= max(1,M).
44
* TAU (output) DOUBLE PRECISION array, dimension (min(M,N))
45
* The scalar factors of the elementary reflectors (see Further
48
* WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK))
49
* On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
51
* LWORK (input) INTEGER
52
* The dimension of the array WORK. LWORK >= max(1,N).
53
* For optimum performance LWORK >= N*NB, where NB is
54
* the optimal blocksize.
56
* If LWORK = -1, then a workspace query is assumed; the routine
57
* only calculates the optimal size of the WORK array, returns
58
* this value as the first entry of the WORK array, and no error
59
* message related to LWORK is issued by XERBLA.
61
* INFO (output) INTEGER
62
* = 0: successful exit
63
* < 0: if INFO = -i, the i-th argument had an illegal value
68
* The matrix Q is represented as a product of elementary reflectors
70
* Q = H(1) H(2) . . . H(k), where k = min(m,n).
72
* Each H(i) has the form
74
* H(i) = I - tau * v * v**T
76
* where tau is a real scalar, and v is a real vector with
77
* v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
80
* =====================================================================
83
INTEGER I, IB, IINFO, IWS, K, LDWORK, LWKOPT, NB,
86
* .. External Subroutines ..
87
EXTERNAL XERBLA, ZGEQR2, ZLARFB, ZLARFT
89
* .. Intrinsic Functions ..
92
* .. External Functions ..
96
* .. Executable Statements ..
98
* Test the input arguments
103
ELSE IF( N.LT.0 ) THEN
105
ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
109
CALL XERBLA( 'Dgeqrf', -INFO )
113
* Quick return if possible
121
CALL ATL_F77WRAP_DGEQRF(M, N, A, LDA, TAU, WORK, LWORK, INFO)