150 SUBROUTINE cdrvsy( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
151 $ A, AFAC, AINV, B, X, XACT, WORK, RWORK, IWORK,
160 INTEGER NMAX, NN, NOUT, NRHS
165 INTEGER IWORK( * ), NVAL( * )
167 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
168 $ work( * ), x( * ), xact( * )
175 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
176 INTEGER NTYPES, NTESTS
177 parameter( ntypes = 11, ntests = 6 )
179 parameter( nfact = 2 )
183 CHARACTER DIST, FACT,
TYPE, UPLO, XTYPE
185 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
186 $ izero, j, k, k1, kl, ku, lda, lwork, mode, n,
187 $ nb, nbmin, nerrs, nfail, nimat, nrun, nt
188 REAL AINVNM, ANORM, CNDNUM, RCOND, RCONDC
191 CHARACTER FACTS( NFACT ), UPLOS( 2 )
192 INTEGER ISEED( 4 ), ISEEDY( 4 )
193 REAL RESULT( NTESTS )
197 EXTERNAL CLANSY, SGET06
211 COMMON / infoc / infot, nunit, ok, lerr
212 COMMON / srnamc / srnamt
215 INTRINSIC cmplx, max, min
218 DATA iseedy / 1988, 1989, 1990, 1991 /
219 DATA uplos /
'U',
'L' / , facts /
'F',
'N' /
225 path( 1: 1 ) =
'Complex precision'
231 iseed( i ) = iseedy( i )
233 lwork = max( 2*nmax, nmax*nrhs )
238 $
CALL cerrvx( path, nout )
258 DO 170 imat = 1, nimat
262 IF( .NOT.dotype( imat ) )
267 zerot = imat.GE.3 .AND. imat.LE.6
268 IF( zerot .AND. n.LT.imat-2 )
274 uplo = uplos( iuplo )
276 IF( imat.NE.ntypes )
THEN
281 CALL clatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
282 $ mode, cndnum, dist )
285 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
286 $ cndnum, anorm, kl, ku, uplo, a, lda,
292 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n,
293 $ -1, -1, -1, imat, nfail, nerrs, nout )
303 ELSE IF( imat.EQ.4 )
THEN
313 IF( iuplo.EQ.1 )
THEN
314 ioff = ( izero-1 )*lda
315 DO 20 i = 1, izero - 1
325 DO 40 i = 1, izero - 1
335 IF( iuplo.EQ.1 )
THEN
369 CALL clatsy( uplo, n, a, lda, iseed )
372 DO 150 ifact = 1, nfact
376 fact = facts( ifact )
386 ELSE IF( ifact.EQ.1 )
THEN
390 anorm = clansy(
'1', uplo, n, a, lda, rwork )
394 CALL clacpy( uplo, n, n, a, lda, afac, lda )
395 CALL csytrf( uplo, n, afac, lda, iwork, work,
400 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
401 lwork = (n+nb+1)*(nb+3)
402 CALL csytri2( uplo, n, ainv, lda, iwork, work,
404 ainvnm = clansy(
'1', uplo, n, ainv, lda, rwork )
408 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
411 rcondc = ( one / anorm ) / ainvnm
418 CALL clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
419 $ nrhs, a, lda, xact, lda, b, lda, iseed,
425 IF( ifact.EQ.2 )
THEN
426 CALL clacpy( uplo, n, n, a, lda, afac, lda )
427 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
432 CALL csysv( uplo, n, nrhs, afac, lda, iwork, x,
433 $ lda, work, lwork, info )
441 IF( iwork( k ).LT.0 )
THEN
442 IF( iwork( k ).NE.-k )
THEN
446 ELSE IF( iwork( k ).NE.k )
THEN
455 CALL alaerh( path,
'CSYSV ', info, k, uplo, n,
456 $ n, -1, -1, nrhs, imat, nfail,
459 ELSE IF( info.NE.0 )
THEN
466 CALL csyt01( uplo, n, a, lda, afac, lda, iwork,
467 $ ainv, lda, rwork, result( 1 ) )
471 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
472 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
473 $ lda, rwork, result( 2 ) )
477 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
485 IF( result( k ).GE.thresh )
THEN
486 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
487 $
CALL aladhd( nout, path )
488 WRITE( nout, fmt = 9999 )
'CSYSV ', uplo, n,
489 $ imat, k, result( k )
500 $
CALL claset( uplo, n, n, cmplx( zero ),
501 $ cmplx( zero ), afac, lda )
502 CALL claset(
'Full', n, nrhs, cmplx( zero ),
503 $ cmplx( zero ), x, lda )
509 CALL csysvx( fact, uplo, n, nrhs, a, lda, afac, lda,
510 $ iwork, b, lda, x, lda, rcond, rwork,
511 $ rwork( nrhs+1 ), work, lwork,
512 $ rwork( 2*nrhs+1 ), info )
520 IF( iwork( k ).LT.0 )
THEN
521 IF( iwork( k ).NE.-k )
THEN
525 ELSE IF( iwork( k ).NE.k )
THEN
534 CALL alaerh( path,
'CSYSVX', info, k, fact // uplo,
535 $ n, n, -1, -1, nrhs, imat, nfail,
541 IF( ifact.GE.2 )
THEN
546 CALL csyt01( uplo, n, a, lda, afac, lda, iwork,
547 $ ainv, lda, rwork( 2*nrhs+1 ),
556 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
557 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
558 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
562 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
567 CALL cpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
568 $ xact, lda, rwork, rwork( nrhs+1 ),
577 result( 6 ) = sget06( rcond, rcondc )
583 IF( result( k ).GE.thresh )
THEN
584 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
585 $
CALL aladhd( nout, path )
586 WRITE( nout, fmt = 9998 )
'CSYSVX', fact, uplo,
587 $ n, imat, k, result( k )
601 CALL alasvm( path, nout, nfail, nrun, nerrs )
603 9999
FORMAT( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
604 $
', test ', i2,
', ratio =', g12.5 )
605 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
606 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )
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 cdrvsy(dotype, nn, nval, nrhs, thresh, tsterr, nmax, a, afac, ainv, b, x, xact, work, rwork, iwork, nout)
CDRVSY
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 cpot05(uplo, n, nrhs, a, lda, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CPOT05
subroutine csyt01(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
CSYT01
subroutine csyt02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CSYT02
subroutine csysv(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
CSYSV computes the solution to system of linear equations A * X = B for SY matrices
subroutine csysvx(fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, rwork, info)
CSYSVX computes the solution to system of linear equations A * X = B for SY matrices
subroutine csytrf(uplo, n, a, lda, ipiv, work, lwork, info)
CSYTRF
subroutine csytri2(uplo, n, a, lda, ipiv, work, lwork, info)
CSYTRI2
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
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.