152
153
154
155
156
157
158 LOGICAL TSTERR
159 INTEGER NMAX, NN, NOUT, NRHS
160 DOUBLE PRECISION THRESH
161
162
163 LOGICAL DOTYPE( * )
164 INTEGER IWORK( * ), NVAL( * )
165 DOUBLE PRECISION A( * ), AFAC( * ), AINV( * ), B( * ),
166 $ RWORK( * ), WORK( * ), X( * ), XACT( * )
167
168
169
170
171
172 DOUBLE PRECISION ONE, ZERO
173 parameter( one = 1.0d+0, zero = 0.0d+0 )
174 INTEGER NTYPES, NTESTS
175 parameter( ntypes = 10, ntests = 3 )
176 INTEGER NFACT
177 parameter( nfact = 2 )
178
179
180 LOGICAL ZEROT
181 CHARACTER DIST, FACT, TYPE, UPLO, XTYPE
182 CHARACTER*3 PATH, MATPATH
183 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
184 $ IZERO, J, K, KL, KU, LDA, LWORK, MODE, N,
185 $ NB, NBMIN, NERRS, NFAIL, NIMAT, NRUN, NT
186 DOUBLE PRECISION AINVNM, ANORM, CNDNUM, RCONDC
187
188
189 CHARACTER FACTS( NFACT ), UPLOS( 2 )
190 INTEGER ISEED( 4 ), ISEEDY( 4 )
191 DOUBLE PRECISION RESULT( NTESTS )
192
193
194 DOUBLE PRECISION DLANSY
196
197
203
204
205 LOGICAL LERR, OK
206 CHARACTER*32 SRNAMT
207 INTEGER INFOT, NUNIT
208
209
210 COMMON / infoc / infot, nunit, ok, lerr
211 COMMON / srnamc / srnamt
212
213
214 INTRINSIC max, min
215
216
217 DATA iseedy / 1988, 1989, 1990, 1991 /
218 DATA uplos / 'U', 'L' / , facts / 'F', 'N' /
219
220
221
222
223
224
225
226 path( 1: 1 ) = 'Double precision'
227 path( 2: 3 ) = 'SR'
228
229
230
231 matpath( 1: 1 ) = 'Double precision'
232 matpath( 2: 3 ) = 'SY'
233
234 nrun = 0
235 nfail = 0
236 nerrs = 0
237 DO 10 i = 1, 4
238 iseed( i ) = iseedy( i )
239 10 CONTINUE
240 lwork = max( 2*nmax, nmax*nrhs )
241
242
243
244 IF( tsterr )
245 $
CALL derrvx( path, nout )
246 infot = 0
247
248
249
250
251 nb = 1
252 nbmin = 2
255
256
257
258 DO 180 in = 1, nn
259 n = nval( in )
260 lda = max( n, 1 )
261 xtype = 'N'
262 nimat = ntypes
263 IF( n.LE.0 )
264 $ nimat = 1
265
266 DO 170 imat = 1, nimat
267
268
269
270 IF( .NOT.dotype( imat ) )
271 $ GO TO 170
272
273
274
275 zerot = imat.GE.3 .AND. imat.LE.6
276 IF( zerot .AND. n.LT.imat-2 )
277 $ GO TO 170
278
279
280
281 DO 160 iuplo = 1, 2
282 uplo = uplos( iuplo )
283
284
285
286
287
288
289 CALL dlatb4( matpath, imat, n, n,
TYPE, KL, KU, ANORM,
290 $ MODE, CNDNUM, DIST )
291
292
293
294 srnamt = 'DLATMS'
295 CALL dlatms( n, n, dist, iseed,
TYPE, RWORK, MODE,
296 $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA, WORK,
297 $ INFO )
298
299
300
301 IF( info.NE.0 ) THEN
302 CALL alaerh( path,
'DLATMS', info, 0, uplo, n, n, -1,
303 $ -1, -1, imat, nfail, nerrs, nout )
304
305
306
307 GO TO 160
308 END IF
309
310
311
312
313 IF( zerot ) THEN
314 IF( imat.EQ.3 ) THEN
315 izero = 1
316 ELSE IF( imat.EQ.4 ) THEN
317 izero = n
318 ELSE
319 izero = n / 2 + 1
320 END IF
321
322 IF( imat.LT.6 ) THEN
323
324
325
326 IF( iuplo.EQ.1 ) THEN
327 ioff = ( izero-1 )*lda
328 DO 20 i = 1, izero - 1
329 a( ioff+i ) = zero
330 20 CONTINUE
331 ioff = ioff + izero
332 DO 30 i = izero, n
333 a( ioff ) = zero
334 ioff = ioff + lda
335 30 CONTINUE
336 ELSE
337 ioff = izero
338 DO 40 i = 1, izero - 1
339 a( ioff ) = zero
340 ioff = ioff + lda
341 40 CONTINUE
342 ioff = ioff - izero
343 DO 50 i = izero, n
344 a( ioff+i ) = zero
345 50 CONTINUE
346 END IF
347 ELSE
348 ioff = 0
349 IF( iuplo.EQ.1 ) THEN
350
351
352
353 DO 70 j = 1, n
354 i2 = min( j, izero )
355 DO 60 i = 1, i2
356 a( ioff+i ) = zero
357 60 CONTINUE
358 ioff = ioff + lda
359 70 CONTINUE
360 ELSE
361
362
363
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 DO 150 ifact = 1, nfact
380
381
382
383 fact = facts( ifact )
384
385
386
387
388 IF( zerot ) THEN
389 IF( ifact.EQ.1 )
390 $ GO TO 150
391 rcondc = zero
392
393 ELSE IF( ifact.EQ.1 ) THEN
394
395
396
397 anorm =
dlansy(
'1', uplo, n, a, lda, rwork )
398
399
400
401 CALL dlacpy( uplo, n, n, a, lda, afac, lda )
403 $ lwork, info )
404
405
406
407 CALL dlacpy( uplo, n, n, afac, lda, ainv, lda )
408 lwork = (n+nb+1)*(nb+3)
410 $ work, info )
411 ainvnm =
dlansy(
'1', uplo, n, ainv, lda, rwork )
412
413
414
415 IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
416 rcondc = one
417 ELSE
418 rcondc = ( one / anorm ) / ainvnm
419 END IF
420 END IF
421
422
423
424 srnamt = 'DLARHS'
425 CALL dlarhs( matpath, xtype, uplo,
' ', n, n, kl, ku,
426 $ nrhs, a, lda, xact, lda, b, lda, iseed,
427 $ info )
428 xtype = 'C'
429
430
431
432 IF( ifact.EQ.2 ) THEN
433 CALL dlacpy( uplo, n, n, a, lda, afac, lda )
434 CALL dlacpy(
'Full', n, nrhs, b, lda, x, lda )
435
436
437
438
439 srnamt = 'DSYSV_ROOK'
440 CALL dsysv_rook( uplo, n, nrhs, afac, lda, iwork,
441 $ x, lda, work, lwork, info )
442
443
444
445
446 k = izero
447 IF( k.GT.0 ) THEN
448 100 CONTINUE
449 IF( iwork( k ).LT.0 ) THEN
450 IF( iwork( k ).NE.-k ) THEN
451 k = -iwork( k )
452 GO TO 100
453 END IF
454 ELSE IF( iwork( k ).NE.k ) THEN
455 k = iwork( k )
456 GO TO 100
457 END IF
458 END IF
459
460
461
462 IF( info.NE.k ) THEN
463 CALL alaerh( path,
'DSYSV_ROOK', info, k, uplo,
464 $ n, n, -1, -1, nrhs, imat, nfail,
465 $ nerrs, nout )
466 GO TO 120
467 ELSE IF( info.NE.0 ) THEN
468 GO TO 120
469 END IF
470
471
472
473
475 $ iwork, ainv, lda, rwork,
476 $ result( 1 ) )
477
478
479
480 CALL dlacpy(
'Full', n, nrhs, b, lda, work, lda )
481 CALL dpot02( uplo, n, nrhs, a, lda, x, lda, work,
482 $ lda, rwork, result( 2 ) )
483
484
485
486
487 CALL dget04( n, nrhs, x, lda, xact, lda, rcondc,
488 $ result( 3 ) )
489 nt = 3
490
491
492
493
494 DO 110 k = 1, nt
495 IF( result( k ).GE.thresh ) THEN
496 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
497 $
CALL aladhd( nout, path )
498 WRITE( nout, fmt = 9999 )'DSYSV_ROOK', uplo,
499 $ n, imat, k, result( k )
500 nfail = nfail + 1
501 END IF
502 110 CONTINUE
503 nrun = nrun + nt
504 120 CONTINUE
505 END IF
506
507 150 CONTINUE
508
509 160 CONTINUE
510 170 CONTINUE
511 180 CONTINUE
512
513
514
515 CALL alasvm( path, nout, nfail, nrun, nerrs )
516
517 9999 FORMAT( 1x, a, ', UPLO=''', a1, ''', N =', i5, ', type ', i2,
518 $ ', test ', i2, ', ratio =', g12.5 )
519 RETURN
520
521
522
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
subroutine dlarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
DLARHS
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 derrvx(path, nunit)
DERRVX
subroutine dget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
DGET04
subroutine dlatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
DLATB4
subroutine dlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
DLATMS
subroutine dpot02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
DPOT02
subroutine dpot05(uplo, n, nrhs, a, lda, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
DPOT05
subroutine dsyt01_rook(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
DSYT01_ROOK
subroutine dsysv_rook(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
DSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices
subroutine dsytrf_rook(uplo, n, a, lda, ipiv, work, lwork, info)
DSYTRF_ROOK
subroutine dsytri_rook(uplo, n, a, lda, ipiv, work, info)
DSYTRI_ROOK
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
double precision function dlansy(norm, uplo, n, a, lda, work)
DLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.