 LAPACK  3.10.0 LAPACK: Linear Algebra PACKage

◆ zdrvhe_aa_2stage()

 subroutine zdrvhe_aa_2stage ( 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 )

ZDRVHE_AA_2STAGE

Purpose:
ZDRVHE_AA_2STAGE tests the driver routine ZHESV_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] 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.

Definition at line 151 of file zdrvhe_aa_2stage.f.

155 *
156 * -- LAPACK test routine --
157 * -- LAPACK is a software package provided by Univ. of Tennessee, --
158 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
159 *
160 * .. Scalar Arguments ..
161  LOGICAL TSTERR
162  INTEGER NMAX, NN, NOUT, NRHS
163  DOUBLE PRECISION THRESH
164 * ..
165 * .. Array Arguments ..
166  LOGICAL DOTYPE( * )
167  INTEGER IWORK( * ), NVAL( * )
168  DOUBLE PRECISION RWORK( * )
169  COMPLEX*16 A( * ), AFAC( * ), AINV( * ), B( * ),
170  \$ WORK( * ), X( * ), XACT( * )
171 * ..
172 *
173 * =====================================================================
174 *
175 * .. Parameters ..
176  DOUBLE PRECISION ONE, ZERO
177  parameter( one = 1.0d+0, zero = 0.0d+0 )
178  INTEGER NTYPES, NTESTS
179  parameter( ntypes = 10, ntests = 3 )
180  INTEGER NFACT
181  parameter( nfact = 2 )
182 * ..
183 * .. Local Scalars ..
184  LOGICAL ZEROT
185  CHARACTER DIST, FACT, TYPE, UPLO, XTYPE
186  CHARACTER*3 MATPATH, PATH
187  INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
188  \$ IZERO, J, K, KL, KU, LDA, LWORK, MODE, N,
189  \$ NB, NBMIN, NERRS, NFAIL, NIMAT, NRUN, NT
190  DOUBLE PRECISION ANORM, CNDNUM
191 * ..
192 * .. Local Arrays ..
193  CHARACTER FACTS( NFACT ), UPLOS( 2 )
194  INTEGER ISEED( 4 ), ISEEDY( 4 )
195  DOUBLE PRECISION RESULT( NTESTS )
196 * ..
197 * .. External Functions ..
198  DOUBLE PRECISION DGET06, ZLANHE
199  EXTERNAL dget06, zlanhe
200 * ..
201 * .. External Subroutines ..
202  EXTERNAL aladhd, alaerh, alasvm, xlaenv, zerrvx,
206 * ..
207 * .. Scalars in Common ..
208  LOGICAL LERR, OK
209  CHARACTER*32 SRNAMT
210  INTEGER INFOT, NUNIT
211 * ..
212 * .. Common blocks ..
213  COMMON / infoc / infot, nunit, ok, lerr
214  COMMON / srnamc / srnamt
215 * ..
216 * .. Intrinsic Functions ..
217  INTRINSIC dcmplx, max, min
218 * ..
219 * .. Data statements ..
220  DATA iseedy / 1988, 1989, 1990, 1991 /
221  DATA uplos / 'U', 'L' / , facts / 'F', 'N' /
222 * ..
223 * .. Executable Statements ..
224 *
225 * Initialize constants and the random number seed.
226 *
227 * Test path
228 *
229  path( 1: 1 ) = 'Zomplex precision'
230  path( 2: 3 ) = 'H2'
231 *
232 * Path to generate matrices
233 *
234  matpath( 1: 1 ) = 'Zomplex precision'
235  matpath( 2: 3 ) = 'HE'
236 *
237  nrun = 0
238  nfail = 0
239  nerrs = 0
240  DO 10 i = 1, 4
241  iseed( i ) = iseedy( i )
242  10 CONTINUE
243 *
244 * Test the error exits
245 *
246  IF( tsterr )
247  \$ CALL zerrvx( path, nout )
248  infot = 0
249 *
250 * Set the block size and minimum block size for testing.
251 *
252  nb = 1
253  nbmin = 2
254  CALL xlaenv( 1, nb )
255  CALL xlaenv( 2, nbmin )
256 *
257 * Do for each value of N in NVAL
258 *
259  DO 180 in = 1, nn
260  n = nval( in )
261  lda = max( n, 1 )
262  xtype = 'N'
263  nimat = ntypes
264  IF( n.LE.0 )
265  \$ nimat = 1
266 *
267  DO 170 imat = 1, nimat
268 *
269 * Do the tests only if DOTYPE( IMAT ) is true.
270 *
271  IF( .NOT.dotype( imat ) )
272  \$ GO TO 170
273 *
274 * Skip types 3, 4, 5, or 6 if the matrix size is too small.
275 *
276  zerot = imat.GE.3 .AND. imat.LE.6
277  IF( zerot .AND. n.LT.imat-2 )
278  \$ GO TO 170
279 *
280 * Do first for UPLO = 'U', then for UPLO = 'L'
281 *
282  DO 160 iuplo = 1, 2
283  uplo = uplos( iuplo )
284 *
285 * Begin generate the test matrix A.
286 *
287 * Set up parameters with ZLATB4 for the matrix generator
288 * based on the type of matrix to be generated.
289 *
290  CALL zlatb4( matpath, imat, n, n, TYPE, KL, KU, ANORM,
291  \$ MODE, CNDNUM, DIST )
292 *
293 * Generate a matrix with ZLATMS.
294 *
295  srnamt = 'ZLATMS'
296  CALL zlatms( n, n, dist, iseed, TYPE, RWORK, MODE,
297  \$ CNDNUM, ANORM, KL, KU, UPLO, A, LDA,
298  \$ WORK, INFO )
299 *
300 * Check error code from ZLATMS and handle error.
301 *
302  IF( info.NE.0 ) THEN
303  CALL alaerh( path, 'ZLATMS', info, 0, uplo, n, n,
304  \$ -1, -1, -1, imat, nfail, nerrs, nout )
305  GO TO 160
306  END IF
307 *
308 * For types 3-6, zero one or more rows and columns of
309 * the matrix to test that INFO is returned correctly.
310 *
311  IF( zerot ) THEN
312  IF( imat.EQ.3 ) THEN
313  izero = 1
314  ELSE IF( imat.EQ.4 ) THEN
315  izero = n
316  ELSE
317  izero = n / 2 + 1
318  END IF
319 *
320  IF( imat.LT.6 ) THEN
321 *
322 * Set row and column IZERO to zero.
323 *
324  IF( iuplo.EQ.1 ) THEN
325  ioff = ( izero-1 )*lda
326  DO 20 i = 1, izero - 1
327  a( ioff+i ) = zero
328  20 CONTINUE
329  ioff = ioff + izero
330  DO 30 i = izero, n
331  a( ioff ) = zero
332  ioff = ioff + lda
333  30 CONTINUE
334  ELSE
335  ioff = izero
336  DO 40 i = 1, izero - 1
337  a( ioff ) = zero
338  ioff = ioff + lda
339  40 CONTINUE
340  ioff = ioff - izero
341  DO 50 i = izero, n
342  a( ioff+i ) = zero
343  50 CONTINUE
344  END IF
345  ELSE
346  ioff = 0
347  IF( iuplo.EQ.1 ) THEN
348 *
349 * Set the first IZERO rows and columns to zero.
350 *
351  DO 70 j = 1, n
352  i2 = min( j, izero )
353  DO 60 i = 1, i2
354  a( ioff+i ) = zero
355  60 CONTINUE
356  ioff = ioff + lda
357  70 CONTINUE
358  izero = 1
359  ELSE
360 *
361 * Set the first IZERO rows and columns to zero.
362 *
363  ioff = 0
364  DO 90 j = 1, n
365  i1 = max( j, izero )
366  DO 80 i = i1, n
367  a( ioff+i ) = zero
368  80 CONTINUE
369  ioff = ioff + lda
370  90 CONTINUE
371  END IF
372  END IF
373  ELSE
374  izero = 0
375  END IF
376 *
377 * End generate the test matrix A.
378 *
379 *
380  DO 150 ifact = 1, nfact
381 *
382 * Do first for FACT = 'F', then for other values.
383 *
384  fact = facts( ifact )
385 *
386 * Form an exact solution and set the right hand side.
387 *
388  srnamt = 'ZLARHS'
389  CALL zlarhs( matpath, xtype, uplo, ' ', n, n, kl, ku,
390  \$ nrhs, a, lda, xact, lda, b, lda, iseed,
391  \$ info )
392  xtype = 'C'
393 *
394 * --- Test ZHESV_AA_2STAGE ---
395 *
396  IF( ifact.EQ.2 ) THEN
397  CALL zlacpy( uplo, n, n, a, lda, afac, lda )
398  CALL zlacpy( 'Full', n, nrhs, b, lda, x, lda )
399 *
400 * Factor the matrix and solve the system using ZHESV_AA.
401 *
402  srnamt = 'ZHESV_AA_2STAGE '
403  lwork = min(n*nb, 3*nmax*nmax)
404  CALL zhesv_aa_2stage( uplo, n, nrhs, afac, lda,
405  \$ ainv, (3*nb+1)*n,
406  \$ iwork, iwork( 1+n ),
407  \$ x, lda, work, lwork, info )
408 *
409 * Adjust the expected value of INFO to account for
410 * pivoting.
411 *
412  IF( izero.GT.0 ) THEN
413  j = 1
414  k = izero
415  100 CONTINUE
416  IF( j.EQ.k ) THEN
417  k = iwork( j )
418  ELSE IF( iwork( j ).EQ.k ) THEN
419  k = j
420  END IF
421  IF( j.LT.k ) THEN
422  j = j + 1
423  GO TO 100
424  END IF
425  ELSE
426  k = 0
427  END IF
428 *
429 * Check error code from ZHESV_AA .
430 *
431  IF( info.NE.k ) THEN
432  CALL alaerh( path, 'ZHESV_AA', info, k,
433  \$ uplo, n, n, -1, -1, nrhs,
434  \$ imat, nfail, nerrs, nout )
435  GO TO 120
436  ELSE IF( info.NE.0 ) THEN
437  GO TO 120
438  END IF
439 *
440 * Compute residual of the computed solution.
441 *
442  CALL zlacpy( 'Full', n, nrhs, b, lda, work, lda )
443  CALL zpot02( uplo, n, nrhs, a, lda, x, lda, work,
444  \$ lda, rwork, result( 1 ) )
445 *
446 * Reconstruct matrix from factors and compute
447 * residual.
448 *
449 * NEED TO CREATE ZHET01_AA_2STAGE
450 * CALL ZHET01_AA( UPLO, N, A, LDA, AFAC, LDA,
451 * \$ IWORK, AINV, LDA, RWORK,
452 * \$ RESULT( 2 ) )
453 * NT = 2
454  nt = 1
455 *
456 * Print information about the tests that did not pass
457 * the threshold.
458 *
459  DO 110 k = 1, nt
460  IF( result( k ).GE.thresh ) THEN
461  IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
462  \$ CALL aladhd( nout, path )
463  WRITE( nout, fmt = 9999 )'ZHESV_AA_2STAGE',
464  \$ uplo, n, imat, k, result( k )
465  nfail = nfail + 1
466  END IF
467  110 CONTINUE
468  nrun = nrun + nt
469  120 CONTINUE
470  END IF
471 *
472  150 CONTINUE
473 *
474  160 CONTINUE
475  170 CONTINUE
476  180 CONTINUE
477 *
478 * Print a summary of the results.
479 *
480  CALL alasvm( path, nout, nfail, nrun, nerrs )
481 *
482  9999 FORMAT( 1x, a, ', UPLO=''', a1, ''', N =', i5, ', type ', i2,
483  \$ ', test ', i2, ', ratio =', g12.5 )
484  RETURN
485 *
486 * End of ZDRVHE_AA_2STAGE
487 *
subroutine alasvm(TYPE, NOUT, NFAIL, NRUN, NERRS)
ALASVM
Definition: alasvm.f:73
subroutine xlaenv(ISPEC, NVALUE)
XLAENV
Definition: xlaenv.f:81
subroutine alaerh(PATH, SUBNAM, INFO, INFOE, OPTS, M, N, KL, KU, N5, IMAT, NFAIL, NERRS, NOUT)
ALAERH
Definition: alaerh.f:147
subroutine zlarhs(PATH, XTYPE, UPLO, TRANS, M, N, KL, KU, NRHS, A, LDA, X, LDX, B, LDB, ISEED, INFO)
ZLARHS
Definition: zlarhs.f:208
subroutine zerrvx(PATH, NUNIT)
ZERRVX
Definition: zerrvx.f:55
subroutine zget04(N, NRHS, X, LDX, XACT, LDXACT, RCOND, RESID)
ZGET04
Definition: zget04.f:102
subroutine zpot02(UPLO, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
ZPOT02
Definition: zpot02.f:127
subroutine zlatb4(PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE, CNDNUM, DIST)
ZLATB4
Definition: zlatb4.f:121
subroutine zhet01_aa(UPLO, N, A, LDA, AFAC, LDAFAC, IPIV, C, LDC, RWORK, RESID)
ZHET01_AA
Definition: zhet01_aa.f:124
subroutine zlatms(M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, KL, KU, PACK, A, LDA, WORK, INFO)
ZLATMS
Definition: zlatms.f:332
double precision function zlanhe(NORM, UPLO, N, A, LDA, WORK)
ZLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition: zlanhe.f:124
subroutine zhesv_aa_2stage(UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, WORK, LWORK, INFO)
ZHESV_AA_2STAGE 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.
Definition: zlacpy.f:103
subroutine zhetrf_aa_2stage(UPLO, N, A, LDA, TB, LTB, IPIV, IPIV2, WORK, LWORK, INFO)
ZHETRF_AA_2STAGE
double precision function dget06(RCOND, RCONDC)
DGET06
Definition: dget06.f:55
Here is the call graph for this function:
Here is the caller graph for this function: