114
115
116
117
118
119
120 INTEGER LDA, LDC, NN, NOUT
121 DOUBLE PRECISION THRESH
122
123
124 INTEGER NVAL( NN )
125 DOUBLE PRECISION D_WORK_ZLANGE( * )
126 COMPLEX*16 A( LDA, * ), C1( LDC, * ), C2( LDC, *),
127 + CRF( * )
128
129
130
131
132
133 DOUBLE PRECISION ZERO, ONE
134 parameter( zero = 0.0d+0, one = 1.0d+0 )
135 INTEGER NTESTS
136 parameter( ntests = 1 )
137
138
139 CHARACTER UPLO, CFORM, TRANS
140 INTEGER I, IFORM, IIK, IIN, INFO, IUPLO, J, K, N,
141 + NFAIL, NRUN, IALPHA, ITRANS
142 DOUBLE PRECISION ALPHA, BETA, EPS, NORMA, NORMC
143
144
145 CHARACTER UPLOS( 2 ), FORMS( 2 ), TRANSS( 2 )
146 INTEGER ISEED( 4 ), ISEEDY( 4 )
147 DOUBLE PRECISION RESULT( NTESTS )
148
149
150 DOUBLE PRECISION DLAMCH, DLARND, ZLANGE
151 COMPLEX*16 ZLARND
153
154
156
157
158 INTRINSIC dabs, max
159
160
161 CHARACTER*32 SRNAMT
162
163
164 COMMON / srnamc / srnamt
165
166
167 DATA iseedy / 1988, 1989, 1990, 1991 /
168 DATA uplos / 'U', 'L' /
169 DATA forms / 'N', 'C' /
170 DATA transs / 'N', 'C' /
171
172
173
174
175
176 nrun = 0
177 nfail = 0
178 info = 0
179 DO 10 i = 1, 4
180 iseed( i ) = iseedy( i )
181 10 CONTINUE
182 eps =
dlamch(
'Precision' )
183
184 DO 150 iin = 1, nn
185
186 n = nval( iin )
187
188 DO 140 iik = 1, nn
189
190 k = nval( iin )
191
192 DO 130 iform = 1, 2
193
194 cform = forms( iform )
195
196 DO 120 iuplo = 1, 2
197
198 uplo = uplos( iuplo )
199
200 DO 110 itrans = 1, 2
201
202 trans = transs( itrans )
203
204 DO 100 ialpha = 1, 4
205
206 IF ( ialpha.EQ. 1) THEN
207 alpha = zero
208 beta = zero
209 ELSE IF ( ialpha.EQ. 2) THEN
210 alpha = one
211 beta = zero
212 ELSE IF ( ialpha.EQ. 3) THEN
213 alpha = zero
214 beta = one
215 ELSE
216 alpha =
dlarnd( 2, iseed )
218 END IF
219
220
221
222
223
224
225 nrun = nrun + 1
226
227 IF ( itrans.EQ.1 ) THEN
228
229
230
231 DO j = 1, k
232 DO i = 1, n
233 a( i, j) =
zlarnd( 4, iseed )
234 END DO
235 END DO
236
237 norma =
zlange(
'I', n, k, a, lda,
238 + d_work_zlange )
239
240 ELSE
241
242
243
244 DO j = 1,n
245 DO i = 1, k
246 a( i, j) =
zlarnd( 4, iseed )
247 END DO
248 END DO
249
250 norma =
zlange(
'I', k, n, a, lda,
251 + d_work_zlange )
252
253 END IF
254
255
256
257
258
259
260
261 DO j = 1, n
262 DO i = 1, n
263 c1( i, j) =
zlarnd( 4, iseed )
264 c2(i,j) = c1(i,j)
265 END DO
266 END DO
267
268
269
270
271 normc =
zlange(
'I', n, n, c1, ldc,
272 + d_work_zlange )
273
274 srnamt = 'ZTRTTF'
275 CALL ztrttf( cform, uplo, n, c1, ldc, crf,
276 + info )
277
278
279
280 srnamt = 'ZHERK '
281 CALL zherk( uplo, trans, n, k, alpha, a, lda,
282 + beta, c1, ldc )
283
284
285
286 srnamt = 'ZHFRK '
287 CALL zhfrk( cform, uplo, trans, n, k, alpha, a,
288 + lda, beta, crf )
289
290
291
292 srnamt = 'ZTFTTR'
293 CALL ztfttr( cform, uplo, n, crf, c2, ldc,
294 + info )
295
296
297
298 DO j = 1, n
299 DO i = 1, n
300 c1(i,j) = c1(i,j)-c2(i,j)
301 END DO
302 END DO
303
304
305
306
307
308
309 result(1) =
zlange(
'I', n, n, c1, ldc,
310 + d_work_zlange )
311 result(1) = result(1)
312 + / max( dabs( alpha ) * norma * norma
313 + + dabs( beta ) * normc, one )
314 + / max( n , 1 ) / eps
315
316 IF( result(1).GE.thresh ) THEN
317 IF( nfail.EQ.0 ) THEN
318 WRITE( nout, * )
319 WRITE( nout, fmt = 9999 )
320 END IF
321 WRITE( nout, fmt = 9997 ) 'ZHFRK',
322 + cform, uplo, trans, n, k, result(1)
323 nfail = nfail + 1
324 END IF
325
326 100 CONTINUE
327 110 CONTINUE
328 120 CONTINUE
329 130 CONTINUE
330 140 CONTINUE
331 150 CONTINUE
332
333
334
335 IF ( nfail.EQ.0 ) THEN
336 WRITE( nout, fmt = 9996 ) 'ZHFRK', nrun
337 ELSE
338 WRITE( nout, fmt = 9995 ) 'ZHFRK', nfail, nrun
339 END IF
340
341 9999 FORMAT( 1x, ' *** Error(s) or Failure(s) while testing ZHFRK
342 + ***')
343 9997 FORMAT( 1x, ' Failure in ',a5,', CFORM=''',a1,''',',
344 + ' UPLO=''',a1,''',',' TRANS=''',a1,''',', ' N=',i3,', K =', i3,
345 + ', test=',g12.5)
346 9996 FORMAT( 1x, 'All tests for ',a5,' auxiliary routine passed the ',
347 + 'threshold ( ',i6,' tests run)')
348 9995 FORMAT( 1x, a6, ' auxiliary routine: ',i6,' out of ',i6,
349 + ' tests failed to pass the threshold')
350
351 RETURN
352
353
354
double precision function dlarnd(idist, iseed)
DLARND
subroutine zherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
ZHERK
subroutine zhfrk(transr, uplo, trans, n, k, alpha, a, lda, beta, c)
ZHFRK performs a Hermitian rank-k operation for matrix in RFP format.
double precision function dlamch(cmach)
DLAMCH
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 ...
subroutine ztfttr(transr, uplo, n, arf, a, lda, info)
ZTFTTR copies a triangular matrix from the rectangular full packed format (TF) to the standard full f...
subroutine ztrttf(transr, uplo, n, a, lda, arf, info)
ZTRTTF copies a triangular matrix from the standard full format (TR) to the rectangular full packed f...
complex *16 function zlarnd(idist, iseed)
ZLARND