LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ zrqt02()

 subroutine zrqt02 ( integer M, integer N, integer K, complex*16, dimension( lda, * ) A, complex*16, dimension( lda, * ) AF, complex*16, dimension( lda, * ) Q, complex*16, dimension( lda, * ) R, integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( lwork ) WORK, integer LWORK, double precision, dimension( * ) RWORK, double precision, dimension( * ) RESULT )

ZRQT02

Purpose:
``` ZRQT02 tests ZUNGRQ, which generates an m-by-n matrix Q with
orthonornmal rows that is defined as the product of k elementary
reflectors.

Given the RQ factorization of an m-by-n matrix A, ZRQT02 generates
the orthogonal matrix Q defined by the factorization of the last k
rows of A; it compares R(m-k+1:m,n-m+1:n) with
A(m-k+1:m,1:n)*Q(n-m+1:n,1:n)', and checks that the rows of Q are
orthonormal.```
Parameters
 [in] M ``` M is INTEGER The number of rows of the matrix Q to be generated. M >= 0.``` [in] N ``` N is INTEGER The number of columns of the matrix Q to be generated. N >= M >= 0.``` [in] K ``` K is INTEGER The number of elementary reflectors whose product defines the matrix Q. M >= K >= 0.``` [in] A ``` A is COMPLEX*16 array, dimension (LDA,N) The m-by-n matrix A which was factorized by ZRQT01.``` [in] AF ``` AF is COMPLEX*16 array, dimension (LDA,N) Details of the RQ factorization of A, as returned by ZGERQF. See ZGERQF for further details.``` [out] Q ` Q is COMPLEX*16 array, dimension (LDA,N)` [out] R ` R is COMPLEX*16 array, dimension (LDA,M)` [in] LDA ``` LDA is INTEGER The leading dimension of the arrays A, AF, Q and L. LDA >= N.``` [in] TAU ``` TAU is COMPLEX*16 array, dimension (M) The scalar factors of the elementary reflectors corresponding to the RQ factorization in AF.``` [out] WORK ` WORK is COMPLEX*16 array, dimension (LWORK)` [in] LWORK ``` LWORK is INTEGER The dimension of the array WORK.``` [out] RWORK ` RWORK is DOUBLE PRECISION array, dimension (M)` [out] RESULT ``` RESULT is DOUBLE PRECISION array, dimension (2) The test ratios: RESULT(1) = norm( R - A*Q' ) / ( N * norm(A) * EPS ) RESULT(2) = norm( I - Q*Q' ) / ( N * EPS )```
Date
December 2016

Definition at line 138 of file zrqt02.f.

138 *
139 * -- LAPACK test routine (version 3.7.0) --
140 * -- LAPACK is a software package provided by Univ. of Tennessee, --
141 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
142 * December 2016
143 *
144 * .. Scalar Arguments ..
145  INTEGER k, lda, lwork, m, n
146 * ..
147 * .. Array Arguments ..
148  DOUBLE PRECISION result( * ), rwork( * )
149  COMPLEX*16 a( lda, * ), af( lda, * ), q( lda, * ),
150  \$ r( lda, * ), tau( * ), work( lwork )
151 * ..
152 *
153 * =====================================================================
154 *
155 * .. Parameters ..
156  DOUBLE PRECISION zero, one
157  parameter( zero = 0.0d+0, one = 1.0d+0 )
158  COMPLEX*16 rogue
159  parameter( rogue = ( -1.0d+10, -1.0d+10 ) )
160 * ..
161 * .. Local Scalars ..
162  INTEGER info
163  DOUBLE PRECISION anorm, eps, resid
164 * ..
165 * .. External Functions ..
166  DOUBLE PRECISION dlamch, zlange, zlansy
167  EXTERNAL dlamch, zlange, zlansy
168 * ..
169 * .. External Subroutines ..
170  EXTERNAL zgemm, zherk, zlacpy, zlaset, zungrq
171 * ..
172 * .. Intrinsic Functions ..
173  INTRINSIC dble, dcmplx, max
174 * ..
175 * .. Scalars in Common ..
176  CHARACTER*32 srnamt
177 * ..
178 * .. Common blocks ..
179  COMMON / srnamc / srnamt
180 * ..
181 * .. Executable Statements ..
182 *
183 * Quick return if possible
184 *
185  IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 ) THEN
186  result( 1 ) = zero
187  result( 2 ) = zero
188  RETURN
189  END IF
190 *
191  eps = dlamch( 'Epsilon' )
192 *
193 * Copy the last k rows of the factorization to the array Q
194 *
195  CALL zlaset( 'Full', m, n, rogue, rogue, q, lda )
196  IF( k.LT.n )
197  \$ CALL zlacpy( 'Full', k, n-k, af( m-k+1, 1 ), lda,
198  \$ q( m-k+1, 1 ), lda )
199  IF( k.GT.1 )
200  \$ CALL zlacpy( 'Lower', k-1, k-1, af( m-k+2, n-k+1 ), lda,
201  \$ q( m-k+2, n-k+1 ), lda )
202 *
203 * Generate the last n rows of the matrix Q
204 *
205  srnamt = 'ZUNGRQ'
206  CALL zungrq( m, n, k, q, lda, tau( m-k+1 ), work, lwork, info )
207 *
208 * Copy R(m-k+1:m,n-m+1:n)
209 *
210  CALL zlaset( 'Full', k, m, dcmplx( zero ), dcmplx( zero ),
211  \$ r( m-k+1, n-m+1 ), lda )
212  CALL zlacpy( 'Upper', k, k, af( m-k+1, n-k+1 ), lda,
213  \$ r( m-k+1, n-k+1 ), lda )
214 *
215 * Compute R(m-k+1:m,n-m+1:n) - A(m-k+1:m,1:n) * Q(n-m+1:n,1:n)'
216 *
217  CALL zgemm( 'No transpose', 'Conjugate transpose', k, m, n,
218  \$ dcmplx( -one ), a( m-k+1, 1 ), lda, q, lda,
219  \$ dcmplx( one ), r( m-k+1, n-m+1 ), lda )
220 *
221 * Compute norm( R - A*Q' ) / ( N * norm(A) * EPS ) .
222 *
223  anorm = zlange( '1', k, n, a( m-k+1, 1 ), lda, rwork )
224  resid = zlange( '1', k, m, r( m-k+1, n-m+1 ), lda, rwork )
225  IF( anorm.GT.zero ) THEN
226  result( 1 ) = ( ( resid / dble( max( 1, n ) ) ) / anorm ) / eps
227  ELSE
228  result( 1 ) = zero
229  END IF
230 *
231 * Compute I - Q*Q'
232 *
233  CALL zlaset( 'Full', m, m, dcmplx( zero ), dcmplx( one ), r, lda )
234  CALL zherk( 'Upper', 'No transpose', m, n, -one, q, lda, one, r,
235  \$ lda )
236 *
237 * Compute norm( I - Q*Q' ) / ( N * EPS ) .
238 *
239  resid = zlansy( '1', 'Upper', m, r, lda, rwork )
240 *
241  result( 2 ) = ( resid / dble( max( 1, n ) ) ) / eps
242 *
243  RETURN
244 *
245 * End of ZRQT02
246 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zungrq(M, N, K, A, LDA, TAU, WORK, LWORK, INFO)
ZUNGRQ
Definition: zungrq.f:130
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
Definition: zlacpy.f:105
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
Definition: zgemm.f:189
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlange.f:117
double precision function zlansy(NORM, UPLO, N, A, LDA, WORK)
ZLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex symmetric matrix.
Definition: zlansy.f:125
subroutine zlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: zlaset.f:108
subroutine zherk(UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC)
ZHERK
Definition: zherk.f:175
Here is the call graph for this function:
Here is the caller graph for this function: