LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zungl2()

subroutine zungl2 ( integer m,
integer n,
integer k,
complex*16, dimension( lda, * ) a,
integer lda,
complex*16, dimension( * ) tau,
complex*16, dimension( * ) work,
integer info )

ZUNGL2 generates all or part of the unitary matrix Q from an LQ factorization determined by cgelqf (unblocked algorithm).

Download ZUNGL2 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZUNGL2 generates an m-by-n complex matrix Q with orthonormal rows,
!> which is defined as the first m rows of a product of k elementary
!> reflectors of order n
!>
!>       Q  =  H(k)**H . . . H(2)**H H(1)**H
!>
!> as returned by ZGELQF.
!> 
Parameters
[in]M
!>          M is INTEGER
!>          The number of rows of the matrix Q. M >= 0.
!> 
[in]N
!>          N is INTEGER
!>          The number of columns of the matrix Q. N >= M.
!> 
[in]K
!>          K is INTEGER
!>          The number of elementary reflectors whose product defines the
!>          matrix Q. M >= K >= 0.
!> 
[in,out]A
!>          A is COMPLEX*16 array, dimension (LDA,N)
!>          On entry, the i-th row must contain the vector which defines
!>          the elementary reflector H(i), for i = 1,2,...,k, as returned
!>          by ZGELQF in the first k rows of its array argument A.
!>          On exit, the m by n matrix Q.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The first dimension of the array A. LDA >= max(1,M).
!> 
[in]TAU
!>          TAU is COMPLEX*16 array, dimension (K)
!>          TAU(i) must contain the scalar factor of the elementary
!>          reflector H(i), as returned by ZGELQF.
!> 
[out]WORK
!>          WORK is COMPLEX*16 array, dimension (M)
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0: successful exit
!>          < 0: if INFO = -i, the i-th argument has an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 110 of file zungl2.f.

111*
112* -- LAPACK computational routine --
113* -- LAPACK is a software package provided by Univ. of Tennessee, --
114* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
115*
116* .. Scalar Arguments ..
117 INTEGER INFO, K, LDA, M, N
118* ..
119* .. Array Arguments ..
120 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
121* ..
122*
123* =====================================================================
124*
125* .. Parameters ..
126 COMPLEX*16 ONE, ZERO
127 parameter( one = ( 1.0d+0, 0.0d+0 ),
128 $ zero = ( 0.0d+0, 0.0d+0 ) )
129* ..
130* .. Local Scalars ..
131 INTEGER I, J, L
132* ..
133* .. External Subroutines ..
134 EXTERNAL xerbla, zlacgv, zlarf1f, zscal
135* ..
136* .. Intrinsic Functions ..
137 INTRINSIC dconjg, max
138* ..
139* .. Executable Statements ..
140*
141* Test the input arguments
142*
143 info = 0
144 IF( m.LT.0 ) THEN
145 info = -1
146 ELSE IF( n.LT.m ) THEN
147 info = -2
148 ELSE IF( k.LT.0 .OR. k.GT.m ) THEN
149 info = -3
150 ELSE IF( lda.LT.max( 1, m ) ) THEN
151 info = -5
152 END IF
153 IF( info.NE.0 ) THEN
154 CALL xerbla( 'ZUNGL2', -info )
155 RETURN
156 END IF
157*
158* Quick return if possible
159*
160 IF( m.LE.0 )
161 $ RETURN
162*
163 IF( k.LT.m ) THEN
164*
165* Initialise rows k+1:m to rows of the unit matrix
166*
167 DO 20 j = 1, n
168 DO 10 l = k + 1, m
169 a( l, j ) = zero
170 10 CONTINUE
171 IF( j.GT.k .AND. j.LE.m )
172 $ a( j, j ) = one
173 20 CONTINUE
174 END IF
175*
176 DO 40 i = k, 1, -1
177*
178* Apply H(i)**H to A(i:m,i:n) from the right
179*
180 IF( i.LT.n ) THEN
181 CALL zlacgv( n-i, a( i, i+1 ), lda )
182 IF( i.LT.m ) THEN
183 CALL zlarf1f( 'Right', m-i, n-i+1, a( i, i ), lda,
184 $ conjg( tau( i ) ), a( i+1, i ), lda,
185 $ work )
186 END IF
187 CALL zscal( n-i, -tau( i ), a( i, i+1 ), lda )
188 CALL zlacgv( n-i, a( i, i+1 ), lda )
189 END IF
190 a( i, i ) = one - dconjg( tau( i ) )
191*
192* Set A(i,1:i-1) to zero
193*
194 DO 30 l = 1, i - 1
195 a( i, l ) = zero
196 30 CONTINUE
197 40 CONTINUE
198 RETURN
199*
200* End of ZUNGL2
201*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
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 zscal(n, za, zx, incx)
ZSCAL
Definition zscal.f:78
Here is the call graph for this function:
Here is the caller graph for this function: