LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ cdrvhe_aa()

subroutine cdrvhe_aa ( logical, dimension( * )  dotype,
integer  nn,
integer, dimension( * )  nval,
integer  nrhs,
real  thresh,
logical  tsterr,
integer  nmax,
complex, dimension( * )  a,
complex, dimension( * )  afac,
complex, dimension( * )  ainv,
complex, dimension( * )  b,
complex, dimension( * )  x,
complex, dimension( * )  xact,
complex, dimension( * )  work,
real, dimension( * )  rwork,
integer, dimension( * )  iwork,
integer  nout 
)

CDRVHE_AA

Purpose:
 CDRVHE_AA tests the driver routine CHESV_AA.
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 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 COMPLEX array, dimension (NMAX*NMAX)
[out]AFAC
          AFAC is COMPLEX array, dimension (NMAX*NMAX)
[out]AINV
          AINV is COMPLEX array, dimension (NMAX*NMAX)
[out]B
          B is COMPLEX array, dimension (NMAX*NRHS)
[out]X
          X is COMPLEX array, dimension (NMAX*NRHS)
[out]XACT
          XACT is COMPLEX array, dimension (NMAX*NRHS)
[out]WORK
          WORK is COMPLEX array, dimension (NMAX*max(2,NRHS))
[out]RWORK
          RWORK is REAL 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.

Definition at line 150 of file cdrvhe_aa.f.

153*
154* -- LAPACK test routine --
155* -- LAPACK is a software package provided by Univ. of Tennessee, --
156* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
157*
158* .. Scalar Arguments ..
159 LOGICAL TSTERR
160 INTEGER NMAX, NN, NOUT, NRHS
161 REAL THRESH
162* ..
163* .. Array Arguments ..
164 LOGICAL DOTYPE( * )
165 INTEGER IWORK( * ), NVAL( * )
166 REAL RWORK( * )
167 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
168 $ WORK( * ), X( * ), XACT( * )
169* ..
170*
171* =====================================================================
172*
173* .. Parameters ..
174 REAL ONE, ZERO
175 parameter( one = 1.0e+0, zero = 0.0e+0 )
176 INTEGER NTYPES, NTESTS
177 parameter( ntypes = 10, ntests = 3 )
178 INTEGER NFACT
179 parameter( nfact = 2 )
180* ..
181* .. Local Scalars ..
182 LOGICAL ZEROT
183 CHARACTER DIST, FACT, TYPE, UPLO, XTYPE
184 CHARACTER*3 MATPATH, PATH
185 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
186 $ IZERO, J, K, KL, KU, LDA, LWORK, MODE, N,
187 $ NB, NBMIN, NERRS, NFAIL, NIMAT, NRUN, NT
188 REAL ANORM, CNDNUM
189* ..
190* .. Local Arrays ..
191 CHARACTER FACTS( NFACT ), UPLOS( 2 )
192 INTEGER ISEED( 4 ), ISEEDY( 4 )
193 REAL RESULT( NTESTS )
194* ..
195* .. External Functions ..
196 REAL CLANHE, SGET06
197 EXTERNAL clanhe, sget06
198* ..
199* .. External Subroutines ..
200 EXTERNAL aladhd, alaerh, alasvm, xlaenv, cerrvx,
203 $ chetrf_aa
204* ..
205* .. Scalars in Common ..
206 LOGICAL LERR, OK
207 CHARACTER*32 SRNAMT
208 INTEGER INFOT, NUNIT
209* ..
210* .. Common blocks ..
211 COMMON / infoc / infot, nunit, ok, lerr
212 COMMON / srnamc / srnamt
213* ..
214* .. Intrinsic Functions ..
215 INTRINSIC cmplx, max, min
216* ..
217* .. Data statements ..
218 DATA iseedy / 1988, 1989, 1990, 1991 /
219 DATA uplos / 'U', 'L' / , facts / 'F', 'N' /
220* ..
221* .. Executable Statements ..
222*
223* Initialize constants and the random number seed.
224*
225* Test path
226*
227 path( 1: 1 ) = 'Complex precision'
228 path( 2: 3 ) = 'HA'
229*
230* Path to generate matrices
231*
232 matpath( 1: 1 ) = 'Complex precision'
233 matpath( 2: 3 ) = 'HE'
234*
235 nrun = 0
236 nfail = 0
237 nerrs = 0
238 DO 10 i = 1, 4
239 iseed( i ) = iseedy( i )
240 10 CONTINUE
241*
242* Test the error exits
243*
244 IF( tsterr )
245 $ CALL cerrvx( path, nout )
246 infot = 0
247*
248* Set the block size and minimum block size for testing.
249*
250 nb = 1
251 nbmin = 2
252 CALL xlaenv( 1, nb )
253 CALL xlaenv( 2, nbmin )
254*
255* Do for each value of N in NVAL
256*
257 DO 180 in = 1, nn
258 n = nval( in )
259 lwork = max( 3*n-2, n*(1+nb) )
260 lwork = max( lwork, 1 )
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 CLATB4 for the matrix generator
288* based on the type of matrix to be generated.
289*
290 CALL clatb4( matpath, imat, n, n, TYPE, KL, KU, ANORM,
291 $ MODE, CNDNUM, DIST )
292*
293* Generate a matrix with CLATMS.
294*
295 srnamt = 'CLATMS'
296 CALL clatms( n, n, dist, iseed, TYPE, RWORK, MODE,
297 $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA,
298 $ WORK, INFO )
299*
300* Check error code from CLATMS and handle error.
301*
302 IF( info.NE.0 ) THEN
303 CALL alaerh( path, 'CLATMS', 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 = 'CLARHS'
389 CALL clarhs( matpath, xtype, uplo, ' ', n, n, kl, ku,
390 $ nrhs, a, lda, xact, lda, b, lda, iseed,
391 $ info )
392 xtype = 'C'
393*
394* --- Test CHESV_AA ---
395*
396 IF( ifact.EQ.2 ) THEN
397 CALL clacpy( uplo, n, n, a, lda, afac, lda )
398 CALL clacpy( 'Full', n, nrhs, b, lda, x, lda )
399*
400* Factor the matrix and solve the system using CHESV_AA.
401*
402 srnamt = 'CHESV_AA '
403 CALL chesv_aa( uplo, n, nrhs, afac, lda, iwork,
404 $ x, lda, work, lwork, info )
405*
406* Adjust the expected value of INFO to account for
407* pivoting.
408*
409 IF( izero.GT.0 ) THEN
410 j = 1
411 k = izero
412 100 CONTINUE
413 IF( j.EQ.k ) THEN
414 k = iwork( j )
415 ELSE IF( iwork( j ).EQ.k ) THEN
416 k = j
417 END IF
418 IF( j.LT.k ) THEN
419 j = j + 1
420 GO TO 100
421 END IF
422 ELSE
423 k = 0
424 END IF
425*
426* Check error code from CHESV_AA .
427*
428 IF( info.NE.k ) THEN
429 CALL alaerh( path, 'CHESV_AA', info, k,
430 $ uplo, n, n, -1, -1, nrhs,
431 $ imat, nfail, nerrs, nout )
432 GO TO 120
433 ELSE IF( info.NE.0 ) THEN
434 GO TO 120
435 END IF
436*
437* Reconstruct matrix from factors and compute
438* residual.
439*
440 CALL chet01_aa( uplo, n, a, lda, afac, lda,
441 $ iwork, ainv, lda, rwork,
442 $ result( 1 ) )
443*
444* Compute residual of the computed solution.
445*
446 CALL clacpy( 'Full', n, nrhs, b, lda, work, lda )
447 CALL cpot02( uplo, n, nrhs, a, lda, x, lda, work,
448 $ lda, rwork, result( 2 ) )
449 nt = 2
450*
451* Print information about the tests that did not pass
452* the threshold.
453*
454 DO 110 k = 1, nt
455 IF( result( k ).GE.thresh ) THEN
456 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
457 $ CALL aladhd( nout, path )
458 WRITE( nout, fmt = 9999 )'CHESV_AA ',
459 $ uplo, n, imat, k, result( k )
460 nfail = nfail + 1
461 END IF
462 110 CONTINUE
463 nrun = nrun + nt
464 120 CONTINUE
465 END IF
466*
467 150 CONTINUE
468*
469 160 CONTINUE
470 170 CONTINUE
471 180 CONTINUE
472*
473* Print a summary of the results.
474*
475 CALL alasvm( path, nout, nfail, nrun, nerrs )
476*
477 9999 FORMAT( 1x, a, ', UPLO=''', a1, ''', N =', i5, ', type ', i2,
478 $ ', test ', i2, ', ratio =', g12.5 )
479 RETURN
480*
481* End of CDRVHE_AA
482*
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
Definition alasvm.f:73
subroutine clarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
CLARHS
Definition clarhs.f:208
subroutine xlaenv(ispec, nvalue)
XLAENV
Definition xlaenv.f:81
subroutine aladhd(iounit, path)
ALADHD
Definition aladhd.f:90
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
Definition alaerh.f:147
subroutine cerrvx(path, nunit)
CERRVX
Definition cerrvx.f:55
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
Definition cget04.f:102
subroutine chet01_aa(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
CHET01_AA
Definition chet01_aa.f:124
subroutine clatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
CLATB4
Definition clatb4.f:121
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
Definition clatms.f:332
subroutine cpot02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CPOT02
Definition cpot02.f:127
subroutine chesv_aa(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
CHESV_AA computes the solution to system of linear equations A * X = B for HE matrices
Definition chesv_aa.f:162
subroutine chetrf_aa(uplo, n, a, lda, ipiv, work, lwork, info)
CHETRF_AA
Definition chetrf_aa.f:132
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
Definition clacpy.f:103
real function clanhe(norm, uplo, n, a, lda, work)
CLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition clanhe.f:124
real function sget06(rcond, rcondc)
SGET06
Definition sget06.f:55
Here is the call graph for this function:
Here is the caller graph for this function: