LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zdrvsy_rook()

subroutine zdrvsy_rook ( logical, dimension( * )  DOTYPE,
integer  NN,
integer, dimension( * )  NVAL,
integer  NRHS,
double precision  THRESH,
logical  TSTERR,
integer  NMAX,
complex*16, dimension( * )  A,
complex*16, dimension( * )  AFAC,
complex*16, dimension( * )  AINV,
complex*16, dimension( * )  B,
complex*16, dimension( * )  X,
complex*16, dimension( * )  XACT,
complex*16, dimension( * )  WORK,
double precision, dimension( * )  RWORK,
integer, dimension( * )  IWORK,
integer  NOUT 
)

ZDRVSY_ROOK

Purpose:
 ZDRVSY_ROOK tests the driver routines ZSYSV_ROOK.
Parameters
[in]DOTYPE
          DOTYPE is LOGICAL array, dimension (NTYPES)
          The matrix types to be used for testing.  Matrices of type j
          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) =
          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used.
[in]NN
          NN is INTEGER
          The number of values of N contained in the vector NVAL.
[in]NVAL
          NVAL is INTEGER array, dimension (NN)
          The values of the matrix dimension N.
[in]NRHS
          NRHS is INTEGER
          The number of right hand side vectors to be generated for
          each linear system.
[in]THRESH
          THRESH is DOUBLE PRECISION
          The threshold value for the test ratios.  A result is
          included in the output file if RESULT >= THRESH.  To have
          every test ratio printed, use THRESH = 0.
[in]TSTERR
          TSTERR is LOGICAL
          Flag that indicates whether error exits are to be tested.
[in]NMAX
          NMAX is INTEGER
          The maximum value permitted for N, used in dimensioning the
          work arrays.
[out]A
          A is COMPLEX*16 array, dimension (NMAX*NMAX)
[out]AFAC
          AFAC is COMPLEX*16 array, dimension (NMAX*NMAX)
[out]AINV
          AINV is COMPLEX*16 array, dimension (NMAX*NMAX)
[out]B
          B is COMPLEX*16 array, dimension (NMAX*NRHS)
[out]X
          X is COMPLEX*16 array, dimension (NMAX*NRHS)
[out]XACT
          XACT is COMPLEX*16 array, dimension (NMAX*NRHS)
[out]WORK
          WORK is COMPLEX*16 array, dimension (NMAX*max(2,NRHS))
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (NMAX+2*NRHS)
[out]IWORK
          IWORK is INTEGER array, dimension (NMAX)
[in]NOUT
          NOUT is INTEGER
          The unit number for output.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 155 of file zdrvsy_rook.f.

155 *
156 * -- LAPACK test routine (version 3.7.0) --
157 * -- LAPACK is a software package provided by Univ. of Tennessee, --
158 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
159 * December 2016
160 *
161 * .. Scalar Arguments ..
162  LOGICAL tsterr
163  INTEGER nmax, nn, nout, nrhs
164  DOUBLE PRECISION thresh
165 * ..
166 * .. Array Arguments ..
167  LOGICAL dotype( * )
168  INTEGER iwork( * ), nval( * )
169  DOUBLE PRECISION rwork( * )
170  COMPLEX*16 a( * ), afac( * ), ainv( * ), b( * ),
171  $ work( * ), x( * ), xact( * )
172 * ..
173 *
174 * =====================================================================
175 *
176 * .. Parameters ..
177  DOUBLE PRECISION one, zero
178  parameter( one = 1.0d+0, zero = 0.0d+0 )
179  INTEGER ntypes, ntests
180  parameter( ntypes = 11, ntests = 3 )
181  INTEGER nfact
182  parameter( nfact = 2 )
183 * ..
184 * .. Local Scalars ..
185  LOGICAL zerot
186  CHARACTER dist, fact, TYPE, uplo, xtype
187  CHARACTER*3 matpath, path
188  INTEGER i, i1, i2, ifact, imat, in, info, ioff, iuplo,
189  $ izero, j, k, kl, ku, lda, lwork, mode, n,
190  $ nb, nbmin, nerrs, nfail, nimat, nrun, nt
191  DOUBLE PRECISION ainvnm, anorm, cndnum, rcondc
192 * ..
193 * .. Local Arrays ..
194  CHARACTER facts( nfact ), uplos( 2 )
195  INTEGER iseed( 4 ), iseedy( 4 )
196  DOUBLE PRECISION result( ntests )
197 
198 * ..
199 * .. External Functions ..
200  DOUBLE PRECISION zlansy
201  EXTERNAL zlansy
202 * ..
203 * .. External Subroutines ..
204  EXTERNAL aladhd, alaerh, alasvm, xlaenv, zerrvx, zget04,
208 * ..
209 * .. Scalars in Common ..
210  LOGICAL lerr, ok
211  CHARACTER*32 srnamt
212  INTEGER infot, nunit
213 * ..
214 * .. Common blocks ..
215  COMMON / infoc / infot, nunit, ok, lerr
216  COMMON / srnamc / srnamt
217 * ..
218 * .. Intrinsic Functions ..
219  INTRINSIC max, min
220 * ..
221 * .. Data statements ..
222  DATA iseedy / 1988, 1989, 1990, 1991 /
223  DATA uplos / 'U', 'L' / , facts / 'F', 'N' /
224 * ..
225 * .. Executable Statements ..
226 *
227 * Initialize constants and the random number seed.
228 *
229 * Test path
230 *
231  path( 1: 1 ) = 'Zomplex precision'
232  path( 2: 3 ) = 'SR'
233 *
234 * Path to generate matrices
235 *
236  matpath( 1: 1 ) = 'Zomplex 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 * Test the error exits
248 *
249  IF( tsterr )
250  $ CALL zerrvx( path, nout )
251  infot = 0
252 *
253 * Set the block size and minimum block size for which the block
254 * routine should be used, which will be later returned by ILAENV.
255 *
256  nb = 1
257  nbmin = 2
258  CALL xlaenv( 1, nb )
259  CALL xlaenv( 2, nbmin )
260 *
261 * Do for each value of N in NVAL
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 * Do the tests only if DOTYPE( IMAT ) is true.
274 *
275  IF( .NOT.dotype( imat ) )
276  $ GO TO 170
277 *
278 * Skip types 3, 4, 5, or 6 if the matrix size is too small.
279 *
280  zerot = imat.GE.3 .AND. imat.LE.6
281  IF( zerot .AND. n.LT.imat-2 )
282  $ GO TO 170
283 *
284 * Do first for UPLO = 'U', then for UPLO = 'L'
285 *
286  DO 160 iuplo = 1, 2
287  uplo = uplos( iuplo )
288 *
289  IF( imat.NE.ntypes ) THEN
290 *
291 * Begin generate the test matrix A.
292 *
293 * Set up parameters with ZLATB4 for the matrix generator
294 * based on the type of matrix to be generated.
295 *
296  CALL zlatb4( matpath, imat, n, n, TYPE, kl, ku, anorm,
297  $ mode, cndnum, dist )
298 *
299 * Generate a matrix with ZLATMS.
300 *
301  srnamt = 'ZLATMS'
302  CALL zlatms( n, n, dist, iseed, TYPE, rwork, mode,
303  $ cndnum, anorm, kl, ku, uplo, a, lda,
304  $ work, info )
305 *
306 * Check error code from DLATMS and handle error.
307 *
308  IF( info.NE.0 ) THEN
309  CALL alaerh( path, 'ZLATMS', info, 0, uplo, n, n,
310  $ -1, -1, -1, imat, nfail, nerrs, nout )
311  GO TO 160
312  END IF
313 *
314 * For types 3-6, zero one or more rows and columns of
315 * the matrix to test that INFO is returned correctly.
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 * Set row and column IZERO to zero.
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 * Set the first IZERO rows and columns to zero.
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 * Set the first IZERO rows and columns to zero.
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  ELSE
382 *
383 * IMAT = NTYPES: Use a special block diagonal matrix to
384 * test alternate code for the 2-by-2 blocks.
385 *
386  CALL zlatsy( uplo, n, a, lda, iseed )
387  END IF
388 *
389  DO 150 ifact = 1, nfact
390 *
391 * Do first for FACT = 'F', then for other values.
392 *
393  fact = facts( ifact )
394 *
395 * Compute the condition number for comparison with
396 * the value returned by ZSYSVX_ROOK.
397 *
398  IF( zerot ) THEN
399  IF( ifact.EQ.1 )
400  $ GO TO 150
401  rcondc = zero
402 *
403  ELSE IF( ifact.EQ.1 ) THEN
404 *
405 * Compute the 1-norm of A.
406 *
407  anorm = zlansy( '1', uplo, n, a, lda, rwork )
408 *
409 * Factor the matrix A.
410 *
411 
412  CALL zlacpy( uplo, n, n, a, lda, afac, lda )
413  CALL zsytrf_rook( uplo, n, afac, lda, iwork, work,
414  $ lwork, info )
415 *
416 * Compute inv(A) and take its norm.
417 *
418  CALL zlacpy( uplo, n, n, afac, lda, ainv, lda )
419  lwork = (n+nb+1)*(nb+3)
420  CALL zsytri_rook( uplo, n, ainv, lda, iwork,
421  $ work, info )
422  ainvnm = zlansy( '1', uplo, n, ainv, lda, rwork )
423 *
424 * Compute the 1-norm condition number of A.
425 *
426  IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
427  rcondc = one
428  ELSE
429  rcondc = ( one / anorm ) / ainvnm
430  END IF
431  END IF
432 *
433 * Form an exact solution and set the right hand side.
434 *
435  srnamt = 'ZLARHS'
436  CALL zlarhs( matpath, xtype, uplo, ' ', n, n, kl, ku,
437  $ nrhs, a, lda, xact, lda, b, lda, iseed,
438  $ info )
439  xtype = 'C'
440 *
441 * --- Test ZSYSV_ROOK ---
442 *
443  IF( ifact.EQ.2 ) THEN
444  CALL zlacpy( uplo, n, n, a, lda, afac, lda )
445  CALL zlacpy( 'Full', n, nrhs, b, lda, x, lda )
446 *
447 * Factor the matrix and solve the system using
448 * ZSYSV_ROOK.
449 *
450  srnamt = 'ZSYSV_ROOK'
451  CALL zsysv_rook( uplo, n, nrhs, afac, lda, iwork,
452  $ x, lda, work, lwork, info )
453 *
454 * Adjust the expected value of INFO to account for
455 * pivoting.
456 *
457  k = izero
458  IF( k.GT.0 ) THEN
459  100 CONTINUE
460  IF( iwork( k ).LT.0 ) THEN
461  IF( iwork( k ).NE.-k ) THEN
462  k = -iwork( k )
463  GO TO 100
464  END IF
465  ELSE IF( iwork( k ).NE.k ) THEN
466  k = iwork( k )
467  GO TO 100
468  END IF
469  END IF
470 *
471 * Check error code from ZSYSV_ROOK and handle error.
472 *
473  IF( info.NE.k ) THEN
474  CALL alaerh( path, 'ZSYSV_ROOK', info, k, uplo,
475  $ n, n, -1, -1, nrhs, imat, nfail,
476  $ nerrs, nout )
477  GO TO 120
478  ELSE IF( info.NE.0 ) THEN
479  GO TO 120
480  END IF
481 *
482 *+ TEST 1 Reconstruct matrix from factors and compute
483 * residual.
484 *
485  CALL zsyt01_rook( uplo, n, a, lda, afac, lda,
486  $ iwork, ainv, lda, rwork,
487  $ result( 1 ) )
488 *
489 *+ TEST 2 Compute residual of the computed solution.
490 *
491  CALL zlacpy( 'Full', n, nrhs, b, lda, work, lda )
492  CALL zsyt02( uplo, n, nrhs, a, lda, x, lda, work,
493  $ lda, rwork, result( 2 ) )
494 *
495 *+ TEST 3
496 * Check solution from generated exact solution.
497 *
498  CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
499  $ result( 3 ) )
500  nt = 3
501 *
502 * Print information about the tests that did not pass
503 * the threshold.
504 *
505  DO 110 k = 1, nt
506  IF( result( k ).GE.thresh ) THEN
507  IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
508  $ CALL aladhd( nout, path )
509  WRITE( nout, fmt = 9999 )'ZSYSV_ROOK', uplo,
510  $ n, imat, k, result( k )
511  nfail = nfail + 1
512  END IF
513  110 CONTINUE
514  nrun = nrun + nt
515  120 CONTINUE
516  END IF
517 *
518  150 CONTINUE
519 *
520  160 CONTINUE
521  170 CONTINUE
522  180 CONTINUE
523 *
524 * Print a summary of the results.
525 *
526  CALL alasvm( path, nout, nfail, nrun, nerrs )
527 *
528  9999 FORMAT( 1x, a, ', UPLO=''', a1, ''', N =', i5, ', type ', i2,
529  $ ', test ', i2, ', ratio =', g12.5 )
530  RETURN
531 *
532 * End of ZDRVSY_ROOK
533 *
subroutine xlaenv(ISPEC, NVALUE)
XLAENV
Definition: xlaenv.f:83
subroutine aladhd(IOUNIT, PATH)
ALADHD
Definition: aladhd.f:92
subroutine zsyt02(UPLO, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
ZSYT02
Definition: zsyt02.f:129
subroutine zlatms(M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, KL, KU, PACK, A, LDA, WORK, INFO)
ZLATMS
Definition: zlatms.f:334
subroutine alasvm(TYPE, NOUT, NFAIL, NRUN, NERRS)
ALASVM
Definition: alasvm.f:75
subroutine zsyt01_rook(UPLO, N, A, LDA, AFAC, LDAFAC, IPIV, C, LDC, RWORK, RESID)
ZSYT01_ROOK
Definition: zsyt01_rook.f:127
subroutine zlarhs(PATH, XTYPE, UPLO, TRANS, M, N, KL, KU, NRHS, A, LDA, X, LDX, B, LDB, ISEED, INFO)
ZLARHS
Definition: zlarhs.f:211
subroutine zsysv_rook(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)
ZSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices ...
Definition: zsysv_rook.f:206
subroutine zlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: zlaset.f:108
subroutine zsytri_rook(UPLO, N, A, LDA, IPIV, WORK, INFO)
ZSYTRI_ROOK
Definition: zsytri_rook.f:131
double precision function zlansy(NORM, UPLO, N, A, LDA, WORK)
ZLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex symmetric matrix.
Definition: zlansy.f:125
subroutine zlatsy(UPLO, N, X, LDX, ISEED)
ZLATSY
Definition: zlatsy.f:91
subroutine alaerh(PATH, SUBNAM, INFO, INFOE, OPTS, M, N, KL, KU, N5, IMAT, NFAIL, NERRS, NOUT)
ALAERH
Definition: alaerh.f:149
subroutine zpot05(UPLO, N, NRHS, A, LDA, B, LDB, X, LDX, XACT, LDXACT, FERR, BERR, RESLTS)
ZPOT05
Definition: zpot05.f:167
subroutine zsytrf_rook(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
ZSYTRF_ROOK
Definition: zsytrf_rook.f:210
subroutine zlatb4(PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE, CNDNUM, DIST)
ZLATB4
Definition: zlatb4.f:123
subroutine zget04(N, NRHS, X, LDX, XACT, LDXACT, RCOND, RESID)
ZGET04
Definition: zget04.f:104
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
Definition: zlacpy.f:105
subroutine zerrvx(PATH, NUNIT)
ZERRVX
Definition: zerrvx.f:57
Here is the call graph for this function:
Here is the caller graph for this function: