157
158
159
160
161
162
163 LOGICAL TSTERR
164 INTEGER NMAX, NN, NOUT, NRHS
165 REAL THRESH
166
167
168 LOGICAL DOTYPE( * )
169 INTEGER IWORK( * ), NVAL( * )
170 REAL RWORK( * )
171 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ), E( * ),
172 $ WORK( * ), X( * ), XACT( * )
173
174
175
176
177
178 REAL ONE, ZERO
179 parameter( one = 1.0e+0, zero = 0.0e+0 )
180 INTEGER NTYPES, NTESTS
181 parameter( ntypes = 11, ntests = 3 )
182 INTEGER NFACT
183 parameter( nfact = 2 )
184
185
186 LOGICAL ZEROT
187 CHARACTER DIST, FACT, TYPE, UPLO, XTYPE
188 CHARACTER*3 MATPATH, PATH
189 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
190 $ IZERO, J, K, KL, KU, LDA, LWORK, MODE, N,
191 $ NB, NBMIN, NERRS, NFAIL, NIMAT, NRUN, NT
192 REAL AINVNM, ANORM, CNDNUM, RCONDC
193
194
195 CHARACTER FACTS( NFACT ), UPLOS( 2 )
196 INTEGER ISEED( 4 ), ISEEDY( 4 )
197 REAL RESULT( NTESTS )
198
199
200
201 REAL CLANSY
203
204
208
209
210 LOGICAL LERR, OK
211 CHARACTER*32 SRNAMT
212 INTEGER INFOT, NUNIT
213
214
215 COMMON / infoc / infot, nunit, ok, lerr
216 COMMON / srnamc / srnamt
217
218
219 INTRINSIC max, min
220
221
222 DATA iseedy / 1988, 1989, 1990, 1991 /
223 DATA uplos / 'U', 'L' / , facts / 'F', 'N' /
224
225
226
227
228
229
230
231 path( 1: 1 ) = 'Complex precision'
232 path( 2: 3 ) = 'SK'
233
234
235
236 matpath( 1: 1 ) = 'Complex precision'
237 matpath( 2: 3 ) = 'SY'
238
239 nrun = 0
240 nfail = 0
241 nerrs = 0
242 DO 10 i = 1, 4
243 iseed( i ) = iseedy( i )
244 10 CONTINUE
245 lwork = max( 2*nmax, nmax*nrhs )
246
247
248
249 IF( tsterr )
250 $
CALL cerrvx( path, nout )
251 infot = 0
252
253
254
255
256 nb = 1
257 nbmin = 2
260
261
262
263 DO 180 in = 1, nn
264 n = nval( in )
265 lda = max( n, 1 )
266 xtype = 'N'
267 nimat = ntypes
268 IF( n.LE.0 )
269 $ nimat = 1
270
271 DO 170 imat = 1, nimat
272
273
274
275 IF( .NOT.dotype( imat ) )
276 $ GO TO 170
277
278
279
280 zerot = imat.GE.3 .AND. imat.LE.6
281 IF( zerot .AND. n.LT.imat-2 )
282 $ GO TO 170
283
284
285
286 DO 160 iuplo = 1, 2
287 uplo = uplos( iuplo )
288
289 IF( imat.NE.ntypes ) THEN
290
291
292
293
294
295
296 CALL clatb4( matpath, imat, n, n,
TYPE, KL, KU, ANORM,
297 $ MODE, CNDNUM, DIST )
298
299
300
301 srnamt = 'CLATMS'
302 CALL clatms( n, n, dist, iseed,
TYPE, RWORK, MODE,
303 $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA,
304 $ WORK, INFO )
305
306
307
308 IF( info.NE.0 ) THEN
309 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n,
310 $ -1, -1, -1, imat, nfail, nerrs, nout )
311 GO TO 160
312 END IF
313
314
315
316
317 IF( zerot ) THEN
318 IF( imat.EQ.3 ) THEN
319 izero = 1
320 ELSE IF( imat.EQ.4 ) THEN
321 izero = n
322 ELSE
323 izero = n / 2 + 1
324 END IF
325
326 IF( imat.LT.6 ) THEN
327
328
329
330 IF( iuplo.EQ.1 ) THEN
331 ioff = ( izero-1 )*lda
332 DO 20 i = 1, izero - 1
333 a( ioff+i ) = zero
334 20 CONTINUE
335 ioff = ioff + izero
336 DO 30 i = izero, n
337 a( ioff ) = zero
338 ioff = ioff + lda
339 30 CONTINUE
340 ELSE
341 ioff = izero
342 DO 40 i = 1, izero - 1
343 a( ioff ) = zero
344 ioff = ioff + lda
345 40 CONTINUE
346 ioff = ioff - izero
347 DO 50 i = izero, n
348 a( ioff+i ) = zero
349 50 CONTINUE
350 END IF
351 ELSE
352 IF( iuplo.EQ.1 ) THEN
353
354
355
356 ioff = 0
357 DO 70 j = 1, n
358 i2 = min( j, izero )
359 DO 60 i = 1, i2
360 a( ioff+i ) = zero
361 60 CONTINUE
362 ioff = ioff + lda
363 70 CONTINUE
364 ELSE
365
366
367
368 ioff = 0
369 DO 90 j = 1, n
370 i1 = max( j, izero )
371 DO 80 i = i1, n
372 a( ioff+i ) = zero
373 80 CONTINUE
374 ioff = ioff + lda
375 90 CONTINUE
376 END IF
377 END IF
378 ELSE
379 izero = 0
380 END IF
381
382
383
384 ELSE
385
386
387
388
389 CALL clatsy( uplo, n, a, lda, iseed )
390 END IF
391
392 DO 150 ifact = 1, nfact
393
394
395
396 fact = facts( ifact )
397
398
399
400 IF( zerot ) THEN
401 IF( ifact.EQ.1 )
402 $ GO TO 150
403 rcondc = zero
404
405 ELSE IF( ifact.EQ.1 ) THEN
406
407
408
409 anorm =
clansy(
'1', uplo, n, a, lda, rwork )
410
411
412
413
414 CALL clacpy( uplo, n, n, a, lda, afac, lda )
415 CALL csytrf_rk( uplo, n, afac, lda, e, iwork, work,
416 $ lwork, info )
417
418
419
420 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
421 lwork = (n+nb+1)*(nb+3)
422
423
424
425
426 CALL csytri_3( uplo, n, ainv, lda, e, iwork,
427 $ work, lwork, info )
428 ainvnm =
clansy(
'1', uplo, n, ainv, lda, rwork )
429
430
431
432 IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
433 rcondc = one
434 ELSE
435 rcondc = ( one / anorm ) / ainvnm
436 END IF
437 END IF
438
439
440
441 srnamt = 'CLARHS'
442 CALL clarhs( matpath, xtype, uplo,
' ', n, n, kl, ku,
443 $ nrhs, a, lda, xact, lda, b, lda, iseed,
444 $ info )
445 xtype = 'C'
446
447
448
449 IF( ifact.EQ.2 ) THEN
450 CALL clacpy( uplo, n, n, a, lda, afac, lda )
451 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
452
453
454
455
456 srnamt = 'CSYSV_RK'
457 CALL csysv_rk( uplo, n, nrhs, afac, lda, e, iwork,
458 $ x, lda, work, lwork, info )
459
460
461
462
463 k = izero
464 IF( k.GT.0 ) THEN
465 100 CONTINUE
466 IF( iwork( k ).LT.0 ) THEN
467 IF( iwork( k ).NE.-k ) THEN
468 k = -iwork( k )
469 GO TO 100
470 END IF
471 ELSE IF( iwork( k ).NE.k ) THEN
472 k = iwork( k )
473 GO TO 100
474 END IF
475 END IF
476
477
478
479 IF( info.NE.k ) THEN
480 CALL alaerh( path,
'CSYSV_RK', info, k, uplo,
481 $ n, n, -1, -1, nrhs, imat, nfail,
482 $ nerrs, nout )
483 GO TO 120
484 ELSE IF( info.NE.0 ) THEN
485 GO TO 120
486 END IF
487
488
489
490
491 CALL csyt01_3( uplo, n, a, lda, afac, lda, e,
492 $ iwork, ainv, lda, rwork,
493 $ result( 1 ) )
494
495
496
497 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
498 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
499 $ lda, rwork, result( 2 ) )
500
501
502
503
504 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
505 $ result( 3 ) )
506 nt = 3
507
508
509
510
511 DO 110 k = 1, nt
512 IF( result( k ).GE.thresh ) THEN
513 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
514 $
CALL aladhd( nout, path )
515 WRITE( nout, fmt = 9999 )'CSYSV_RK', uplo,
516 $ n, imat, k, result( k )
517 nfail = nfail + 1
518 END IF
519 110 CONTINUE
520 nrun = nrun + nt
521 120 CONTINUE
522 END IF
523
524 150 CONTINUE
525
526 160 CONTINUE
527 170 CONTINUE
528 180 CONTINUE
529
530
531
532 CALL alasvm( path, nout, nfail, nrun, nerrs )
533
534 9999 FORMAT( 1x, a, ', UPLO=''', a1, ''', N =', i5, ', type ', i2,
535 $ ', test ', i2, ', ratio =', g12.5 )
536 RETURN
537
538
539
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 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 clatsy(uplo, n, x, ldx, iseed)
CLATSY
subroutine csyt01_3(uplo, n, a, lda, afac, ldafac, e, ipiv, c, ldc, rwork, resid)
CSYT01_3
subroutine csyt02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CSYT02
subroutine csysv_rk(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, work, lwork, info)
CSYSV_RK computes the solution to system of linear equations A * X = B for SY matrices
subroutine csytrf_rk(uplo, n, a, lda, e, ipiv, work, lwork, info)
CSYTRF_RK computes the factorization of a complex symmetric indefinite matrix using the bounded Bunch...
subroutine csytri_3(uplo, n, a, lda, e, ipiv, work, lwork, info)
CSYTRI_3
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
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,...