LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine cqlt02 ( integer  M,
integer  N,
integer  K,
complex, dimension( lda, * )  A,
complex, dimension( lda, * )  AF,
complex, dimension( lda, * )  Q,
complex, dimension( lda, * )  L,
integer  LDA,
complex, dimension( * )  TAU,
complex, dimension( lwork )  WORK,
integer  LWORK,
real, dimension( * )  RWORK,
real, dimension( * )  RESULT 
)

CQLT02

Purpose:
 CQLT02 tests CUNGQL, which generates an m-by-n matrix Q with
 orthonornmal columns that is defined as the product of k elementary
 reflectors.

 Given the QL factorization of an m-by-n matrix A, CQLT02 generates
 the orthogonal matrix Q defined by the factorization of the last k
 columns of A; it compares L(m-n+1:m,n-k+1:n) with
 Q(1:m,m-n+1:m)'*A(1:m,n-k+1:n), and checks that the columns 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.
          M >= N >= 0.
[in]K
          K is INTEGER
          The number of elementary reflectors whose product defines the
          matrix Q. N >= K >= 0.
[in]A
          A is COMPLEX array, dimension (LDA,N)
          The m-by-n matrix A which was factorized by CQLT01.
[in]AF
          AF is COMPLEX array, dimension (LDA,N)
          Details of the QL factorization of A, as returned by CGEQLF.
          See CGEQLF for further details.
[out]Q
          Q is COMPLEX array, dimension (LDA,N)
[out]L
          L is COMPLEX array, dimension (LDA,N)
[in]LDA
          LDA is INTEGER
          The leading dimension of the arrays A, AF, Q and L. LDA >= M.
[in]TAU
          TAU is COMPLEX array, dimension (N)
          The scalar factors of the elementary reflectors corresponding
          to the QL factorization in AF.
[out]WORK
          WORK is COMPLEX array, dimension (LWORK)
[in]LWORK
          LWORK is INTEGER
          The dimension of the array WORK.
[out]RWORK
          RWORK is REAL array, dimension (M)
[out]RESULT
          RESULT is REAL array, dimension (2)
          The test ratios:
          RESULT(1) = norm( L - Q'*A ) / ( M * norm(A) * EPS )
          RESULT(2) = norm( I - Q'*Q ) / ( M * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 138 of file cqlt02.f.

138 *
139 * -- LAPACK test routine (version 3.4.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 * November 2011
143 *
144 * .. Scalar Arguments ..
145  INTEGER k, lda, lwork, m, n
146 * ..
147 * .. Array Arguments ..
148  REAL result( * ), rwork( * )
149  COMPLEX a( lda, * ), af( lda, * ), l( lda, * ),
150  $ q( lda, * ), tau( * ), work( lwork )
151 * ..
152 *
153 * =====================================================================
154 *
155 * .. Parameters ..
156  REAL zero, one
157  parameter ( zero = 0.0e+0, one = 1.0e+0 )
158  COMPLEX rogue
159  parameter ( rogue = ( -1.0e+10, -1.0e+10 ) )
160 * ..
161 * .. Local Scalars ..
162  INTEGER info
163  REAL anorm, eps, resid
164 * ..
165 * .. External Functions ..
166  REAL clange, clansy, slamch
167  EXTERNAL clange, clansy, slamch
168 * ..
169 * .. External Subroutines ..
170  EXTERNAL cgemm, cherk, clacpy, claset, cungql
171 * ..
172 * .. Intrinsic Functions ..
173  INTRINSIC cmplx, max, real
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 = slamch( 'Epsilon' )
192 *
193 * Copy the last k columns of the factorization to the array Q
194 *
195  CALL claset( 'Full', m, n, rogue, rogue, q, lda )
196  IF( k.LT.m )
197  $ CALL clacpy( 'Full', m-k, k, af( 1, n-k+1 ), lda,
198  $ q( 1, n-k+1 ), lda )
199  IF( k.GT.1 )
200  $ CALL clacpy( 'Upper', k-1, k-1, af( m-k+1, n-k+2 ), lda,
201  $ q( m-k+1, n-k+2 ), lda )
202 *
203 * Generate the last n columns of the matrix Q
204 *
205  srnamt = 'CUNGQL'
206  CALL cungql( m, n, k, q, lda, tau( n-k+1 ), work, lwork, info )
207 *
208 * Copy L(m-n+1:m,n-k+1:n)
209 *
210  CALL claset( 'Full', n, k, cmplx( zero ), cmplx( zero ),
211  $ l( m-n+1, n-k+1 ), lda )
212  CALL clacpy( 'Lower', k, k, af( m-k+1, n-k+1 ), lda,
213  $ l( m-k+1, n-k+1 ), lda )
214 *
215 * Compute L(m-n+1:m,n-k+1:n) - Q(1:m,m-n+1:m)' * A(1:m,n-k+1:n)
216 *
217  CALL cgemm( 'Conjugate transpose', 'No transpose', n, k, m,
218  $ cmplx( -one ), q, lda, a( 1, n-k+1 ), lda,
219  $ cmplx( one ), l( m-n+1, n-k+1 ), lda )
220 *
221 * Compute norm( L - Q'*A ) / ( M * norm(A) * EPS ) .
222 *
223  anorm = clange( '1', m, k, a( 1, n-k+1 ), lda, rwork )
224  resid = clange( '1', n, k, l( m-n+1, n-k+1 ), lda, rwork )
225  IF( anorm.GT.zero ) THEN
226  result( 1 ) = ( ( resid / REAL( MAX( 1, M ) ) ) / anorm ) / eps
227  ELSE
228  result( 1 ) = zero
229  END IF
230 *
231 * Compute I - Q'*Q
232 *
233  CALL claset( 'Full', n, n, cmplx( zero ), cmplx( one ), l, lda )
234  CALL cherk( 'Upper', 'Conjugate transpose', n, m, -one, q, lda,
235  $ one, l, lda )
236 *
237 * Compute norm( I - Q'*Q ) / ( M * EPS ) .
238 *
239  resid = clansy( '1', 'Upper', n, l, lda, rwork )
240 *
241  result( 2 ) = ( resid / REAL( MAX( 1, M ) ) ) / eps
242 *
243  RETURN
244 *
245 * End of CQLT02
246 *
subroutine cherk(UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC)
CHERK
Definition: cherk.f:175
real function clange(NORM, M, N, A, LDA, WORK)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: clange.f:117
subroutine claset(UPLO, M, N, ALPHA, BETA, A, LDA)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: claset.f:108
real function clansy(NORM, UPLO, N, A, LDA, WORK)
CLANSY 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: clansy.f:125
subroutine clacpy(UPLO, M, N, A, LDA, B, LDB)
CLACPY copies all or part of one two-dimensional array to another.
Definition: clacpy.f:105
subroutine cungql(M, N, K, A, LDA, TAU, WORK, LWORK, INFO)
CUNGQL
Definition: cungql.f:130
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine cgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CGEMM
Definition: cgemm.f:189

Here is the call graph for this function:

Here is the caller graph for this function: