LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zgelq2.f
Go to the documentation of this file.
1*> \brief \b ZGELQ2 computes the LQ factorization of a general rectangular matrix using an unblocked algorithm.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZGELQ2 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgelq2.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zgelq2.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgelq2.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZGELQ2( M, N, A, LDA, TAU, WORK, INFO )
20*
21* .. Scalar Arguments ..
22* INTEGER INFO, LDA, M, N
23* ..
24* .. Array Arguments ..
25* COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
26* ..
27*
28*
29*> \par Purpose:
30* =============
31*>
32*> \verbatim
33*>
34*> ZGELQ2 computes an LQ factorization of a complex m-by-n matrix A:
35*>
36*> A = ( L 0 ) * Q
37*>
38*> where:
39*>
40*> Q is a n-by-n orthogonal matrix;
41*> L is a lower-triangular m-by-m matrix;
42*> 0 is a m-by-(n-m) zero matrix, if m < n.
43*>
44*> \endverbatim
45*
46* Arguments:
47* ==========
48*
49*> \param[in] M
50*> \verbatim
51*> M is INTEGER
52*> The number of rows of the matrix A. M >= 0.
53*> \endverbatim
54*>
55*> \param[in] N
56*> \verbatim
57*> N is INTEGER
58*> The number of columns of the matrix A. N >= 0.
59*> \endverbatim
60*>
61*> \param[in,out] A
62*> \verbatim
63*> A is COMPLEX*16 array, dimension (LDA,N)
64*> On entry, the m by n matrix A.
65*> On exit, the elements on and below the diagonal of the array
66*> contain the m by min(m,n) lower trapezoidal matrix L (L is
67*> lower triangular if m <= n); the elements above the diagonal,
68*> with the array TAU, represent the unitary matrix Q as a
69*> product of elementary reflectors (see Further Details).
70*> \endverbatim
71*>
72*> \param[in] LDA
73*> \verbatim
74*> LDA is INTEGER
75*> The leading dimension of the array A. LDA >= max(1,M).
76*> \endverbatim
77*>
78*> \param[out] TAU
79*> \verbatim
80*> TAU is COMPLEX*16 array, dimension (min(M,N))
81*> The scalar factors of the elementary reflectors (see Further
82*> Details).
83*> \endverbatim
84*>
85*> \param[out] WORK
86*> \verbatim
87*> WORK is COMPLEX*16 array, dimension (M)
88*> \endverbatim
89*>
90*> \param[out] INFO
91*> \verbatim
92*> INFO is INTEGER
93*> = 0: successful exit
94*> < 0: if INFO = -i, the i-th argument had an illegal value
95*> \endverbatim
96*
97* Authors:
98* ========
99*
100*> \author Univ. of Tennessee
101*> \author Univ. of California Berkeley
102*> \author Univ. of Colorado Denver
103*> \author NAG Ltd.
104*
105*> \ingroup gelq2
106*
107*> \par Further Details:
108* =====================
109*>
110*> \verbatim
111*>
112*> The matrix Q is represented as a product of elementary reflectors
113*>
114*> Q = H(k)**H . . . H(2)**H H(1)**H, where k = min(m,n).
115*>
116*> Each H(i) has the form
117*>
118*> H(i) = I - tau * v * v**H
119*>
120*> where tau is a complex scalar, and v is a complex vector with
121*> v(1:i-1) = 0 and v(i) = 1; conjg(v(i+1:n)) is stored on exit in
122*> A(i,i+1:n), and tau in TAU(i).
123*> \endverbatim
124*>
125* =====================================================================
126 SUBROUTINE zgelq2( M, N, A, LDA, TAU, WORK, INFO )
127*
128* -- LAPACK computational routine --
129* -- LAPACK is a software package provided by Univ. of Tennessee, --
130* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
131*
132* .. Scalar Arguments ..
133 INTEGER INFO, LDA, M, N
134* ..
135* .. Array Arguments ..
136 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
137* ..
138*
139* =====================================================================
140*
141* .. Parameters ..
142 COMPLEX*16 ONE
143 parameter( one = ( 1.0d+0, 0.0d+0 ) )
144* ..
145* .. Local Scalars ..
146 INTEGER I, K
147* ..
148* .. External Subroutines ..
149 EXTERNAL xerbla, zlacgv, zlarf1f, zlarfg
150* ..
151* .. Intrinsic Functions ..
152 INTRINSIC max, min
153* ..
154* .. Executable Statements ..
155*
156* Test the input arguments
157*
158 info = 0
159 IF( m.LT.0 ) THEN
160 info = -1
161 ELSE IF( n.LT.0 ) THEN
162 info = -2
163 ELSE IF( lda.LT.max( 1, m ) ) THEN
164 info = -4
165 END IF
166 IF( info.NE.0 ) THEN
167 CALL xerbla( 'ZGELQ2', -info )
168 RETURN
169 END IF
170*
171 k = min( m, n )
172*
173 DO 10 i = 1, k
174*
175* Generate elementary reflector H(i) to annihilate A(i,i+1:n)
176*
177 CALL zlacgv( n-i+1, a( i, i ), lda )
178 CALL zlarfg( n-i+1, a( i, i ), a( i, min( i+1, n ) ), lda,
179 $ tau( i ) )
180 IF( i.LT.m ) THEN
181*
182* Apply H(i) to A(i+1:m,i:n) from the right
183*
184 CALL zlarf1f( 'Right', m-i, n-i+1, a( i, i ), lda,
185 $ tau( i ),
186 $ a( i+1, i ), lda, work )
187 END IF
188 CALL zlacgv( n-i+1, a( i, i ), lda )
189 10 CONTINUE
190 RETURN
191*
192* End of ZGELQ2
193*
194 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zgelq2(m, n, a, lda, tau, work, info)
ZGELQ2 computes the LQ factorization of a general rectangular matrix using an unblocked algorithm.
Definition zgelq2.f:127
subroutine zlacgv(n, x, incx)
ZLACGV conjugates a complex vector.
Definition zlacgv.f:72
subroutine zlarf1f(side, m, n, v, incv, tau, c, ldc, work)
ZLARF1F applies an elementary reflector to a general rectangular
Definition zlarf1f.f:157
subroutine zlarfg(n, alpha, x, incx, tau)
ZLARFG generates an elementary reflector (Householder matrix).
Definition zlarfg.f:104