98 DOUBLE PRECISION THRESH
101 INTEGER NMAX, NPARAMS, NERRBND, NTESTS, KL, KU
102 parameter(nmax = 10, nparams = 2, nerrbnd = 3,
106 INTEGER N, NRHS, INFO, I ,J, k, NFAIL, LDA,
107 $ N_AUX_TESTS, LDAB, LDAFB
108 CHARACTER FACT, TRANS, UPLO, EQUED
110 CHARACTER(3) NGUAR, CGUAR
111 LOGICAL printed_guide
112 DOUBLE PRECISION NCOND, CCOND, M, NORMDIF, NORMT, RCOND,
113 $ RNORM, RINORM, SUMR, SUMRI, EPS,
114 $ BERR(NMAX), RPVGRW, ORCOND,
115 $ CWISE_ERR, NWISE_ERR, CWISE_BND, NWISE_BND,
116 $ CWISE_RCOND, NWISE_RCOND,
117 $ CONDTHRESH, ERRTHRESH
121 DOUBLE PRECISION TSTRAT(NTESTS), RINV(NMAX), PARAMS(NPARAMS),
122 $ S(NMAX),R(NMAX),C(NMAX),RWORK(3*NMAX),
124 $ ERRBND_N(NMAX*3), ERRBND_C(NMAX*3)
126 COMPLEX*16 A(NMAX,NMAX),INVHILB(NMAX,NMAX),X(NMAX,NMAX),
127 $ WORK(NMAX*3*5), AF(NMAX, NMAX),B(NMAX, NMAX),
129 $ AB( (NMAX-1)+(NMAX-1)+1, NMAX ),
130 $ ABCOPY( (NMAX-1)+(NMAX-1)+1, NMAX ),
131 $ AFB( 2*(NMAX-1)+(NMAX-1)+1, NMAX )
134 DOUBLE PRECISION DLAMCH
142 INTRINSIC sqrt, max, abs, dble, dimag
145 DOUBLE PRECISION CABS1
148 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
151 INTEGER NWISE_I, CWISE_I
152 parameter(nwise_i = 1, cwise_i = 1)
153 INTEGER BND_I, COND_I
154 parameter(bnd_i = 2, cond_i = 3)
162 eps = dlamch(
'Epsilon')
166 ldab = (nmax-1)+(nmax-1)+1
167 ldafb = 2*(nmax-1)+(nmax-1)+1
172 printed_guide = .false.
181 m = max(sqrt(dble(n)), 10.0d+0)
185 CALL zlahilb(n, n, a, lda, invhilb, lda, b,
186 $ lda, work, info, path)
189 CALL zlacpy(
'ALL', n, n, a, nmax, acopy, nmax)
194 ab( i, j ) = (0.0d+0,0.0d+0)
198 DO i = max( 1, j-ku ), min( n, j+kl )
199 ab( ku+1+i-j, j ) = a( i, j )
206 abcopy( i, j ) = (0.0d+0,0.0d+0)
209 CALL zlacpy(
'ALL', kl+ku+1, n, ab, ldab, abcopy, ldab)
212 IF ( lsamen( 2, c2,
'SY' ) )
THEN
213 CALL zsysvxx(fact, uplo, n, nrhs, acopy, lda, af, lda,
214 $ ipiv, equed, s, b, lda, x, lda, orcond,
215 $ rpvgrw, berr, nerrbnd, errbnd_n, errbnd_c, nparams,
216 $ params, work, rwork, info)
217 ELSE IF ( lsamen( 2, c2,
'PO' ) )
THEN
218 CALL zposvxx(fact, uplo, n, nrhs, acopy, lda, af, lda,
219 $ equed, s, b, lda, x, lda, orcond,
220 $ rpvgrw, berr, nerrbnd, errbnd_n, errbnd_c, nparams,
221 $ params, work, rwork, info)
222 ELSE IF ( lsamen( 2, c2,
'HE' ) )
THEN
223 CALL zhesvxx(fact, uplo, n, nrhs, acopy, lda, af, lda,
224 $ ipiv, equed, s, b, lda, x, lda, orcond,
225 $ rpvgrw, berr, nerrbnd, errbnd_n, errbnd_c, nparams,
226 $ params, work, rwork, info)
227 ELSE IF ( lsamen( 2, c2,
'GB' ) )
THEN
228 CALL zgbsvxx(fact, trans, n, kl, ku, nrhs, abcopy,
229 $ ldab, afb, ldafb, ipiv, equed, r, c, b,
230 $ lda, x, lda, orcond, rpvgrw, berr, nerrbnd,
231 $ errbnd_n, errbnd_c, nparams, params, work, rwork,
234 CALL zgesvxx(fact, trans, n, nrhs, acopy, lda, af, lda,
235 $ ipiv, equed, r, c, b, lda, x, lda, orcond,
236 $ rpvgrw, berr, nerrbnd, errbnd_n, errbnd_c, nparams,
237 $ params, work, rwork, info)
240 n_aux_tests = n_aux_tests + 1
241 IF (orcond .LT. eps)
THEN
251 IF (info .GT. 0 .AND. info .LE. n+1)
THEN
253 WRITE (*, fmt=8000) c2, n, info, orcond, rcond
260 diff(i,j) = x(i,j) - invhilb(i,j)
267 IF ( lsamen( 2, c2,
'PO' ) .OR. lsamen( 2, c2,
'SY' ) .OR.
268 $ lsamen( 2, c2,
'HE' ) )
THEN
273 sumr = sumr + s(i) * cabs1(a(i,j)) * s(j)
274 sumri = sumri + cabs1(invhilb(i, j)) / (s(j) * s(i))
276 rnorm = max(rnorm,sumr)
277 rinorm = max(rinorm,sumri)
279 ELSE IF ( lsamen( 2, c2,
'GE' ) .OR. lsamen( 2, c2,
'GB' ) )
285 sumr = sumr + r(i) * cabs1(a(i,j)) * c(j)
286 sumri = sumri + cabs1(invhilb(i, j)) / (r(j) * c(i))
288 rnorm = max(rnorm,sumr)
289 rinorm = max(rinorm,sumri)
293 rnorm = rnorm / cabs1(a(1, 1))
294 rcond = 1.0d+0/(rnorm * rinorm)
302 rinv(i) = rinv(i) + cabs1(a(i,j))
311 sumri = sumri + cabs1(invhilb(i,j) * rinv(j))
313 rinorm = max(rinorm, sumri)
318 ncond = cabs1(a(1,1)) / rinorm
328 normt = max(cabs1(invhilb(i, k)), normt)
329 normdif = max(cabs1(x(i,k) - invhilb(i,k)), normdif)
330 IF (invhilb(i,k) .NE. 0.0d+0)
THEN
331 cwise_err = max(cabs1(x(i,k) - invhilb(i,k))
332 $ /cabs1(invhilb(i,k)), cwise_err)
333 ELSE IF (x(i, k) .NE. 0.0d+0)
THEN
334 cwise_err = dlamch(
'OVERFLOW')
337 IF (normt .NE. 0.0d+0)
THEN
338 nwise_err = normdif / normt
339 ELSE IF (normdif .NE. 0.0d+0)
THEN
340 nwise_err = dlamch(
'OVERFLOW')
350 rinv(i) = rinv(i) + cabs1(a(i, j) * invhilb(j, k))
358 $ + cabs1(invhilb(i, j) * rinv(j) / invhilb(i, k))
360 rinorm = max(rinorm, sumri)
364 ccond = cabs1(a(1,1))/rinorm
367 nwise_bnd = errbnd_n(k + (bnd_i-1)*nrhs)
368 cwise_bnd = errbnd_c(k + (bnd_i-1)*nrhs)
369 nwise_rcond = errbnd_n(k + (cond_i-1)*nrhs)
370 cwise_rcond = errbnd_c(k + (cond_i-1)*nrhs)
374 IF (ncond .GE. condthresh)
THEN
376 IF (nwise_bnd .GT. errthresh)
THEN
377 tstrat(1) = 1/(2.0d+0*eps)
379 IF (nwise_bnd .NE. 0.0d+0)
THEN
380 tstrat(1) = nwise_err / nwise_bnd
381 ELSE IF (nwise_err .NE. 0.0d+0)
THEN
382 tstrat(1) = 1/(16.0*eps)
386 IF (tstrat(1) .GT. 1.0d+0)
THEN
387 tstrat(1) = 1/(4.0d+0*eps)
392 IF (nwise_bnd .LT. 1.0d+0)
THEN
393 tstrat(1) = 1/(8.0d+0*eps)
401 IF (ccond .GE. condthresh)
THEN
403 IF (cwise_bnd .GT. errthresh)
THEN
404 tstrat(2) = 1/(2.0d+0*eps)
406 IF (cwise_bnd .NE. 0.0d+0)
THEN
407 tstrat(2) = cwise_err / cwise_bnd
408 ELSE IF (cwise_err .NE. 0.0d+0)
THEN
409 tstrat(2) = 1/(16.0d+0*eps)
413 IF (tstrat(2) .GT. 1.0d+0) tstrat(2) = 1/(4.0d+0*eps)
417 IF (cwise_bnd .LT. 1.0d+0)
THEN
418 tstrat(2) = 1/(8.0d+0*eps)
425 tstrat(3) = berr(k)/eps
428 tstrat(4) = rcond / orcond
429 IF (rcond .GE. condthresh .AND. tstrat(4) .LT. 1.0d+0)
430 $ tstrat(4) = 1.0d+0 / tstrat(4)
432 tstrat(5) = ncond / nwise_rcond
433 IF (ncond .GE. condthresh .AND. tstrat(5) .LT. 1.0d+0)
434 $ tstrat(5) = 1.0d+0 / tstrat(5)
436 tstrat(6) = ccond / nwise_rcond
437 IF (ccond .GE. condthresh .AND. tstrat(6) .LT. 1.0d+0)
438 $ tstrat(6) = 1.0d+0 / tstrat(6)
441 IF (tstrat(i) .GT. thresh)
THEN
442 IF (.NOT.printed_guide)
THEN
453 printed_guide = .true.
455 WRITE( *, 9999) c2, n, k, nguar, cguar, i, tstrat(i)
478 IF( nfail .GT. 0 )
THEN
479 WRITE(*,9998) c2, nfail, ntests*n+n_aux_tests
483 9999
FORMAT(
' Z', a2,
'SVXX: N =', i2,
', RHS = ', i2,
484 $
', NWISE GUAR. = ', a,
', CWISE GUAR. = ', a,
485 $
' test(',i1,
') =', g12.5 )
486 9998
FORMAT(
' Z', a2,
'SVXX: ', i6,
' out of ', i6,
487 $
' tests failed to pass the threshold' )
488 9997
FORMAT(
' Z', a2,
'SVXX passed the tests of error bounds' )
490 9996
FORMAT( 3x, i2,
': Normwise guaranteed forward error', / 5x,
491 $
'Guaranteed case: if norm ( abs( Xc - Xt )',
492 $ .LE.
' / norm ( Xt ) ERRBND( *, nwise_i, bnd_i ), then',
494 $ .LE.
'ERRBND( *, nwise_i, bnd_i ) MAX(SQRT(N), 10) * EPS')
495 9995
FORMAT( 3x, i2,
': Componentwise guaranteed forward error' )
496 9994
FORMAT( 3x, i2,
': Backwards error' )
497 9993
FORMAT( 3x, i2,
': Reciprocal condition number' )
498 9992
FORMAT( 3x, i2,
': Reciprocal normwise condition number' )
499 9991
FORMAT( 3x, i2,
': Raw normwise error estimate' )
500 9990
FORMAT( 3x, i2,
': Reciprocal componentwise condition number' )
501 9989
FORMAT( 3x, i2,
': Raw componentwise error estimate' )
503 8000
FORMAT(
' Z', a2,
'SVXX: N =', i2,
', INFO = ', i3,
504 $
', ORCOND = ', g12.5,
', real RCOND = ', g12.5 )
subroutine zlahilb(n, nrhs, a, lda, x, ldx, b, ldb, work, info, path)
ZLAHILB
subroutine zgbsvxx(fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)
ZGBSVXX computes the solution to system of linear equations A * X = B for GB matrices
subroutine zgesvxx(fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)
ZGESVXX computes the solution to system of linear equations A * X = B for GE matrices
subroutine zsysvxx(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)
ZSYSVXX computes the solution to system of linear equations A * X = B for SY matrices
subroutine zhesvxx(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)
ZHESVXX computes the solution to system of linear equations A * X = B for HE matrices
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
logical function lsamen(n, ca, cb)
LSAMEN
subroutine zposvxx(fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)
ZPOSVXX computes the solution to system of linear equations A * X = B for PO matrices
subroutine zebchvxx(thresh, path)
ZEBCHVXX