153
154
155
156
157
158
159 LOGICAL TSTERR
160 INTEGER NMAX, NN, NOUT, NRHS
161 REAL THRESH
162
163
164 LOGICAL DOTYPE( * )
165 INTEGER IWORK( * ), NVAL( * )
166 REAL RWORK( * )
167 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
168 $ WORK( * ), X( * ), XACT( * )
169
170
171
172
173
174 REAL ONE, ZERO
175 parameter( one = 1.0e+0, zero = 0.0e+0 )
176 INTEGER NTYPES, NTESTS
177 parameter( ntypes = 10, ntests = 3 )
178 INTEGER NFACT
179 parameter( nfact = 2 )
180
181
182 LOGICAL ZEROT
183 CHARACTER DIST, FACT, TYPE, UPLO, XTYPE
184 CHARACTER*3 MATPATH, PATH
185 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
186 $ IZERO, J, K, KL, KU, LDA, LWORK, MODE, N,
187 $ NB, NBMIN, NERRS, NFAIL, NIMAT, NRUN, NT
188 REAL ANORM, CNDNUM
189
190
191 CHARACTER FACTS( NFACT ), UPLOS( 2 )
192 INTEGER ISEED( 4 ), ISEEDY( 4 )
193 REAL RESULT( NTESTS )
194
195
196 REAL CLANHE, SGET06
198
199
204
205
206 LOGICAL LERR, OK
207 CHARACTER*32 SRNAMT
208 INTEGER INFOT, NUNIT
209
210
211 COMMON / infoc / infot, nunit, ok, lerr
212 COMMON / srnamc / srnamt
213
214
215 INTRINSIC cmplx, max, min
216
217
218 DATA iseedy / 1988, 1989, 1990, 1991 /
219 DATA uplos / 'U', 'L' / , facts / 'F', 'N' /
220
221
222
223
224
225
226
227 path( 1: 1 ) = 'Complex precision'
228 path( 2: 3 ) = 'HA'
229
230
231
232 matpath( 1: 1 ) = 'Complex precision'
233 matpath( 2: 3 ) = 'HE'
234
235 nrun = 0
236 nfail = 0
237 nerrs = 0
238 DO 10 i = 1, 4
239 iseed( i ) = iseedy( i )
240 10 CONTINUE
241
242
243
244 IF( tsterr )
245 $
CALL cerrvx( path, nout )
246 infot = 0
247
248
249
250 nb = 1
251 nbmin = 2
254
255
256
257 DO 180 in = 1, nn
258 n = nval( in )
259 lwork = max( 3*n-2, n*(1+nb) )
260 lwork = max( lwork, 1 )
261 lda = max( n, 1 )
262 xtype = 'N'
263 nimat = ntypes
264 IF( n.LE.0 )
265 $ nimat = 1
266
267 DO 170 imat = 1, nimat
268
269
270
271 IF( .NOT.dotype( imat ) )
272 $ GO TO 170
273
274
275
276 zerot = imat.GE.3 .AND. imat.LE.6
277 IF( zerot .AND. n.LT.imat-2 )
278 $ GO TO 170
279
280
281
282 DO 160 iuplo = 1, 2
283 uplo = uplos( iuplo )
284
285
286
287
288
289
290 CALL clatb4( matpath, imat, n, n,
TYPE, KL, KU, ANORM,
291 $ MODE, CNDNUM, DIST )
292
293
294
295 srnamt = 'CLATMS'
296 CALL clatms( n, n, dist, iseed,
TYPE, RWORK, MODE,
297 $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA,
298 $ WORK, INFO )
299
300
301
302 IF( info.NE.0 ) THEN
303 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n,
304 $ -1, -1, -1, imat, nfail, nerrs, nout )
305 GO TO 160
306 END IF
307
308
309
310
311 IF( zerot ) THEN
312 IF( imat.EQ.3 ) THEN
313 izero = 1
314 ELSE IF( imat.EQ.4 ) THEN
315 izero = n
316 ELSE
317 izero = n / 2 + 1
318 END IF
319
320 IF( imat.LT.6 ) THEN
321
322
323
324 IF( iuplo.EQ.1 ) THEN
325 ioff = ( izero-1 )*lda
326 DO 20 i = 1, izero - 1
327 a( ioff+i ) = zero
328 20 CONTINUE
329 ioff = ioff + izero
330 DO 30 i = izero, n
331 a( ioff ) = zero
332 ioff = ioff + lda
333 30 CONTINUE
334 ELSE
335 ioff = izero
336 DO 40 i = 1, izero - 1
337 a( ioff ) = zero
338 ioff = ioff + lda
339 40 CONTINUE
340 ioff = ioff - izero
341 DO 50 i = izero, n
342 a( ioff+i ) = zero
343 50 CONTINUE
344 END IF
345 ELSE
346 ioff = 0
347 IF( iuplo.EQ.1 ) THEN
348
349
350
351 DO 70 j = 1, n
352 i2 = min( j, izero )
353 DO 60 i = 1, i2
354 a( ioff+i ) = zero
355 60 CONTINUE
356 ioff = ioff + lda
357 70 CONTINUE
358 izero = 1
359 ELSE
360
361
362
363 ioff = 0
364 DO 90 j = 1, n
365 i1 = max( j, izero )
366 DO 80 i = i1, n
367 a( ioff+i ) = zero
368 80 CONTINUE
369 ioff = ioff + lda
370 90 CONTINUE
371 END IF
372 END IF
373 ELSE
374 izero = 0
375 END IF
376
377
378
379
380 DO 150 ifact = 1, nfact
381
382
383
384 fact = facts( ifact )
385
386
387
388 srnamt = 'CLARHS'
389 CALL clarhs( matpath, xtype, uplo,
' ', n, n, kl, ku,
390 $ nrhs, a, lda, xact, lda, b, lda, iseed,
391 $ info )
392 xtype = 'C'
393
394
395
396 IF( ifact.EQ.2 ) THEN
397 CALL clacpy( uplo, n, n, a, lda, afac, lda )
398 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
399
400
401
402 srnamt = 'CHESV_AA '
403 CALL chesv_aa( uplo, n, nrhs, afac, lda, iwork,
404 $ x, lda, work, lwork, info )
405
406
407
408
409 IF( izero.GT.0 ) THEN
410 j = 1
411 k = izero
412 100 CONTINUE
413 IF( j.EQ.k ) THEN
414 k = iwork( j )
415 ELSE IF( iwork( j ).EQ.k ) THEN
416 k = j
417 END IF
418 IF( j.LT.k ) THEN
419 j = j + 1
420 GO TO 100
421 END IF
422 ELSE
423 k = 0
424 END IF
425
426
427
428 IF( info.NE.k ) THEN
429 CALL alaerh( path,
'CHESV_AA', info, k,
430 $ uplo, n, n, -1, -1, nrhs,
431 $ imat, nfail, nerrs, nout )
432 GO TO 120
433 ELSE IF( info.NE.0 ) THEN
434 GO TO 120
435 END IF
436
437
438
439
440 CALL chet01_aa( uplo, n, a, lda, afac, lda,
441 $ iwork, ainv, lda, rwork,
442 $ result( 1 ) )
443
444
445
446 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
447 CALL cpot02( uplo, n, nrhs, a, lda, x, lda, work,
448 $ lda, rwork, result( 2 ) )
449 nt = 2
450
451
452
453
454 DO 110 k = 1, nt
455 IF( result( k ).GE.thresh ) THEN
456 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
457 $
CALL aladhd( nout, path )
458 WRITE( nout, fmt = 9999 )'CHESV_AA ',
459 $ uplo, n, imat, k, result( k )
460 nfail = nfail + 1
461 END IF
462 110 CONTINUE
463 nrun = nrun + nt
464 120 CONTINUE
465 END IF
466
467 150 CONTINUE
468
469 160 CONTINUE
470 170 CONTINUE
471 180 CONTINUE
472
473
474
475 CALL alasvm( path, nout, nfail, nrun, nerrs )
476
477 9999 FORMAT( 1x, a, ', UPLO=''', a1, ''', N =', i5, ', type ', i2,
478 $ ', test ', i2, ', ratio =', g12.5 )
479 RETURN
480
481
482
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
subroutine clarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
CLARHS
subroutine xlaenv(ispec, nvalue)
XLAENV
subroutine aladhd(iounit, path)
ALADHD
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine cerrvx(path, nunit)
CERRVX
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
subroutine chet01_aa(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
CHET01_AA
subroutine clatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
CLATB4
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
subroutine cpot02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CPOT02
subroutine chesv_aa(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
CHESV_AA computes the solution to system of linear equations A * X = B for HE matrices
subroutine chetrf_aa(uplo, n, a, lda, ipiv, work, lwork, info)
CHETRF_AA
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
real function clanhe(norm, uplo, n, a, lda, work)
CLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
real function sget06(rcond, rcondc)
SGET06