154 SUBROUTINE cdrvsy( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
155 $ A, AFAC, AINV, B, X, XACT, WORK, RWORK, IWORK,
164 INTEGER NMAX, NN, NOUT, NRHS
169 INTEGER IWORK( * ), NVAL( * )
171 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
172 $ work( * ), x( * ), xact( * )
179 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
180 INTEGER NTYPES, NTESTS
181 parameter( ntypes = 11, ntests = 6 )
183 parameter( nfact = 2 )
187 CHARACTER DIST, EQUED, FACT,
TYPE, UPLO, XTYPE
189 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
190 $ izero, j, k, k1, kl, ku, lda, lwork, mode, n,
191 $ nb, nbmin, nerrs, nfail, nimat, nrun, nt,
193 REAL AINVNM, ANORM, CNDNUM, RCOND, RCONDC,
197 CHARACTER FACTS( NFACT ), UPLOS( 2 )
198 INTEGER ISEED( 4 ), ISEEDY( 4 )
199 REAL RESULT( NTESTS ), BERR( NRHS ),
200 $ errbnds_n( nrhs, 3 ), errbnds_c( nrhs, 3 )
204 EXTERNAL CLANSY, SGET06
218 COMMON / infoc / infot, nunit, ok, lerr
219 COMMON / srnamc / srnamt
222 INTRINSIC cmplx, max, min
225 DATA iseedy / 1988, 1989, 1990, 1991 /
226 DATA uplos /
'U',
'L' / , facts /
'F',
'N' /
232 path( 1: 1 ) =
'Complex precision'
238 iseed( i ) = iseedy( i )
240 lwork = max( 2*nmax, nmax*nrhs )
245 $
CALL cerrvx( path, nout )
265 DO 170 imat = 1, nimat
269 IF( .NOT.dotype( imat ) )
274 zerot = imat.GE.3 .AND. imat.LE.6
275 IF( zerot .AND. n.LT.imat-2 )
281 uplo = uplos( iuplo )
283 IF( imat.NE.ntypes )
THEN
288 CALL clatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
289 $ mode, cndnum, dist )
292 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
293 $ cndnum, anorm, kl, ku, uplo, a, lda,
299 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n,
300 $ -1, -1, -1, imat, nfail, nerrs, nout )
310 ELSE IF( imat.EQ.4 )
THEN
320 IF( iuplo.EQ.1 )
THEN
321 ioff = ( izero-1 )*lda
322 DO 20 i = 1, izero - 1
332 DO 40 i = 1, izero - 1
342 IF( iuplo.EQ.1 )
THEN
376 CALL clatsy( uplo, n, a, lda, iseed )
379 DO 150 ifact = 1, nfact
383 fact = facts( ifact )
393 ELSE IF( ifact.EQ.1 )
THEN
397 anorm = clansy(
'1', uplo, n, a, lda, rwork )
401 CALL clacpy( uplo, n, n, a, lda, afac, lda )
402 CALL csytrf( uplo, n, afac, lda, iwork, work,
407 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
408 lwork = (n+nb+1)*(nb+3)
409 CALL csytri2( uplo, n, ainv, lda, iwork, work,
411 ainvnm = clansy(
'1', uplo, n, ainv, lda, rwork )
415 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
418 rcondc = ( one / anorm ) / ainvnm
425 CALL clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
426 $ nrhs, a, lda, xact, lda, b, lda, iseed,
432 IF( ifact.EQ.2 )
THEN
433 CALL clacpy( uplo, n, n, a, lda, afac, lda )
434 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
439 CALL csysv( uplo, n, nrhs, afac, lda, iwork, x,
440 $ lda, work, lwork, info )
448 IF( iwork( k ).LT.0 )
THEN
449 IF( iwork( k ).NE.-k )
THEN
453 ELSE IF( iwork( k ).NE.k )
THEN
462 CALL alaerh( path,
'CSYSV ', info, k, uplo, n,
463 $ n, -1, -1, nrhs, imat, nfail,
466 ELSE IF( info.NE.0 )
THEN
473 CALL csyt01( uplo, n, a, lda, afac, lda, iwork,
474 $ ainv, lda, rwork, result( 1 ) )
478 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
479 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
480 $ lda, rwork, result( 2 ) )
484 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
492 IF( result( k ).GE.thresh )
THEN
493 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
494 $
CALL aladhd( nout, path )
495 WRITE( nout, fmt = 9999 )
'CSYSV ', uplo, n,
496 $ imat, k, result( k )
507 $
CALL claset( uplo, n, n, cmplx( zero ),
508 $ cmplx( zero ), afac, lda )
509 CALL claset(
'Full', n, nrhs, cmplx( zero ),
510 $ cmplx( zero ), x, lda )
516 CALL csysvx( fact, uplo, n, nrhs, a, lda, afac, lda,
517 $ iwork, b, lda, x, lda, rcond, rwork,
518 $ rwork( nrhs+1 ), work, lwork,
519 $ rwork( 2*nrhs+1 ), info )
527 IF( iwork( k ).LT.0 )
THEN
528 IF( iwork( k ).NE.-k )
THEN
532 ELSE IF( iwork( k ).NE.k )
THEN
541 CALL alaerh( path,
'CSYSVX', info, k, fact // uplo,
542 $ n, n, -1, -1, nrhs, imat, nfail,
548 IF( ifact.GE.2 )
THEN
553 CALL csyt01( uplo, n, a, lda, afac, lda, iwork,
554 $ ainv, lda, rwork( 2*nrhs+1 ),
563 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
564 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
565 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
569 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
574 CALL cpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
575 $ xact, lda, rwork, rwork( nrhs+1 ),
584 result( 6 ) = sget06( rcond, rcondc )
590 IF( result( k ).GE.thresh )
THEN
591 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
592 $
CALL aladhd( nout, path )
593 WRITE( nout, fmt = 9998 )
'CSYSVX', fact, uplo,
594 $ n, imat, k, result( k )
605 $
CALL claset( uplo, n, n, cmplx( zero ),
606 $ cmplx( zero ), afac, lda )
607 CALL claset(
'Full', n, nrhs, cmplx( zero ),
608 $ cmplx( zero ), x, lda )
616 CALL csysvxx( fact, uplo, n, nrhs, a, lda, afac,
617 $ lda, iwork, equed, work( n+1 ), b, lda, x,
618 $ lda, rcond, rpvgrw_svxx, berr, n_err_bnds,
619 $ errbnds_n, errbnds_c, 0, zero, work,
628 IF( iwork( k ).LT.0 )
THEN
629 IF( iwork( k ).NE.-k )
THEN
633 ELSE IF( iwork( k ).NE.k )
THEN
641 IF( info.NE.k .AND. info.LE.n )
THEN
642 CALL alaerh( path,
'CSYSVXX', info, k,
643 $ fact // uplo, n, n, -1, -1, nrhs, imat, nfail,
649 IF( ifact.GE.2 )
THEN
654 CALL csyt01( uplo, n, a, lda, afac, lda, iwork,
655 $ ainv, lda, rwork(2*nrhs+1),
664 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
665 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
666 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
671 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
676 CALL cpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
677 $ xact, lda, rwork, rwork( nrhs+1 ),
686 result( 6 ) = sget06( rcond, rcondc )
692 IF( result( k ).GE.thresh )
THEN
693 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
694 $
CALL aladhd( nout, path )
695 WRITE( nout, fmt = 9998 )
'CSYSVXX',
696 $ fact, uplo, n, imat, k,
711 CALL alasvm( path, nout, nfail, nrun, nerrs )
718 9999
FORMAT( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
719 $
', test ', i2,
', ratio =', g12.5 )
720 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
721 $
', 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 cebchvxx(thresh, path)
CEBCHVXX
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 csysvxx(fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)
CSYSVXX 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.