50 parameter ( nin = 5, nout = 6 )
52 parameter ( nsubs = 9 )
54 parameter ( zero = ( 0.0d0, 0.0d0 ),
55 $ one = ( 1.0d0, 0.0d0 ) )
56 DOUBLE PRECISION RZERO, RHALF, RONE
57 parameter ( rzero = 0.0d0, rhalf = 0.5d0, rone = 1.0d0 )
59 parameter ( nmax = 65 )
60 INTEGER NIDMAX, NALMAX, NBEMAX
61 parameter ( nidmax = 9, nalmax = 7, nbemax = 7 )
63 DOUBLE PRECISION EPS, ERR, THRESH
64 INTEGER I, ISNUM, J, N, NALF, NBET, NIDIM, NTRA,
66 LOGICAL FATAL, LTESTT, REWI, SAME, SFATAL, TRACE,
67 $ tsterr, corder, rorder
68 CHARACTER*1 TRANSA, TRANSB
72 COMPLEX*16 AA( nmax*nmax ), AB( nmax, 2*nmax ),
73 $ alf( nalmax ), as( nmax*nmax ),
74 $ bb( nmax*nmax ), bet( nbemax ),
75 $ bs( nmax*nmax ), c( nmax, nmax ),
76 $ cc( nmax*nmax ), cs( nmax*nmax ), ct( nmax ),
78 DOUBLE PRECISION G( nmax )
79 INTEGER IDIM( nidmax )
80 LOGICAL LTEST( nsubs )
81 CHARACTER*12 SNAMES( nsubs )
83 DOUBLE PRECISION DDIFF
95 COMMON /infoc/infot, noutc, ok, lerr
98 DATA snames/
'cblas_zgemm ',
'cblas_zhemm ',
99 $
'cblas_zsymm ',
'cblas_ztrmm ',
'cblas_ztrsm ',
100 $
'cblas_zherk ',
'cblas_zsyrk ',
'cblas_zher2k',
108 READ( nin, fmt = * )snaps
109 READ( nin, fmt = * )ntra
112 OPEN( ntra, file = snaps, status =
'NEW' )
115 READ( nin, fmt = * )rewi
116 rewi = rewi.AND.trace
118 READ( nin, fmt = * )sfatal
120 READ( nin, fmt = * )tsterr
122 READ( nin, fmt = * )layout
124 READ( nin, fmt = * )thresh
129 READ( nin, fmt = * )nidim
130 IF( nidim.LT.1.OR.nidim.GT.nidmax )
THEN
131 WRITE( nout, fmt = 9997 )
'N', nidmax
134 READ( nin, fmt = * )( idim( i ), i = 1, nidim )
136 IF( idim( i ).LT.0.OR.idim( i ).GT.nmax )
THEN
137 WRITE( nout, fmt = 9996 )nmax
142 READ( nin, fmt = * )nalf
143 IF( nalf.LT.1.OR.nalf.GT.nalmax )
THEN
144 WRITE( nout, fmt = 9997 )
'ALPHA', nalmax
147 READ( nin, fmt = * )( alf( i ), i = 1, nalf )
149 READ( nin, fmt = * )nbet
150 IF( nbet.LT.1.OR.nbet.GT.nbemax )
THEN
151 WRITE( nout, fmt = 9997 )
'BETA', nbemax
154 READ( nin, fmt = * )( bet( i ), i = 1, nbet )
158 WRITE( nout, fmt = 9995 )
159 WRITE( nout, fmt = 9994 )( idim( i ), i = 1, nidim )
160 WRITE( nout, fmt = 9993 )( alf( i ), i = 1, nalf )
161 WRITE( nout, fmt = 9992 )( bet( i ), i = 1, nbet )
162 IF( .NOT.tsterr )
THEN
163 WRITE( nout, fmt = * )
164 WRITE( nout, fmt = 9984 )
166 WRITE( nout, fmt = * )
167 WRITE( nout, fmt = 9999 )thresh
168 WRITE( nout, fmt = * )
172 IF (layout.EQ.2)
THEN
175 WRITE( *, fmt = 10002 )
176 ELSE IF (layout.EQ.1)
THEN
178 WRITE( *, fmt = 10001 )
179 ELSE IF (layout.EQ.0)
THEN
181 WRITE( *, fmt = 10000 )
192 30
READ( nin, fmt = 9988, end = 60 )snamet, ltestt
194 IF( snamet.EQ.snames( i ) )
197 WRITE( nout, fmt = 9990 )snamet
199 50 ltest( i ) = ltestt
209 IF( ddiff( rone + eps, rone ).EQ.rzero )
215 WRITE( nout, fmt = 9998 )eps
222 ab( i, j ) = max( i - j + 1, 0 )
224 ab( j, nmax + 1 ) = j
225 ab( 1, nmax + j ) = j
229 cc( j ) = j*( ( j + 1 )*j )/2 - ( ( j + 1 )*j*( j - 1 ) )/3
235 CALL zmmch( transa, transb, n, 1, n, one, ab, nmax,
236 $ ab( 1, nmax + 1 ), nmax, zero, c, nmax, ct, g, cc,
237 $ nmax, eps, err, fatal, nout, .true. )
238 same = lze( cc, ct, n )
239 IF( .NOT.same.OR.err.NE.rzero )
THEN
240 WRITE( nout, fmt = 9989 )transa, transb, same, err
244 CALL zmmch( transa, transb, n, 1, n, one, ab, nmax,
245 $ ab( 1, nmax + 1 ), nmax, zero, c, nmax, ct, g, cc,
246 $ nmax, eps, err, fatal, nout, .true. )
247 same = lze( cc, ct, n )
248 IF( .NOT.same.OR.err.NE.rzero )
THEN
249 WRITE( nout, fmt = 9989 )transa, transb, same, err
253 ab( j, nmax + 1 ) = n - j + 1
254 ab( 1, nmax + j ) = n - j + 1
257 cc( n - j + 1 ) = j*( ( j + 1 )*j )/2 -
258 $ ( ( j + 1 )*j*( j - 1 ) )/3
262 CALL zmmch( transa, transb, n, 1, n, one, ab, nmax,
263 $ ab( 1, nmax + 1 ), nmax, zero, c, nmax, ct, g, cc,
264 $ nmax, eps, err, fatal, nout, .true. )
265 same = lze( cc, ct, n )
266 IF( .NOT.same.OR.err.NE.rzero )
THEN
267 WRITE( nout, fmt = 9989 )transa, transb, same, err
271 CALL zmmch( transa, transb, n, 1, n, one, ab, nmax,
272 $ ab( 1, nmax + 1 ), nmax, zero, c, nmax, ct, g, cc,
273 $ nmax, eps, err, fatal, nout, .true. )
274 same = lze( cc, ct, n )
275 IF( .NOT.same.OR.err.NE.rzero )
THEN
276 WRITE( nout, fmt = 9989 )transa, transb, same, err
282 DO 200 isnum = 1, nsubs
283 WRITE( nout, fmt = * )
284 IF( .NOT.ltest( isnum ) )
THEN
286 WRITE( nout, fmt = 9987 )snames( isnum )
288 srnamt = snames( isnum )
291 CALL cz3chke( snames( isnum ) )
292 WRITE( nout, fmt = * )
298 GO TO ( 140, 150, 150, 160, 160, 170, 170,
302 CALL zchk1(snames( isnum ), eps, thresh, nout, ntra, trace,
303 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
304 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
308 CALL zchk1(snames( isnum ), eps, thresh, nout, ntra, trace,
309 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
310 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
316 CALL zchk2(snames( isnum ), eps, thresh, nout, ntra, trace,
317 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
318 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
322 CALL zchk2(snames( isnum ), eps, thresh, nout, ntra, trace,
323 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
324 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
330 CALL zchk3(snames( isnum ), eps, thresh, nout, ntra, trace,
331 $ rewi, fatal, nidim, idim, nalf, alf, nmax, ab,
332 $ aa, as, ab( 1, nmax + 1 ), bb, bs, ct, g, c,
336 CALL zchk3(snames( isnum ), eps, thresh, nout, ntra, trace,
337 $ rewi, fatal, nidim, idim, nalf, alf, nmax, ab,
338 $ aa, as, ab( 1, nmax + 1 ), bb, bs, ct, g, c,
344 CALL zchk4(snames( isnum ), eps, thresh, nout, ntra, trace,
345 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
346 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
350 CALL zchk4(snames( isnum ), eps, thresh, nout, ntra, trace,
351 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
352 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
358 CALL zchk5(snames( isnum ), eps, thresh, nout, ntra, trace,
359 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
360 $ nmax, ab, aa, as, bb, bs, c, cc, cs, ct, g, w,
364 CALL zchk5(snames( isnum ), eps, thresh, nout, ntra, trace,
365 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
366 $ nmax, ab, aa, as, bb, bs, c, cc, cs, ct, g, w,
371 190
IF( fatal.AND.sfatal )
375 WRITE( nout, fmt = 9986 )
379 WRITE( nout, fmt = 9985 )
383 WRITE( nout, fmt = 9991 )
391 10002
FORMAT(
' COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED' )
392 10001
FORMAT(
' ROW-MAJOR DATA LAYOUT IS TESTED' )
393 10000
FORMAT(
' COLUMN-MAJOR DATA LAYOUT IS TESTED' )
394 9999
FORMAT(
' ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LES',
396 9998
FORMAT(
' RELATIVE MACHINE PRECISION IS TAKEN TO BE', 1p, e9.1 )
397 9997
FORMAT(
' NUMBER OF VALUES OF ', a,
' IS LESS THAN 1 OR GREATER ',
399 9996
FORMAT(
' VALUE OF N IS LESS THAN 0 OR GREATER THAN ', i2 )
400 9995
FORMAT(
'TESTS OF THE COMPLEX*16 LEVEL 3 BLAS', //
' THE F',
401 $
'OLLOWING PARAMETER VALUES WILL BE USED:' )
402 9994
FORMAT(
' FOR N ', 9i6 )
403 9993
FORMAT(
' FOR ALPHA ',
404 $ 7(
'(', f4.1,
',', f4.1,
') ', : ) )
405 9992
FORMAT(
' FOR BETA ',
406 $ 7(
'(', f4.1,
',', f4.1,
') ', : ) )
407 9991
FORMAT(
' AMEND DATA FILE OR INCREASE ARRAY SIZES IN PROGRAM',
408 $ /
' ******* TESTS ABANDONED *******' )
409 9990
FORMAT(
' SUBPROGRAM NAME ', a12,
' NOT RECOGNIZED', /
' ******* T',
410 $
'ESTS ABANDONED *******' )
411 9989
FORMAT(
' ERROR IN ZMMCH - IN-LINE DOT PRODUCTS ARE BEING EVALU',
412 $
'ATED WRONGLY.', /
' ZMMCH WAS CALLED WITH TRANSA = ', a1,
413 $
'AND TRANSB = ', a1, /
' AND RETURNED SAME = ', l1,
' AND ',
414 $
' ERR = ', f12.3,
'.', /
' THIS MAY BE DUE TO FAULTS IN THE ',
415 $
'ARITHMETIC OR THE COMPILER.', /
' ******* TESTS ABANDONED ',
417 9988
FORMAT( a12,l2 )
418 9987
FORMAT( 1x, a12,
' WAS NOT TESTED' )
419 9986
FORMAT( /
' END OF TESTS' )
420 9985
FORMAT( /
' ******* FATAL ERROR - TESTS ABANDONED *******' )
421 9984
FORMAT(
' ERROR-EXITS WILL NOT BE TESTED' )
426 SUBROUTINE zchk1( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
427 $ fatal, nidim, idim, nalf, alf, nbet, bet, nmax,
428 $ a, aa, as, b, bb, bs, c, cc, cs, ct, g,
443 parameter ( zero = ( 0.0, 0.0 ) )
444 DOUBLE PRECISION RZERO
445 parameter ( rzero = 0.0 )
447 DOUBLE PRECISION EPS, THRESH
448 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
449 LOGICAL FATAL, REWI, TRACE
452 COMPLEX*16 A( nmax, nmax ), AA( nmax*nmax ), ALF( nalf ),
453 $ as( nmax*nmax ), b( nmax, nmax ),
454 $ bb( nmax*nmax ), bet( nbet ), bs( nmax*nmax ),
455 $ c( nmax, nmax ), cc( nmax*nmax ),
456 $ cs( nmax*nmax ), ct( nmax )
457 DOUBLE PRECISION G( nmax )
458 INTEGER IDIM( nidim )
460 COMPLEX*16 ALPHA, ALS, BETA, BLS
461 DOUBLE PRECISION ERR, ERRMAX
462 INTEGER I, IA, IB, ICA, ICB, IK, IM, IN, K, KS, LAA,
463 $ lbb, lcc, lda, ldas, ldb, ldbs, ldc, ldcs, m,
464 $ ma, mb, ms, n, na, nargs, nb, nc, ns
465 LOGICAL NULL, RESET, SAME, TRANA, TRANB
466 CHARACTER*1 TRANAS, TRANBS, TRANSA, TRANSB
481 COMMON /infoc/infot, noutc, ok, lerr
504 null = n.LE.0.OR.m.LE.0
510 transa = ich( ica: ica )
511 trana = transa.EQ.
'T'.OR.transa.EQ.
'C'
531 CALL zmake(
'ge',
' ',
' ', ma, na, a, nmax, aa, lda,
535 transb = ich( icb: icb )
536 tranb = transb.EQ.
'T'.OR.transb.EQ.
'C'
556 CALL zmake(
'ge',
' ',
' ', mb, nb, b, nmax, bb,
567 CALL zmake(
'ge',
' ',
' ', m, n, c, nmax,
568 $ cc, ldc, reset, zero )
598 $
CALL zprcn1(ntra, nc, sname, iorder,
599 $ transa, transb, m, n, k, alpha, lda,
603 CALL czgemm( iorder, transa, transb, m, n,
604 $ k, alpha, aa, lda, bb, ldb,
610 WRITE( nout, fmt = 9994 )
617 isame( 1 ) = transa.EQ.tranas
618 isame( 2 ) = transb.EQ.tranbs
622 isame( 6 ) = als.EQ.alpha
623 isame( 7 ) = lze( as, aa, laa )
624 isame( 8 ) = ldas.EQ.lda
625 isame( 9 ) = lze( bs, bb, lbb )
626 isame( 10 ) = ldbs.EQ.ldb
627 isame( 11 ) = bls.EQ.beta
629 isame( 12 ) = lze( cs, cc, lcc )
631 isame( 12 ) = lzeres(
'ge',
' ', m, n, cs,
634 isame( 13 ) = ldcs.EQ.ldc
641 same = same.AND.isame( i )
642 IF( .NOT.isame( i ) )
643 $
WRITE( nout, fmt = 9998 )i
654 CALL zmmch( transa, transb, m, n, k,
655 $ alpha, a, nmax, b, nmax, beta,
656 $ c, nmax, ct, g, cc, ldc, eps,
657 $ err, fatal, nout, .true. )
658 errmax = max( errmax, err )
681 IF( errmax.LT.thresh )
THEN
682 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
683 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
685 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
686 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
691 WRITE( nout, fmt = 9996 )sname
692 CALL zprcn1(nout, nc, sname, iorder, transa, transb,
693 $ m, n, k, alpha, lda, ldb, beta, ldc)
698 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
699 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
700 $
'RATIO ', f8.2,
' - SUSPECT *******' )
701 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
702 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
703 $
'RATIO ', f8.2,
' - SUSPECT *******' )
704 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
705 $
' (', i6,
' CALL',
'S)' )
706 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
707 $
' (', i6,
' CALL',
'S)' )
708 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
709 $
'ANGED INCORRECTLY *******' )
710 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
711 9995
FORMAT( 1x, i6,
': ', a12,
'(''', a1,
''',''', a1,
''',',
712 $ 3( i3,
',' ),
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
713 $
',(', f4.1,
',', f4.1,
'), C,', i3,
').' )
714 9994
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
721 SUBROUTINE zprcn1(NOUT, NC, SNAME, IORDER, TRANSA, TRANSB, M, N,
722 $ k, alpha, lda, ldb, beta, ldc)
723 INTEGER NOUT, NC, IORDER, M, N, K, LDA, LDB, LDC
724 DOUBLE COMPLEX ALPHA, BETA
725 CHARACTER*1 TRANSA, TRANSB
727 CHARACTER*14 CRC, CTA,CTB
729 IF (transa.EQ.
'N')
THEN
730 cta =
' CblasNoTrans'
731 ELSE IF (transa.EQ.
'T')
THEN
734 cta =
'CblasConjTrans'
736 IF (transb.EQ.
'N')
THEN
737 ctb =
' CblasNoTrans'
738 ELSE IF (transb.EQ.
'T')
THEN
741 ctb =
'CblasConjTrans'
744 crc =
' CblasRowMajor'
746 crc =
' CblasColMajor'
748 WRITE(nout, fmt = 9995)nc,sname,crc, cta,ctb
749 WRITE(nout, fmt = 9994)m, n, k, alpha, lda, ldb, beta, ldc
751 9995
FORMAT( 1x, i6,
': ', a12,
'(', a14,
',', a14,
',', a14,
',')
752 9994
FORMAT( 10x, 3( i3,
',' ) ,
' (', f4.1,
',',f4.1,
') , A,',
753 $ i3,
', B,', i3,
', (', f4.1,
',',f4.1,
') , C,', i3,
').' )
756 SUBROUTINE zchk2( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
757 $ fatal, nidim, idim, nalf, alf, nbet, bet, nmax,
758 $ a, aa, as, b, bb, bs, c, cc, cs, ct, g,
773 parameter ( zero = ( 0.0d0, 0.0d0 ) )
774 DOUBLE PRECISION RZERO
775 parameter ( rzero = 0.0d0 )
777 DOUBLE PRECISION EPS, THRESH
778 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
779 LOGICAL FATAL, REWI, TRACE
782 COMPLEX*16 A( nmax, nmax ), AA( nmax*nmax ), ALF( nalf ),
783 $ as( nmax*nmax ), b( nmax, nmax ),
784 $ bb( nmax*nmax ), bet( nbet ), bs( nmax*nmax ),
785 $ c( nmax, nmax ), cc( nmax*nmax ),
786 $ cs( nmax*nmax ), ct( nmax )
787 DOUBLE PRECISION G( nmax )
788 INTEGER IDIM( nidim )
790 COMPLEX*16 ALPHA, ALS, BETA, BLS
791 DOUBLE PRECISION ERR, ERRMAX
792 INTEGER I, IA, IB, ICS, ICU, IM, IN, LAA, LBB, LCC,
793 $ lda, ldas, ldb, ldbs, ldc, ldcs, m, ms, n, na,
795 LOGICAL CONJ, LEFT, NULL, RESET, SAME
796 CHARACTER*1 SIDE, SIDES, UPLO, UPLOS
797 CHARACTER*2 ICHS, ICHU
811 COMMON /infoc/infot, noutc, ok, lerr
813 DATA ichs/
'LR'/, ichu/
'UL'/
815 conj = sname( 8: 9 ).EQ.
'he'
835 null = n.LE.0.OR.m.LE.0
847 CALL zmake(
'ge',
' ',
' ', m, n, b, nmax, bb, ldb, reset,
851 side = ichs( ics: ics )
869 uplo = ichu( icu: icu )
873 CALL zmake(sname( 8: 9 ), uplo,
' ', na, na, a, nmax,
874 $ aa, lda, reset, zero )
884 CALL zmake(
'ge',
' ',
' ', m, n, c, nmax, cc,
914 $
CALL zprcn2(ntra, nc, sname, iorder,
915 $ side, uplo, m, n, alpha, lda, ldb,
920 CALL czhemm( iorder, side, uplo, m, n,
921 $ alpha, aa, lda, bb, ldb, beta,
924 CALL czsymm( iorder, side, uplo, m, n,
925 $ alpha, aa, lda, bb, ldb, beta,
932 WRITE( nout, fmt = 9994 )
939 isame( 1 ) = sides.EQ.side
940 isame( 2 ) = uplos.EQ.uplo
943 isame( 5 ) = als.EQ.alpha
944 isame( 6 ) = lze( as, aa, laa )
945 isame( 7 ) = ldas.EQ.lda
946 isame( 8 ) = lze( bs, bb, lbb )
947 isame( 9 ) = ldbs.EQ.ldb
948 isame( 10 ) = bls.EQ.beta
950 isame( 11 ) = lze( cs, cc, lcc )
952 isame( 11 ) = lzeres(
'ge',
' ', m, n, cs,
955 isame( 12 ) = ldcs.EQ.ldc
962 same = same.AND.isame( i )
963 IF( .NOT.isame( i ) )
964 $
WRITE( nout, fmt = 9998 )i
976 CALL zmmch(
'N',
'N', m, n, m, alpha, a,
977 $ nmax, b, nmax, beta, c, nmax,
978 $ ct, g, cc, ldc, eps, err,
979 $ fatal, nout, .true. )
981 CALL zmmch(
'N',
'N', m, n, n, alpha, b,
982 $ nmax, a, nmax, beta, c, nmax,
983 $ ct, g, cc, ldc, eps, err,
984 $ fatal, nout, .true. )
986 errmax = max( errmax, err )
1007 IF( errmax.LT.thresh )
THEN
1008 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
1009 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
1011 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
1012 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
1017 WRITE( nout, fmt = 9996 )sname
1018 CALL zprcn2(nout, nc, sname, iorder, side, uplo, m, n, alpha, lda,
1024 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
1025 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1026 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1027 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
1028 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1029 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1030 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
1031 $
' (', i6,
' CALL',
'S)' )
1032 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
1033 $
' (', i6,
' CALL',
'S)' )
1034 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
1035 $
'ANGED INCORRECTLY *******' )
1036 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
1037 9995
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
1038 $
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
',(', f4.1,
1039 $
',', f4.1,
'), C,', i3,
') .' )
1040 9994
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1047 SUBROUTINE zprcn2(NOUT, NC, SNAME, IORDER, SIDE, UPLO, M, N,
1048 $ alpha, lda, ldb, beta, ldc)
1049 INTEGER NOUT, NC, IORDER, M, N, LDA, LDB, LDC
1050 DOUBLE COMPLEX ALPHA, BETA
1051 CHARACTER*1 SIDE, UPLO
1053 CHARACTER*14 CRC, CS,CU
1055 IF (side.EQ.
'L')
THEN
1060 IF (uplo.EQ.
'U')
THEN
1065 IF (iorder.EQ.1)
THEN
1066 crc =
' CblasRowMajor'
1068 crc =
' CblasColMajor'
1070 WRITE(nout, fmt = 9995)nc,sname,crc, cs,cu
1071 WRITE(nout, fmt = 9994)m, n, alpha, lda, ldb, beta, ldc
1073 9995
FORMAT( 1x, i6,
': ', a12,
'(', a14,
',', a14,
',', a14,
',')
1074 9994
FORMAT( 10x, 2( i3,
',' ),
' (',f4.1,
',',f4.1,
'), A,', i3,
1075 $
', B,', i3,
', (',f4.1,
',',f4.1,
'), ',
'C,', i3,
').' )
1078 SUBROUTINE zchk3( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
1079 $ fatal, nidim, idim, nalf, alf, nmax, a, aa, as,
1080 $ b, bb, bs, ct, g, c, iorder )
1093 COMPLEX*16 ZERO, ONE
1094 parameter ( zero = ( 0.0d0, 0.0d0 ), one = ( 1.0d0, 0.0d0 ) )
1095 DOUBLE PRECISION RZERO
1096 parameter ( rzero = 0.0d0 )
1098 DOUBLE PRECISION EPS, THRESH
1099 INTEGER NALF, NIDIM, NMAX, NOUT, NTRA, IORDER
1100 LOGICAL FATAL, REWI, TRACE
1103 COMPLEX*16 A( nmax, nmax ), AA( nmax*nmax ), ALF( nalf ),
1104 $ as( nmax*nmax ), b( nmax, nmax ),
1105 $ bb( nmax*nmax ), bs( nmax*nmax ),
1106 $ c( nmax, nmax ), ct( nmax )
1107 DOUBLE PRECISION G( nmax )
1108 INTEGER IDIM( nidim )
1110 COMPLEX*16 ALPHA, ALS
1111 DOUBLE PRECISION ERR, ERRMAX
1112 INTEGER I, IA, ICD, ICS, ICT, ICU, IM, IN, J, LAA, LBB,
1113 $ lda, ldas, ldb, ldbs, m, ms, n, na, nargs, nc,
1115 LOGICAL LEFT, NULL, RESET, SAME
1116 CHARACTER*1 DIAG, DIAGS, SIDE, SIDES, TRANAS, TRANSA, UPLO,
1118 CHARACTER*2 ICHD, ICHS, ICHU
1124 EXTERNAL lze, lzeres
1130 INTEGER INFOT, NOUTC
1133 COMMON /infoc/infot, noutc, ok, lerr
1135 DATA ichu/
'UL'/, icht/
'NTC'/, ichd/
'UN'/, ichs/
'LR'/
1149 DO 140 im = 1, nidim
1152 DO 130 in = 1, nidim
1162 null = m.LE.0.OR.n.LE.0
1165 side = ichs( ics: ics )
1182 uplo = ichu( icu: icu )
1185 transa = icht( ict: ict )
1188 diag = ichd( icd: icd )
1195 CALL zmake(
'tr', uplo, diag, na, na, a,
1196 $ nmax, aa, lda, reset, zero )
1200 CALL zmake(
'ge',
' ',
' ', m, n, b, nmax,
1201 $ bb, ldb, reset, zero )
1226 IF( sname( 10: 11 ).EQ.
'mm' )
THEN
1228 $
CALL zprcn3( ntra, nc, sname, iorder,
1229 $ side, uplo, transa, diag, m, n, alpha,
1233 CALL cztrmm(iorder, side, uplo, transa,
1234 $ diag, m, n, alpha, aa, lda,
1236 ELSE IF( sname( 10: 11 ).EQ.
'sm' )
THEN
1238 $
CALL zprcn3( ntra, nc, sname, iorder,
1239 $ side, uplo, transa, diag, m, n, alpha,
1243 CALL cztrsm(iorder, side, uplo, transa,
1244 $ diag, m, n, alpha, aa, lda,
1251 WRITE( nout, fmt = 9994 )
1258 isame( 1 ) = sides.EQ.side
1259 isame( 2 ) = uplos.EQ.uplo
1260 isame( 3 ) = tranas.EQ.transa
1261 isame( 4 ) = diags.EQ.diag
1262 isame( 5 ) = ms.EQ.m
1263 isame( 6 ) = ns.EQ.n
1264 isame( 7 ) = als.EQ.alpha
1265 isame( 8 ) = lze( as, aa, laa )
1266 isame( 9 ) = ldas.EQ.lda
1268 isame( 10 ) = lze( bs, bb, lbb )
1270 isame( 10 ) = lzeres(
'ge',
' ', m, n, bs,
1273 isame( 11 ) = ldbs.EQ.ldb
1280 same = same.AND.isame( i )
1281 IF( .NOT.isame( i ) )
1282 $
WRITE( nout, fmt = 9998 )i
1290 IF( sname( 10: 11 ).EQ.
'mm' )
THEN
1295 CALL zmmch( transa,
'N', m, n, m,
1296 $ alpha, a, nmax, b, nmax,
1297 $ zero, c, nmax, ct, g,
1298 $ bb, ldb, eps, err,
1299 $ fatal, nout, .true. )
1301 CALL zmmch(
'N', transa, m, n, n,
1302 $ alpha, b, nmax, a, nmax,
1303 $ zero, c, nmax, ct, g,
1304 $ bb, ldb, eps, err,
1305 $ fatal, nout, .true. )
1307 ELSE IF( sname( 10: 11 ).EQ.
'sm' )
THEN
1314 c( i, j ) = bb( i + ( j - 1 )*
1316 bb( i + ( j - 1 )*ldb ) = alpha*
1322 CALL zmmch( transa,
'N', m, n, m,
1323 $ one, a, nmax, c, nmax,
1324 $ zero, b, nmax, ct, g,
1325 $ bb, ldb, eps, err,
1326 $ fatal, nout, .false. )
1328 CALL zmmch(
'N', transa, m, n, n,
1329 $ one, c, nmax, a, nmax,
1330 $ zero, b, nmax, ct, g,
1331 $ bb, ldb, eps, err,
1332 $ fatal, nout, .false. )
1335 errmax = max( errmax, err )
1358 IF( errmax.LT.thresh )
THEN
1359 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
1360 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
1362 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
1363 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
1368 WRITE( nout, fmt = 9996 )sname
1370 $
CALL zprcn3( ntra, nc, sname, iorder, side, uplo, transa, diag,
1371 $ m, n, alpha, lda, ldb)
1376 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
1377 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1378 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1379 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
1380 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1381 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1382 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
1383 $
' (', i6,
' CALL',
'S)' )
1384 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
1385 $
' (', i6,
' CALL',
'S)' )
1386 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
1387 $
'ANGED INCORRECTLY *******' )
1388 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
1389 9995
FORMAT(1x, i6,
': ', a12,
'(', 4(
'''', a1,
''',' ), 2( i3,
',' ),
1390 $
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
') ',
1392 9994
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1399 SUBROUTINE zprcn3(NOUT, NC, SNAME, IORDER, SIDE, UPLO, TRANSA,
1400 $ diag, m, n, alpha, lda, ldb)
1401 INTEGER NOUT, NC, IORDER, M, N, LDA, LDB
1402 DOUBLE COMPLEX ALPHA
1403 CHARACTER*1 SIDE, UPLO, TRANSA, DIAG
1405 CHARACTER*14 CRC, CS, CU, CA, CD
1407 IF (side.EQ.
'L')
THEN
1412 IF (uplo.EQ.
'U')
THEN
1417 IF (transa.EQ.
'N')
THEN
1418 ca =
' CblasNoTrans'
1419 ELSE IF (transa.EQ.
'T')
THEN
1422 ca =
'CblasConjTrans'
1424 IF (diag.EQ.
'N')
THEN
1425 cd =
' CblasNonUnit'
1429 IF (iorder.EQ.1)
THEN
1430 crc =
' CblasRowMajor'
1432 crc =
' CblasColMajor'
1434 WRITE(nout, fmt = 9995)nc,sname,crc, cs,cu
1435 WRITE(nout, fmt = 9994)ca, cd, m, n, alpha, lda, ldb
1437 9995
FORMAT( 1x, i6,
': ', a12,
'(', a14,
',', a14,
',', a14,
',')
1438 9994
FORMAT( 10x, 2( a14,
',') , 2( i3,
',' ),
' (', f4.1,
',',
1439 $ f4.1,
'), A,', i3,
', B,', i3,
').' )
1442 SUBROUTINE zchk4( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
1443 $ fatal, nidim, idim, nalf, alf, nbet, bet, nmax,
1444 $ a, aa, as, b, bb, bs, c, cc, cs, ct, g,
1459 parameter ( zero = ( 0.0d0, 0.0d0 ) )
1460 DOUBLE PRECISION RONE, RZERO
1461 parameter ( rone = 1.0d0, rzero = 0.0d0 )
1463 DOUBLE PRECISION EPS, THRESH
1464 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
1465 LOGICAL FATAL, REWI, TRACE
1468 COMPLEX*16 A( nmax, nmax ), AA( nmax*nmax ), ALF( nalf ),
1469 $ as( nmax*nmax ), b( nmax, nmax ),
1470 $ bb( nmax*nmax ), bet( nbet ), bs( nmax*nmax ),
1471 $ c( nmax, nmax ), cc( nmax*nmax ),
1472 $ cs( nmax*nmax ), ct( nmax )
1473 DOUBLE PRECISION G( nmax )
1474 INTEGER IDIM( nidim )
1476 COMPLEX*16 ALPHA, ALS, BETA, BETS
1477 DOUBLE PRECISION ERR, ERRMAX, RALPHA, RALS, RBETA, RBETS
1478 INTEGER I, IA, IB, ICT, ICU, IK, IN, J, JC, JJ, K, KS,
1479 $ laa, lcc, lda, ldas, ldc, ldcs, lj, ma, n, na,
1481 LOGICAL CONJ, NULL, RESET, SAME, TRAN, UPPER
1482 CHARACTER*1 TRANS, TRANSS, TRANST, UPLO, UPLOS
1483 CHARACTER*2 ICHT, ICHU
1488 EXTERNAL lze, lzeres
1492 INTRINSIC dcmplx, max, dble
1494 INTEGER INFOT, NOUTC
1497 COMMON /infoc/infot, noutc, ok, lerr
1499 DATA icht/
'NC'/, ichu/
'UL'/
1501 conj = sname( 8: 9 ).EQ.
'he'
1508 DO 100 in = 1, nidim
1523 trans = icht( ict: ict )
1525 IF( tran.AND..NOT.conj )
1545 CALL zmake(
'ge',
' ',
' ', ma, na, a, nmax, aa, lda,
1549 uplo = ichu( icu: icu )
1555 ralpha = dble( alpha )
1556 alpha = dcmplx( ralpha, rzero )
1562 rbeta = dble( beta )
1563 beta = dcmplx( rbeta, rzero )
1567 $ null = null.OR.( ( k.LE.0.OR.ralpha.EQ.
1568 $ rzero ).AND.rbeta.EQ.rone )
1572 CALL zmake( sname( 8: 9 ), uplo,
' ', n, n, c,
1573 $ nmax, cc, ldc, reset, zero )
1606 $
CALL zprcn6( ntra, nc, sname, iorder,
1607 $ uplo, trans, n, k, ralpha, lda, rbeta,
1611 CALL czherk( iorder, uplo, trans, n, k,
1612 $ ralpha, aa, lda, rbeta, cc,
1616 $
CALL zprcn4( ntra, nc, sname, iorder,
1617 $ uplo, trans, n, k, alpha, lda, beta, ldc)
1620 CALL czsyrk( iorder, uplo, trans, n, k,
1621 $ alpha, aa, lda, beta, cc, ldc )
1627 WRITE( nout, fmt = 9992 )
1634 isame( 1 ) = uplos.EQ.uplo
1635 isame( 2 ) = transs.EQ.trans
1636 isame( 3 ) = ns.EQ.n
1637 isame( 4 ) = ks.EQ.k
1639 isame( 5 ) = rals.EQ.ralpha
1641 isame( 5 ) = als.EQ.alpha
1643 isame( 6 ) = lze( as, aa, laa )
1644 isame( 7 ) = ldas.EQ.lda
1646 isame( 8 ) = rbets.EQ.rbeta
1648 isame( 8 ) = bets.EQ.beta
1651 isame( 9 ) = lze( cs, cc, lcc )
1653 isame( 9 ) = lzeres( sname( 8: 9 ), uplo, n,
1656 isame( 10 ) = ldcs.EQ.ldc
1663 same = same.AND.isame( i )
1664 IF( .NOT.isame( i ) )
1665 $
WRITE( nout, fmt = 9998 )i
1691 CALL zmmch( transt,
'N', lj, 1, k,
1692 $ alpha, a( 1, jj ), nmax,
1693 $ a( 1, j ), nmax, beta,
1694 $ c( jj, j ), nmax, ct, g,
1695 $ cc( jc ), ldc, eps, err,
1696 $ fatal, nout, .true. )
1698 CALL zmmch(
'N', transt, lj, 1, k,
1699 $ alpha, a( jj, 1 ), nmax,
1700 $ a( j, 1 ), nmax, beta,
1701 $ c( jj, j ), nmax, ct, g,
1702 $ cc( jc ), ldc, eps, err,
1703 $ fatal, nout, .true. )
1710 errmax = max( errmax, err )
1732 IF( errmax.LT.thresh )
THEN
1733 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
1734 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
1736 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
1737 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
1743 $
WRITE( nout, fmt = 9995 )j
1746 WRITE( nout, fmt = 9996 )sname
1748 CALL zprcn6( nout, nc, sname, iorder, uplo, trans, n, k, ralpha,
1751 CALL zprcn4( nout, nc, sname, iorder, uplo, trans, n, k, alpha,
1758 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
1759 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1760 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1761 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
1762 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1763 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1764 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
1765 $
' (', i6,
' CALL',
'S)' )
1766 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
1767 $
' (', i6,
' CALL',
'S)' )
1768 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
1769 $
'ANGED INCORRECTLY *******' )
1770 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
1771 9995
FORMAT(
' THESE ARE THE RESULTS FOR COLUMN ', i3 )
1772 9994
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
1773 $ f4.1,
', A,', i3,
',', f4.1,
', C,', i3,
') ',
1775 9993
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
1776 $
'(', f4.1,
',', f4.1,
') , A,', i3,
',(', f4.1,
',', f4.1,
1777 $
'), C,', i3,
') .' )
1778 9992
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1785 SUBROUTINE zprcn4(NOUT, NC, SNAME, IORDER, UPLO, TRANSA,
1786 $ n, k, alpha, lda, beta, ldc)
1787 INTEGER NOUT, NC, IORDER, N, K, LDA, LDC
1788 DOUBLE COMPLEX ALPHA, BETA
1789 CHARACTER*1 UPLO, TRANSA
1791 CHARACTER*14 CRC, CU, CA
1793 IF (uplo.EQ.
'U')
THEN
1798 IF (transa.EQ.
'N')
THEN
1799 ca =
' CblasNoTrans'
1800 ELSE IF (transa.EQ.
'T')
THEN
1803 ca =
'CblasConjTrans'
1805 IF (iorder.EQ.1)
THEN
1806 crc =
' CblasRowMajor'
1808 crc =
' CblasColMajor'
1810 WRITE(nout, fmt = 9995)nc, sname, crc, cu, ca
1811 WRITE(nout, fmt = 9994)n, k, alpha, lda, beta, ldc
1813 9995
FORMAT( 1x, i6,
': ', a12,
'(', 3( a14,
',') )
1814 9994
FORMAT( 10x, 2( i3,
',' ),
' (', f4.1,
',', f4.1 ,
'), A,',
1815 $ i3,
', (', f4.1,
',', f4.1,
'), C,', i3,
').' )
1819 SUBROUTINE zprcn6(NOUT, NC, SNAME, IORDER, UPLO, TRANSA,
1820 $ n, k, alpha, lda, beta, ldc)
1821 INTEGER NOUT, NC, IORDER, N, K, LDA, LDC
1822 DOUBLE PRECISION ALPHA, BETA
1823 CHARACTER*1 UPLO, TRANSA
1825 CHARACTER*14 CRC, CU, CA
1827 IF (uplo.EQ.
'U')
THEN
1832 IF (transa.EQ.
'N')
THEN
1833 ca =
' CblasNoTrans'
1834 ELSE IF (transa.EQ.
'T')
THEN
1837 ca =
'CblasConjTrans'
1839 IF (iorder.EQ.1)
THEN
1840 crc =
' CblasRowMajor'
1842 crc =
' CblasColMajor'
1844 WRITE(nout, fmt = 9995)nc, sname, crc, cu, ca
1845 WRITE(nout, fmt = 9994)n, k, alpha, lda, beta, ldc
1847 9995
FORMAT( 1x, i6,
': ', a12,
'(', 3( a14,
',') )
1848 9994
FORMAT( 10x, 2( i3,
',' ),
1849 $ f4.1,
', A,', i3,
',', f4.1,
', C,', i3,
').' )
1852 SUBROUTINE zchk5( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
1853 $ fatal, nidim, idim, nalf, alf, nbet, bet, nmax,
1854 $ ab, aa, as, bb, bs, c, cc, cs, ct, g, w,
1868 COMPLEX*16 ZERO, ONE
1869 parameter ( zero = ( 0.0d0, 0.0d0 ), one = ( 1.0d0, 0.0d0 ) )
1870 DOUBLE PRECISION RONE, RZERO
1871 parameter ( rone = 1.0d0, rzero = 0.0d0 )
1873 DOUBLE PRECISION EPS, THRESH
1874 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
1875 LOGICAL FATAL, REWI, TRACE
1878 COMPLEX*16 AA( nmax*nmax ), AB( 2*nmax*nmax ),
1879 $ alf( nalf ), as( nmax*nmax ), bb( nmax*nmax ),
1880 $ bet( nbet ), bs( nmax*nmax ), c( nmax, nmax ),
1881 $ cc( nmax*nmax ), cs( nmax*nmax ), ct( nmax ),
1883 DOUBLE PRECISION G( nmax )
1884 INTEGER IDIM( nidim )
1886 COMPLEX*16 ALPHA, ALS, BETA, BETS
1887 DOUBLE PRECISION ERR, ERRMAX, RBETA, RBETS
1888 INTEGER I, IA, IB, ICT, ICU, IK, IN, J, JC, JJ, JJAB,
1889 $ k, ks, laa, lbb, lcc, lda, ldas, ldb, ldbs,
1890 $ ldc, ldcs, lj, ma, n, na, nargs, nc, ns
1891 LOGICAL CONJ, NULL, RESET, SAME, TRAN, UPPER
1892 CHARACTER*1 TRANS, TRANSS, TRANST, UPLO, UPLOS
1893 CHARACTER*2 ICHT, ICHU
1898 EXTERNAL lze, lzeres
1902 INTRINSIC dcmplx, dconjg, max, dble
1904 INTEGER INFOT, NOUTC
1907 COMMON /infoc/infot, noutc, ok, lerr
1909 DATA icht/
'NC'/, ichu/
'UL'/
1911 conj = sname( 8: 9 ).EQ.
'he'
1918 DO 130 in = 1, nidim
1929 DO 120 ik = 1, nidim
1933 trans = icht( ict: ict )
1935 IF( tran.AND..NOT.conj )
1956 CALL zmake(
'ge',
' ',
' ', ma, na, ab, 2*nmax, aa,
1957 $ lda, reset, zero )
1959 CALL zmake(
'ge',
' ',
' ', ma, na, ab, nmax, aa, lda,
1968 CALL zmake(
'ge',
' ',
' ', ma, na, ab( k + 1 ),
1969 $ 2*nmax, bb, ldb, reset, zero )
1971 CALL zmake(
'ge',
' ',
' ', ma, na, ab( k*nmax + 1 ),
1972 $ nmax, bb, ldb, reset, zero )
1976 uplo = ichu( icu: icu )
1985 rbeta = dble( beta )
1986 beta = dcmplx( rbeta, rzero )
1990 $ null = null.OR.( ( k.LE.0.OR.alpha.EQ.
1991 $ zero ).AND.rbeta.EQ.rone )
1995 CALL zmake( sname( 8: 9 ), uplo,
' ', n, n, c,
1996 $ nmax, cc, ldc, reset, zero )
2029 $
CALL zprcn7( ntra, nc, sname, iorder,
2030 $ uplo, trans, n, k, alpha, lda, ldb,
2034 CALL czher2k( iorder, uplo, trans, n, k,
2035 $ alpha, aa, lda, bb, ldb, rbeta,
2039 $
CALL zprcn5( ntra, nc, sname, iorder,
2040 $ uplo, trans, n, k, alpha, lda, ldb,
2044 CALL czsyr2k( iorder, uplo, trans, n, k,
2045 $ alpha, aa, lda, bb, ldb, beta,
2052 WRITE( nout, fmt = 9992 )
2059 isame( 1 ) = uplos.EQ.uplo
2060 isame( 2 ) = transs.EQ.trans
2061 isame( 3 ) = ns.EQ.n
2062 isame( 4 ) = ks.EQ.k
2063 isame( 5 ) = als.EQ.alpha
2064 isame( 6 ) = lze( as, aa, laa )
2065 isame( 7 ) = ldas.EQ.lda
2066 isame( 8 ) = lze( bs, bb, lbb )
2067 isame( 9 ) = ldbs.EQ.ldb
2069 isame( 10 ) = rbets.EQ.rbeta
2071 isame( 10 ) = bets.EQ.beta
2074 isame( 11 ) = lze( cs, cc, lcc )
2076 isame( 11 ) = lzeres(
'he', uplo, n, n, cs,
2079 isame( 12 ) = ldcs.EQ.ldc
2086 same = same.AND.isame( i )
2087 IF( .NOT.isame( i ) )
2088 $
WRITE( nout, fmt = 9998 )i
2116 w( i ) = alpha*ab( ( j - 1 )*2*
2119 w( k + i ) = dconjg( alpha )*
2128 CALL zmmch( transt,
'N', lj, 1, 2*k,
2129 $ one, ab( jjab ), 2*nmax, w,
2130 $ 2*nmax, beta, c( jj, j ),
2131 $ nmax, ct, g, cc( jc ), ldc,
2132 $ eps, err, fatal, nout,
2137 w( i ) = alpha*dconjg( ab( ( k +
2138 $ i - 1 )*nmax + j ) )
2139 w( k + i ) = dconjg( alpha*
2140 $ ab( ( i - 1 )*nmax +
2143 w( i ) = alpha*ab( ( k + i - 1 )*
2146 $ ab( ( i - 1 )*nmax +
2150 CALL zmmch(
'N',
'N', lj, 1, 2*k, one,
2151 $ ab( jj ), nmax, w, 2*nmax,
2152 $ beta, c( jj, j ), nmax, ct,
2153 $ g, cc( jc ), ldc, eps, err,
2154 $ fatal, nout, .true. )
2161 $ jjab = jjab + 2*nmax
2163 errmax = max( errmax, err )
2185 IF( errmax.LT.thresh )
THEN
2186 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
2187 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
2189 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
2190 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
2196 $
WRITE( nout, fmt = 9995 )j
2199 WRITE( nout, fmt = 9996 )sname
2201 CALL zprcn7( nout, nc, sname, iorder, uplo, trans, n, k,
2202 $ alpha, lda, ldb, rbeta, ldc)
2204 CALL zprcn5( nout, nc, sname, iorder, uplo, trans, n, k,
2205 $ alpha, lda, ldb, beta, ldc)
2211 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
2212 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
2213 $
'RATIO ', f8.2,
' - SUSPECT *******' )
2214 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
2215 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
2216 $
'RATIO ', f8.2,
' - SUSPECT *******' )
2217 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
2218 $
' (', i6,
' CALL',
'S)' )
2219 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
2220 $
' (', i6,
' CALL',
'S)' )
2221 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
2222 $
'ANGED INCORRECTLY *******' )
2223 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
2224 9995
FORMAT(
' THESE ARE THE RESULTS FOR COLUMN ', i3 )
2225 9994
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
2226 $
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
',', f4.1,
2227 $
', C,', i3,
') .' )
2228 9993
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
2229 $
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
',(', f4.1,
2230 $
',', f4.1,
'), C,', i3,
') .' )
2231 9992
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
2238 SUBROUTINE zprcn5(NOUT, NC, SNAME, IORDER, UPLO, TRANSA,
2239 $ n, k, alpha, lda, ldb, beta, ldc)
2240 INTEGER NOUT, NC, IORDER, N, K, LDA, LDB, LDC
2241 DOUBLE COMPLEX ALPHA, BETA
2242 CHARACTER*1 UPLO, TRANSA
2244 CHARACTER*14 CRC, CU, CA
2246 IF (uplo.EQ.
'U')
THEN
2251 IF (transa.EQ.
'N')
THEN
2252 ca =
' CblasNoTrans'
2253 ELSE IF (transa.EQ.
'T')
THEN
2256 ca =
'CblasConjTrans'
2258 IF (iorder.EQ.1)
THEN
2259 crc =
' CblasRowMajor'
2261 crc =
' CblasColMajor'
2263 WRITE(nout, fmt = 9995)nc, sname, crc, cu, ca
2264 WRITE(nout, fmt = 9994)n, k, alpha, lda, ldb, beta, ldc
2266 9995
FORMAT( 1x, i6,
': ', a12,
'(', 3( a14,
',') )
2267 9994
FORMAT( 10x, 2( i3,
',' ),
' (', f4.1,
',', f4.1,
'), A,',
2268 $ i3,
', B', i3,
', (', f4.1,
',', f4.1,
'), C,', i3,
').' )
2272 SUBROUTINE zprcn7(NOUT, NC, SNAME, IORDER, UPLO, TRANSA,
2273 $ n, k, alpha, lda, ldb, beta, ldc)
2274 INTEGER NOUT, NC, IORDER, N, K, LDA, LDB, LDC
2275 DOUBLE COMPLEX ALPHA
2276 DOUBLE PRECISION BETA
2277 CHARACTER*1 UPLO, TRANSA
2279 CHARACTER*14 CRC, CU, CA
2281 IF (uplo.EQ.
'U')
THEN
2286 IF (transa.EQ.
'N')
THEN
2287 ca =
' CblasNoTrans'
2288 ELSE IF (transa.EQ.
'T')
THEN
2291 ca =
'CblasConjTrans'
2293 IF (iorder.EQ.1)
THEN
2294 crc =
' CblasRowMajor'
2296 crc =
' CblasColMajor'
2298 WRITE(nout, fmt = 9995)nc, sname, crc, cu, ca
2299 WRITE(nout, fmt = 9994)n, k, alpha, lda, ldb, beta, ldc
2301 9995
FORMAT( 1x, i6,
': ', a12,
'(', 3( a14,
',') )
2302 9994
FORMAT( 10x, 2( i3,
',' ),
' (', f4.1,
',', f4.1,
'), A,',
2303 $ i3,
', B', i3,
',', f4.1,
', C,', i3,
').' )
2306 SUBROUTINE zmake( TYPE, UPLO, DIAG, M, N, A, NMAX, AA, LDA, RESET,
2324 COMPLEX*16 ZERO, ONE
2325 parameter ( zero = ( 0.0d0, 0.0d0 ),
2326 $ one = ( 1.0d0, 0.0d0 ) )
2328 parameter ( rogue = ( -1.0d10, 1.0d10 ) )
2329 DOUBLE PRECISION RZERO
2330 parameter ( rzero = 0.0d0 )
2331 DOUBLE PRECISION RROGUE
2332 parameter ( rrogue = -1.0d10 )
2335 INTEGER LDA, M, N, NMAX
2337 CHARACTER*1 DIAG, UPLO
2340 COMPLEX*16 A( nmax, * ), AA( * )
2342 INTEGER I, IBEG, IEND, J, JJ
2343 LOGICAL GEN, HER, LOWER, SYM, TRI, UNIT, UPPER
2348 INTRINSIC dcmplx, dconjg, dble
2354 upper = ( her.OR.sym.OR.tri ).AND.uplo.EQ.
'U'
2355 lower = ( her.OR.sym.OR.tri ).AND.uplo.EQ.
'L'
2356 unit = tri.AND.diag.EQ.
'U'
2362 IF( gen.OR.( upper.AND.i.LE.j ).OR.( lower.AND.i.GE.j ) )
2364 a( i, j ) = zbeg( reset ) + transl
2367 IF( n.GT.3.AND.j.EQ.n/2 )
2370 a( j, i ) = dconjg( a( i, j ) )
2372 a( j, i ) = a( i, j )
2380 $ a( j, j ) = dcmplx( dble( a( j, j ) ), rzero )
2382 $ a( j, j ) = a( j, j ) + one
2389 IF( type.EQ.
'ge' )
THEN
2392 aa( i + ( j - 1 )*lda ) = a( i, j )
2394 DO 40 i = m + 1, lda
2395 aa( i + ( j - 1 )*lda ) = rogue
2398 ELSE IF( type.EQ.
'he'.OR.type.EQ.
'sy'.OR.type.EQ.
'tr' )
THEN
2415 DO 60 i = 1, ibeg - 1
2416 aa( i + ( j - 1 )*lda ) = rogue
2418 DO 70 i = ibeg, iend
2419 aa( i + ( j - 1 )*lda ) = a( i, j )
2421 DO 80 i = iend + 1, lda
2422 aa( i + ( j - 1 )*lda ) = rogue
2425 jj = j + ( j - 1 )*lda
2426 aa( jj ) = dcmplx( dble( aa( jj ) ), rrogue )
2435 SUBROUTINE zmmch( TRANSA, TRANSB, M, N, KK, ALPHA, A, LDA, B, LDB,
2436 $ beta, c, ldc, ct, g, cc, ldcc, eps, err, fatal,
2451 parameter ( zero = ( 0.0d0, 0.0d0 ) )
2452 DOUBLE PRECISION RZERO, RONE
2453 parameter ( rzero = 0.0d0, rone = 1.0d0 )
2455 COMPLEX*16 ALPHA, BETA
2456 DOUBLE PRECISION EPS, ERR
2457 INTEGER KK, LDA, LDB, LDC, LDCC, M, N, NOUT
2459 CHARACTER*1 TRANSA, TRANSB
2461 COMPLEX*16 A( lda, * ), B( ldb, * ), C( ldc, * ),
2462 $ cc( ldcc, * ), ct( * )
2463 DOUBLE PRECISION G( * )
2466 DOUBLE PRECISION ERRI
2468 LOGICAL CTRANA, CTRANB, TRANA, TRANB
2470 INTRINSIC abs, dimag, dconjg, max, dble, sqrt
2472 DOUBLE PRECISION ABS1
2474 abs1( cl ) = abs( dble( cl ) ) + abs( dimag( cl ) )
2476 trana = transa.EQ.
'T'.OR.transa.EQ.
'C'
2477 tranb = transb.EQ.
'T'.OR.transb.EQ.
'C'
2478 ctrana = transa.EQ.
'C'
2479 ctranb = transb.EQ.
'C'
2491 IF( .NOT.trana.AND..NOT.tranb )
THEN
2494 ct( i ) = ct( i ) + a( i, k )*b( k, j )
2495 g( i ) = g( i ) + abs1( a( i, k ) )*abs1( b( k, j ) )
2498 ELSE IF( trana.AND..NOT.tranb )
THEN
2502 ct( i ) = ct( i ) + dconjg( a( k, i ) )*b( k, j )
2503 g( i ) = g( i ) + abs1( a( k, i ) )*
2510 ct( i ) = ct( i ) + a( k, i )*b( k, j )
2511 g( i ) = g( i ) + abs1( a( k, i ) )*
2516 ELSE IF( .NOT.trana.AND.tranb )
THEN
2520 ct( i ) = ct( i ) + a( i, k )*dconjg( b( j, k ) )
2521 g( i ) = g( i ) + abs1( a( i, k ) )*
2528 ct( i ) = ct( i ) + a( i, k )*b( j, k )
2529 g( i ) = g( i ) + abs1( a( i, k ) )*
2534 ELSE IF( trana.AND.tranb )
THEN
2539 ct( i ) = ct( i ) + dconjg( a( k, i ) )*
2540 $ dconjg( b( j, k ) )
2541 g( i ) = g( i ) + abs1( a( k, i ) )*
2548 ct( i ) = ct( i ) + dconjg( a( k, i ) )*
2550 g( i ) = g( i ) + abs1( a( k, i ) )*
2559 ct( i ) = ct( i ) + a( k, i )*
2560 $ dconjg( b( j, k ) )
2561 g( i ) = g( i ) + abs1( a( k, i ) )*
2568 ct( i ) = ct( i ) + a( k, i )*b( j, k )
2569 g( i ) = g( i ) + abs1( a( k, i ) )*
2577 ct( i ) = alpha*ct( i ) + beta*c( i, j )
2578 g( i ) = abs1( alpha )*g( i ) +
2579 $ abs1( beta )*abs1( c( i, j ) )
2586 erri = abs1( ct( i ) - cc( i, j ) )/eps
2587 IF( g( i ).NE.rzero )
2588 $ erri = erri/g( i )
2589 err = max( err, erri )
2590 IF( err*sqrt( eps ).GE.rone )
2602 WRITE( nout, fmt = 9999 )
2605 WRITE( nout, fmt = 9998 )i, ct( i ), cc( i, j )
2607 WRITE( nout, fmt = 9998 )i, cc( i, j ), ct( i )
2611 $
WRITE( nout, fmt = 9997 )j
2616 9999
FORMAT(
' ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HAL',
2617 $
'F ACCURATE *******', /
' EXPECTED RE',
2618 $
'SULT COMPUTED RESULT' )
2619 9998
FORMAT( 1x, i7, 2(
' (', g15.6,
',', g15.6,
')' ) )
2620 9997
FORMAT(
' THESE ARE THE RESULTS FOR COLUMN ', i3 )
2625 LOGICAL FUNCTION lze( RI, RJ, LR )
2640 COMPLEX*16 RI( * ), RJ( * )
2645 IF( ri( i ).NE.rj( i ) )
2657 LOGICAL FUNCTION lzeres( TYPE, UPLO, M, N, AA, AS, LDA )
2676 COMPLEX*16 AA( lda, * ), AS( lda, * )
2678 INTEGER I, IBEG, IEND, J
2682 IF( type.EQ.
'ge' )
THEN
2684 DO 10 i = m + 1, lda
2685 IF( aa( i, j ).NE.as( i, j ) )
2689 ELSE IF( type.EQ.
'he'.OR.type.EQ.
'sy' )
THEN
2698 DO 30 i = 1, ibeg - 1
2699 IF( aa( i, j ).NE.as( i, j ) )
2702 DO 40 i = iend + 1, lda
2703 IF( aa( i, j ).NE.as( i, j ) )
2719 COMPLEX*16 FUNCTION zbeg( RESET )
2735 INTEGER I, IC, J, MI, MJ
2737 SAVE i, ic, j, mi, mj
2761 i = i - 1000*( i/1000 )
2762 j = j - 1000*( j/1000 )
2767 zbeg = dcmplx( ( i - 500 )/1001.0d0, ( j - 500 )/1001.0d0 )
2773 DOUBLE PRECISION FUNCTION ddiff( X, Y )
2784 DOUBLE PRECISION X, Y
subroutine zprcn2(NOUT, NC, SNAME, IORDER, SIDE, UPLO, M, N, ALPHA, LDA, LDB, BETA, LDC)
complex *16 function zbeg(RESET)
subroutine zprcn3(NOUT, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, LDA, LDB)
subroutine zprcn6(NOUT, NC, SNAME, IORDER, UPLO, TRANSA, N, K, ALPHA, LDA, BETA, LDC)
logical function lzeres(TYPE, UPLO, M, N, AA, AS, LDA)
subroutine zmmch(TRANSA, TRANSB, M, N, KK, ALPHA, A, LDA, B, LDB, BETA, C, LDC, CT, G, CC, LDCC, EPS, ERR, FATAL, NOUT, MV)
subroutine zprcn5(NOUT, NC, SNAME, IORDER, UPLO, TRANSA, N, K, ALPHA, LDA, LDB, BETA, LDC)
double precision function ddiff(X, Y)
subroutine zprcn7(NOUT, NC, SNAME, IORDER, UPLO, TRANSA, N, K, ALPHA, LDA, LDB, BETA, LDC)
subroutine zchk2(SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI, FATAL, NIDIM, IDIM, NKB, KB, NALF, ALF, NBET, BET, NINC, INC, NMAX, INCMAX, A, AA, AS, X, XX, XS, Y, YY, YS, YT, G)
subroutine zmake(TYPE, UPLO, DIAG, M, N, A, NMAX, AA, LDA, KL, KU, RESET, TRANSL)
subroutine zprcn4(NOUT, NC, SNAME, IORDER, UPLO, TRANSA, N, K, ALPHA, LDA, BETA, LDC)
logical function lze(RI, RJ, LR)
subroutine zchk4(SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI, FATAL, NIDIM, IDIM, NALF, ALF, NINC, INC, NMAX, INCMAX, A, AA, AS, X, XX, XS, Y, YY, YS, YT, G, Z)
subroutine zchk3(SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI, FATAL, NIDIM, IDIM, NKB, KB, NINC, INC, NMAX, INCMAX, A, AA, AS, X, XX, XS, XT, G, Z)
subroutine zprcn1(NOUT, NC, SNAME, IORDER, TRANSA, TRANSB, M, N, K, ALPHA, LDA, LDB, BETA, LDC)
subroutine zchk5(SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI, FATAL, NIDIM, IDIM, NALF, ALF, NINC, INC, NMAX, INCMAX, A, AA, AS, X, XX, XS, Y, YY, YS, YT, G, Z)
subroutine zchk1(SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI, FATAL, NIDIM, IDIM, NKB, KB, NALF, ALF, NBET, BET, NINC, INC, NMAX, INCMAX, A, AA, AS, X, XX, XS, Y, YY, YS, YT, G)