3
* =========== DOCUMENTATION ===========
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
9
*> Download DGELQF + dependencies
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgelqf.f">
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgelqf.f">
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgelqf.f">
21
* SUBROUTINE DGELQF( M, N, A, LDA, TAU, WORK, LWORK, INFO )
23
* .. Scalar Arguments ..
24
* INTEGER INFO, LDA, LWORK, M, N
26
* .. Array Arguments ..
27
* DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
36
*> DGELQF computes an LQ factorization of a real M-by-N matrix A:
46
*> The number of rows of the matrix A. M >= 0.
52
*> The number of columns of the matrix A. N >= 0.
57
*> A is DOUBLE PRECISION array, dimension (LDA,N)
58
*> On entry, the M-by-N matrix A.
59
*> On exit, the elements on and below the diagonal of the array
60
*> contain the m-by-min(m,n) lower trapezoidal matrix L (L is
61
*> lower triangular if m <= n); the elements above the diagonal,
62
*> with the array TAU, represent the orthogonal matrix Q as a
63
*> product of elementary reflectors (see Further Details).
69
*> The leading dimension of the array A. LDA >= max(1,M).
74
*> TAU is DOUBLE PRECISION array, dimension (min(M,N))
75
*> The scalar factors of the elementary reflectors (see Further
81
*> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
82
*> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
88
*> The dimension of the array WORK. LWORK >= max(1,M).
89
*> For optimum performance LWORK >= M*NB, where NB is the
92
*> If LWORK = -1, then a workspace query is assumed; the routine
93
*> only calculates the optimal size of the WORK array, returns
94
*> this value as the first entry of the WORK array, and no error
95
*> message related to LWORK is issued by XERBLA.
101
*> = 0: successful exit
102
*> < 0: if INFO = -i, the i-th argument had an illegal value
108
*> \author Univ. of Tennessee
109
*> \author Univ. of California Berkeley
110
*> \author Univ. of Colorado Denver
113
*> \date November 2011
115
*> \ingroup doubleGEcomputational
117
*> \par Further Details:
118
* =====================
122
*> The matrix Q is represented as a product of elementary reflectors
124
*> Q = H(k) . . . H(2) H(1), where k = min(m,n).
126
*> Each H(i) has the form
128
*> H(i) = I - tau * v * v**T
130
*> where tau is a real scalar, and v is a real vector with
131
*> v(1:i-1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i,i+1:n),
132
*> and tau in TAU(i).
135
* =====================================================================
1
136
SUBROUTINE DGELQF( M, N, A, LDA, TAU, WORK, LWORK, INFO )
3
* -- LAPACK routine (version 2.0) --
4
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5
* Courant Institute, Argonne National Lab, and Rice University
138
* -- LAPACK computational routine (version 3.4.0) --
139
* -- LAPACK is a software package provided by Univ. of Tennessee, --
140
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
8
143
* .. Scalar Arguments ..
9
144
INTEGER INFO, LDA, LWORK, M, N
11
146
* .. Array Arguments ..
12
DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( LWORK )
147
DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
16
* $Id: dgelqf.f 19697 2010-10-29 16:57:34Z d3y133 $
21
* DGELQF computes an LQ factorization of a real M-by-N matrix A:
28
* The number of rows of the matrix A. M >= 0.
31
* The number of columns of the matrix A. N >= 0.
33
* A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
34
* On entry, the M-by-N matrix A.
35
* On exit, the elements on and below the diagonal of the array
36
* contain the m-by-min(m,n) lower trapezoidal matrix L (L is
37
* lower triangular if m <= n); the elements above the diagonal,
38
* with the array TAU, represent the orthogonal matrix Q as a
39
* product of elementary reflectors (see Further Details).
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 (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,M).
53
* For optimum performance LWORK >= M*NB, where NB is the
56
* INFO (output) INTEGER
57
* = 0: successful exit
58
* < 0: if INFO = -i, the i-th argument had an illegal value
63
* The matrix Q is represented as a product of elementary reflectors
65
* Q = H(k) . . . H(2) H(1), where k = min(m,n).
67
* Each H(i) has the form
69
* H(i) = I - tau * v * v'
71
* where tau is a real scalar, and v is a real vector with
72
* v(1:i-1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i,i+1:n),
75
150
* =====================================================================
77
152
* .. Local Scalars ..
78
INTEGER I, IB, IINFO, IWS, K, LDWORK, NB, NBMIN, NX
154
INTEGER I, IB, IINFO, IWS, K, LDWORK, LWKOPT, NB,
80
157
* .. External Subroutines ..
81
158
EXTERNAL DGELQ2, DLARFB, DLARFT, XERBLA