 LAPACK  3.10.1 LAPACK: Linear Algebra PACKage

## ◆ schksy_aa_2stage()

 subroutine schksy_aa_2stage ( logical, dimension( * ) DOTYPE, integer NN, integer, dimension( * ) NVAL, integer NNB, integer, dimension( * ) NBVAL, integer NNS, integer, dimension( * ) NSVAL, real THRESH, logical TSTERR, integer NMAX, real, dimension( * ) A, real, dimension( * ) AFAC, real, dimension( * ) AINV, real, dimension( * ) B, real, dimension( * ) X, real, dimension( * ) XACT, real, dimension( * ) WORK, real, dimension( * ) RWORK, integer, dimension( * ) IWORK, integer NOUT )

SCHKSY_AA_2STAGE

Purpose:
` SCHKSY_AA_2STAGE tests SSYTRF_AA_2STAGE, -TRS_AA_2STAGE.`
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] NNB ``` NNB is INTEGER The number of values of NB contained in the vector NBVAL.``` [in] NBVAL ``` NBVAL is INTEGER array, dimension (NNB) The values of the blocksize NB.``` [in] NNS ``` NNS is INTEGER The number of values of NRHS contained in the vector NSVAL.``` [in] NSVAL ``` NSVAL is INTEGER array, dimension (NNS) The values of the number of right hand sides NRHS.``` [in] THRESH ``` THRESH is REAL 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 REAL array, dimension (NMAX*NMAX)` [out] AFAC ` AFAC is REAL array, dimension (NMAX*NMAX)` [out] AINV ` AINV is REAL array, dimension (NMAX*NMAX)` [out] B ``` B is REAL array, dimension (NMAX*NSMAX) where NSMAX is the largest entry in NSVAL.``` [out] X ` X is REAL array, dimension (NMAX*NSMAX)` [out] XACT ` XACT is REAL array, dimension (NMAX*NSMAX)` [out] WORK ` WORK is REAL array, dimension (NMAX*max(3,NSMAX))` [out] RWORK ` RWORK is REAL array, dimension (max(NMAX,2*NSMAX))` [out] IWORK ` IWORK is INTEGER array, dimension (2*NMAX)` [in] NOUT ``` NOUT is INTEGER The unit number for output.```

Definition at line 168 of file schksy_aa_2stage.f.

171 *
172 * -- LAPACK test routine --
173 * -- LAPACK is a software package provided by Univ. of Tennessee, --
174 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
175 *
176  IMPLICIT NONE
177 *
178 * .. Scalar Arguments ..
179  LOGICAL TSTERR
180  INTEGER NN, NNB, NNS, NMAX, NOUT
181  REAL THRESH
182 * ..
183 * .. Array Arguments ..
184  LOGICAL DOTYPE( * )
185  INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
186  REAL A( * ), AFAC( * ), AINV( * ), B( * ),
187  \$ RWORK( * ), WORK( * ), X( * ), XACT( * )
188 * ..
189 *
190 * =====================================================================
191 *
192 * .. Parameters ..
193  REAL ZERO
194  parameter( zero = 0.0e+0 )
195  INTEGER NTYPES
196  parameter( ntypes = 10 )
197  INTEGER NTESTS
198  parameter( ntests = 9 )
199 * ..
200 * .. Local Scalars ..
201  LOGICAL ZEROT
202  CHARACTER DIST, TYPE, UPLO, XTYPE
203  CHARACTER*3 PATH, MATPATH
204  INTEGER I, I1, I2, IMAT, IN, INB, INFO, IOFF, IRHS,
205  \$ IUPLO, IZERO, J, K, KL, KU, LDA, LWORK, MODE,
206  \$ N, NB, NERRS, NFAIL, NIMAT, NRHS, NRUN, NT
207  REAL ANORM, CNDNUM
208 * ..
209 * .. Local Arrays ..
210  CHARACTER UPLOS( 2 )
211  INTEGER ISEED( 4 ), ISEEDY( 4 )
212  REAL RESULT( NTESTS )
213 * ..
214 * .. External Subroutines ..
215  EXTERNAL alaerh, alahd, alasum, serrsy, slacpy, slarhs,
218  \$ xlaenv
219 * ..
220 * .. Intrinsic Functions ..
221  INTRINSIC max, min
222 * ..
223 * .. Scalars in Common ..
224  LOGICAL LERR, OK
225  CHARACTER*32 SRNAMT
226  INTEGER INFOT, NUNIT
227 * ..
228 * .. Common blocks ..
229  COMMON / infoc / infot, nunit, ok, lerr
230  COMMON / srnamc / srnamt
231 * ..
232 * .. Data statements ..
233  DATA iseedy / 1988, 1989, 1990, 1991 /
234  DATA uplos / 'U', 'L' /
235 * ..
236 * .. Executable Statements ..
237 *
238 * Initialize constants and the random number seed.
239 *
240 *
241 * Test path
242 *
243  path( 1: 1 ) = 'Single precision'
244  path( 2: 3 ) = 'S2'
245 *
246 * Path to generate matrices
247 *
248  matpath( 1: 1 ) = 'Single precision'
249  matpath( 2: 3 ) = 'SY'
250  nrun = 0
251  nfail = 0
252  nerrs = 0
253  DO 10 i = 1, 4
254  iseed( i ) = iseedy( i )
255  10 CONTINUE
256 *
257 * Test the error exits
258 *
259  IF( tsterr )
260  \$ CALL serrsy( path, nout )
261  infot = 0
262 *
263 * Set the minimum block size for which the block routine should
264 * be used, which will be later returned by ILAENV
265 *
266  CALL xlaenv( 2, 2 )
267 *
268 * Do for each value of N in NVAL
269 *
270  DO 180 in = 1, nn
271  n = nval( in )
272  IF( n .GT. nmax ) THEN
273  nfail = nfail + 1
274  WRITE(nout, 9995) 'M ', n, nmax
275  GO TO 180
276  END IF
277  lda = max( n, 1 )
278  xtype = 'N'
279  nimat = ntypes
280  IF( n.LE.0 )
281  \$ nimat = 1
282 *
283  izero = 0
284 *
285 * Do for each value of matrix type IMAT
286 *
287  DO 170 imat = 1, nimat
288 *
289 * Do the tests only if DOTYPE( IMAT ) is true.
290 *
291  IF( .NOT.dotype( imat ) )
292  \$ GO TO 170
293 *
294 * Skip types 3, 4, 5, or 6 if the matrix size is too small.
295 *
296  zerot = imat.GE.3 .AND. imat.LE.6
297  IF( zerot .AND. n.LT.imat-2 )
298  \$ GO TO 170
299 *
300 * Do first for UPLO = 'U', then for UPLO = 'L'
301 *
302  DO 160 iuplo = 1, 2
303  uplo = uplos( iuplo )
304 *
305 * Begin generate the test matrix A.
306 *
307 *
308 * Set up parameters with SLATB4 for the matrix generator
309 * based on the type of matrix to be generated.
310 *
311  CALL slatb4( matpath, imat, n, n, TYPE, KL, KU,
312  \$ ANORM, MODE, CNDNUM, DIST )
313 *
314 * Generate a matrix with SLATMS.
315 *
316  srnamt = 'SLATMS'
317  CALL slatms( n, n, dist, iseed, TYPE, RWORK, MODE,
318  \$ CNDNUM, ANORM, KL, KU, UPLO, A, LDA, WORK,
319  \$ INFO )
320 *
321 * Check error code from SLATMS and handle error.
322 *
323  IF( info.NE.0 ) THEN
324  CALL alaerh( path, 'SLATMS', info, 0, uplo, n, n, -1,
325  \$ -1, -1, imat, nfail, nerrs, nout )
326 *
327 * Skip all tests for this generated matrix
328 *
329  GO TO 160
330  END IF
331 *
332 * For matrix types 3-6, zero one or more rows and
333 * columns of the matrix to test that INFO is returned
334 * correctly.
335 *
336  IF( zerot ) THEN
337  IF( imat.EQ.3 ) THEN
338  izero = 1
339  ELSE IF( imat.EQ.4 ) THEN
340  izero = n
341  ELSE
342  izero = n / 2 + 1
343  END IF
344 *
345  IF( imat.LT.6 ) THEN
346 *
347 * Set row and column IZERO to zero.
348 *
349  IF( iuplo.EQ.1 ) THEN
350  ioff = ( izero-1 )*lda
351  DO 20 i = 1, izero - 1
352  a( ioff+i ) = zero
353  20 CONTINUE
354  ioff = ioff + izero
355  DO 30 i = izero, n
356  a( ioff ) = zero
357  ioff = ioff + lda
358  30 CONTINUE
359  ELSE
360  ioff = izero
361  DO 40 i = 1, izero - 1
362  a( ioff ) = zero
363  ioff = ioff + lda
364  40 CONTINUE
365  ioff = ioff - izero
366  DO 50 i = izero, n
367  a( ioff+i ) = zero
368  50 CONTINUE
369  END IF
370  ELSE
371  IF( iuplo.EQ.1 ) THEN
372 *
373 * Set the first IZERO rows and columns to zero.
374 *
375  ioff = 0
376  DO 70 j = 1, n
377  i2 = min( j, izero )
378  DO 60 i = 1, i2
379  a( ioff+i ) = zero
380  60 CONTINUE
381  ioff = ioff + lda
382  70 CONTINUE
383  izero = 1
384  ELSE
385 *
386 * Set the last IZERO rows and columns to zero.
387 *
388  ioff = 0
389  DO 90 j = 1, n
390  i1 = max( j, izero )
391  DO 80 i = i1, n
392  a( ioff+i ) = zero
393  80 CONTINUE
394  ioff = ioff + lda
395  90 CONTINUE
396  END IF
397  END IF
398  ELSE
399  izero = 0
400  END IF
401 *
402 * End generate the test matrix A.
403 *
404 * Do for each value of NB in NBVAL
405 *
406  DO 150 inb = 1, nnb
407 *
408 * Set the optimal blocksize, which will be later
409 * returned by ILAENV.
410 *
411  nb = nbval( inb )
412  CALL xlaenv( 1, nb )
413 *
414 * Copy the test matrix A into matrix AFAC which
415 * will be factorized in place. This is needed to
416 * preserve the test matrix A for subsequent tests.
417 *
418  CALL slacpy( uplo, n, n, a, lda, afac, lda )
419 *
420 * Compute the L*D*L**T or U*D*U**T factorization of the
421 * matrix. IWORK stores details of the interchanges and
422 * the block structure of D. AINV is a work array for
423 * block factorization, LWORK is the length of AINV.
424 *
425  srnamt = 'SSYTRF_AA_2STAGE'
426  lwork = min(n*nb, 3*nmax*nmax)
427  CALL ssytrf_aa_2stage( uplo, n, afac, lda,
428  \$ ainv, (3*nb+1)*n,
429  \$ iwork, iwork( 1+n ),
430  \$ work, lwork,
431  \$ info )
432 *
433 * Adjust the expected value of INFO to account for
434 * pivoting.
435 *
436  IF( izero.GT.0 ) THEN
437  j = 1
438  k = izero
439  100 CONTINUE
440  IF( j.EQ.k ) THEN
441  k = iwork( j )
442  ELSE IF( iwork( j ).EQ.k ) THEN
443  k = j
444  END IF
445  IF( j.LT.k ) THEN
446  j = j + 1
447  GO TO 100
448  END IF
449  ELSE
450  k = 0
451  END IF
452 *
453 * Check error code from SSYTRF and handle error.
454 *
455  IF( info.NE.k ) THEN
456  CALL alaerh( path, 'SSYTRF_AA_2STAGE', info, k,
457  \$ uplo, n, n, -1, -1, nb, imat, nfail,
458  \$ nerrs, nout )
459  END IF
460 *
461 *+ TEST 1
462 * Reconstruct matrix from factors and compute residual.
463 *
464 * CALL SSYT01_AA( UPLO, N, A, LDA, AFAC, LDA, IWORK,
465 * \$ AINV, LDA, RWORK, RESULT( 1 ) )
466 * NT = 1
467  nt = 0
468 *
469 *
470 * Print information about the tests that did not pass
471 * the threshold.
472 *
473  DO 110 k = 1, nt
474  IF( result( k ).GE.thresh ) THEN
475  IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
476  \$ CALL alahd( nout, path )
477  WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
478  \$ result( k )
479  nfail = nfail + 1
480  END IF
481  110 CONTINUE
482  nrun = nrun + nt
483 *
484 * Skip solver test if INFO is not 0.
485 *
486  IF( info.NE.0 ) THEN
487  GO TO 140
488  END IF
489 *
490 * Do for each value of NRHS in NSVAL.
491 *
492  DO 130 irhs = 1, nns
493  nrhs = nsval( irhs )
494 *
495 *+ TEST 2 (Using TRS)
496 * Solve and compute residual for A * X = B.
497 *
498 * Choose a set of NRHS random solution vectors
499 * stored in XACT and set up the right hand side B
500 *
501  srnamt = 'SLARHS'
502  CALL slarhs( matpath, xtype, uplo, ' ', n, n,
503  \$ kl, ku, nrhs, a, lda, xact, lda,
504  \$ b, lda, iseed, info )
505  CALL slacpy( 'Full', n, nrhs, b, lda, x, lda )
506 *
507  srnamt = 'SSYTRS_AA_2STAGE'
508  lwork = max( 1, 3*n-2 )
509  CALL ssytrs_aa_2stage( uplo, n, nrhs, afac, lda,
510  \$ ainv, (3*nb+1)*n, iwork, iwork( 1+n ),
511  \$ x, lda, info )
512 *
513 * Check error code from SSYTRS and handle error.
514 *
515  IF( info.NE.0 ) THEN
516  IF( izero.EQ.0 ) THEN
517  CALL alaerh( path, 'SSYTRS_AA_2STAGE',
518  \$ info, 0, uplo, n, n, -1, -1,
519  \$ nrhs, imat, nfail, nerrs, nout )
520  END IF
521  ELSE
522  CALL slacpy( 'Full', n, nrhs, b, lda, work, lda
523  \$ )
524 *
525 * Compute the residual for the solution
526 *
527  CALL spot02( uplo, n, nrhs, a, lda, x, lda,
528  \$ work, lda, rwork, result( 2 ) )
529 *
530 *
531 * Print information about the tests that did not pass
532 * the threshold.
533 *
534  DO 120 k = 2, 2
535  IF( result( k ).GE.thresh ) THEN
536  IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
537  \$ CALL alahd( nout, path )
538  WRITE( nout, fmt = 9998 )uplo, n, nrhs,
539  \$ imat, k, result( k )
540  nfail = nfail + 1
541  END IF
542  120 CONTINUE
543  END IF
544  nrun = nrun + 1
545 *
546 * End do for each value of NRHS in NSVAL.
547 *
548  130 CONTINUE
549  140 CONTINUE
550  150 CONTINUE
551  160 CONTINUE
552  170 CONTINUE
553  180 CONTINUE
554 *
555 * Print a summary of the results.
556 *
557  CALL alasum( path, nout, nfail, nrun, nerrs )
558 *
559  9999 FORMAT( ' UPLO = ''', a1, ''', N =', i5, ', NB =', i4, ', type ',
560  \$ i2, ', test ', i2, ', ratio =', g12.5 )
561  9998 FORMAT( ' UPLO = ''', a1, ''', N =', i5, ', NRHS=', i3, ', type ',
562  \$ i2, ', test(', i2, ') =', g12.5 )
563  9995 FORMAT( ' Invalid input value: ', a4, '=', i6, '; must be <=',
564  \$ i6 )
565  RETURN
566 *
567 * End of SCHKSY_AA_2STAGE
568 *
subroutine slacpy(UPLO, M, N, A, LDA, B, LDB)
SLACPY copies all or part of one two-dimensional array to another.
Definition: slacpy.f:103
subroutine alasum(TYPE, NOUT, NFAIL, NRUN, NERRS)
ALASUM
Definition: alasum.f:73
subroutine xlaenv(ISPEC, NVALUE)
XLAENV
Definition: xlaenv.f:81
subroutine alahd(IOUNIT, PATH)
ALAHD
Definition: alahd.f:107
subroutine alaerh(PATH, SUBNAM, INFO, INFOE, OPTS, M, N, KL, KU, N5, IMAT, NFAIL, NERRS, NOUT)
ALAERH
Definition: alaerh.f:147
subroutine slatms(M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, KL, KU, PACK, A, LDA, WORK, INFO)
SLATMS
Definition: slatms.f:321
subroutine ssytrs_aa_2stage(UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, INFO)
SSYTRS_AA_2STAGE
subroutine ssytrf_aa_2stage(UPLO, N, A, LDA, TB, LTB, IPIV, IPIV2, WORK, LWORK, INFO)
SSYTRF_AA_2STAGE
subroutine slarhs(PATH, XTYPE, UPLO, TRANS, M, N, KL, KU, NRHS, A, LDA, X, LDX, B, LDB, ISEED, INFO)
SLARHS
Definition: slarhs.f:205
subroutine slatb4(PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE, CNDNUM, DIST)
SLATB4
Definition: slatb4.f:120
subroutine serrsy(PATH, NUNIT)
SERRSY
Definition: serrsy.f:55
subroutine spot02(UPLO, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
SPOT02
Definition: spot02.f:127
subroutine ssyt01_aa(UPLO, N, A, LDA, AFAC, LDAFAC, IPIV, C, LDC, RWORK, RESID)
SSYT01_AA
Definition: ssyt01_aa.f:124
Here is the call graph for this function:
Here is the caller graph for this function: