 LAPACK  3.10.1 LAPACK: Linear Algebra PACKage

## ◆ zgeqrt2()

 subroutine zgeqrt2 ( integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldt, * ) T, integer LDT, integer INFO )

ZGEQRT2 computes a QR factorization of a general real or complex matrix using the compact WY representation of Q.

Purpose:
``` ZGEQRT2 computes a QR factorization of a complex M-by-N matrix A,
using the compact WY representation of Q.```
Parameters
 [in] M ``` M is INTEGER The number of rows of the matrix A. M >= N.``` [in] N ``` N is INTEGER The number of columns of the matrix A. N >= 0.``` [in,out] A ``` A is COMPLEX*16 array, dimension (LDA,N) On entry, the complex M-by-N matrix A. On exit, the elements on and above the diagonal contain the N-by-N upper triangular matrix R; the elements below the diagonal are the columns of V. See below for further details.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >= max(1,M).``` [out] T ``` T is COMPLEX*16 array, dimension (LDT,N) The N-by-N upper triangular factor of the block reflector. The elements on and above the diagonal contain the block reflector T; the elements below the diagonal are not used. See below for further details.``` [in] LDT ``` LDT is INTEGER The leading dimension of the array T. LDT >= max(1,N).``` [out] INFO ``` INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value```
Further Details:
```  The matrix V stores the elementary reflectors H(i) in the i-th column
below the diagonal. For example, if M=5 and N=3, the matrix V is

V = (  1       )
( v1  1    )
( v1 v2  1 )
( v1 v2 v3 )
( v1 v2 v3 )

where the vi's represent the vectors which define H(i), which are returned
in the matrix A.  The 1's along the diagonal of V are not stored in A.  The
block reflector H is then given by

H = I - V * T * V**H

where V**H is the conjugate transpose of V.```

Definition at line 126 of file zgeqrt2.f.

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, LDT, M, N
134 * ..
135 * .. Array Arguments ..
136  COMPLEX*16 A( LDA, * ), T( LDT, * )
137 * ..
138 *
139 * =====================================================================
140 *
141 * .. Parameters ..
142  COMPLEX*16 ONE, ZERO
143  parameter( one = (1.0d+00,0.0d+00), zero = (0.0d+00,0.0d+00) )
144 * ..
145 * .. Local Scalars ..
146  INTEGER I, K
147  COMPLEX*16 AII, ALPHA
148 * ..
149 * .. External Subroutines ..
150  EXTERNAL zlarfg, zgemv, zgerc, ztrmv, xerbla
151 * ..
152 * .. Executable Statements ..
153 *
154 * Test the input arguments
155 *
156  info = 0
157  IF( n.LT.0 ) THEN
158  info = -2
159  ELSE IF( m.LT.n ) THEN
160  info = -1
161  ELSE IF( lda.LT.max( 1, m ) ) THEN
162  info = -4
163  ELSE IF( ldt.LT.max( 1, n ) ) THEN
164  info = -6
165  END IF
166  IF( info.NE.0 ) THEN
167  CALL xerbla( 'ZGEQRT2', -info )
168  RETURN
169  END IF
170 *
171  k = min( m, n )
172 *
173  DO i = 1, k
174 *
175 * Generate elem. refl. H(i) to annihilate A(i+1:m,i), tau(I) -> T(I,1)
176 *
177  CALL zlarfg( m-i+1, a( i, i ), a( min( i+1, m ), i ), 1,
178  \$ t( i, 1 ) )
179  IF( i.LT.n ) THEN
180 *
181 * Apply H(i) to A(I:M,I+1:N) from the left
182 *
183  aii = a( i, i )
184  a( i, i ) = one
185 *
186 * W(1:N-I) := A(I:M,I+1:N)^H * A(I:M,I) [W = T(:,N)]
187 *
188  CALL zgemv( 'C',m-i+1, n-i, one, a( i, i+1 ), lda,
189  \$ a( i, i ), 1, zero, t( 1, n ), 1 )
190 *
191 * A(I:M,I+1:N) = A(I:m,I+1:N) + alpha*A(I:M,I)*W(1:N-1)^H
192 *
193  alpha = -conjg(t( i, 1 ))
194  CALL zgerc( m-i+1, n-i, alpha, a( i, i ), 1,
195  \$ t( 1, n ), 1, a( i, i+1 ), lda )
196  a( i, i ) = aii
197  END IF
198  END DO
199 *
200  DO i = 2, n
201  aii = a( i, i )
202  a( i, i ) = one
203 *
204 * T(1:I-1,I) := alpha * A(I:M,1:I-1)**H * A(I:M,I)
205 *
206  alpha = -t( i, 1 )
207  CALL zgemv( 'C', m-i+1, i-1, alpha, a( i, 1 ), lda,
208  \$ a( i, i ), 1, zero, t( 1, i ), 1 )
209  a( i, i ) = aii
210 *
211 * T(1:I-1,I) := T(1:I-1,1:I-1) * T(1:I-1,I)
212 *
213  CALL ztrmv( 'U', 'N', 'N', i-1, t, ldt, t( 1, i ), 1 )
214 *
215 * T(I,I) = tau(I)
216 *
217  t( i, i ) = t( i, 1 )
218  t( i, 1) = zero
219  END DO
220
221 *
222 * End of ZGEQRT2
223 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
subroutine ztrmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
ZTRMV
Definition: ztrmv.f:147
subroutine zgerc(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)
ZGERC
Definition: zgerc.f:130
subroutine zgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
ZGEMV
Definition: zgemv.f:158
subroutine zlarfg(N, ALPHA, X, INCX, TAU)
ZLARFG generates an elementary reflector (Householder matrix).
Definition: zlarfg.f:106
Here is the call graph for this function:
Here is the caller graph for this function: