50 parameter ( nin = 5, nout = 6 )
52 parameter ( nsubs = 9 )
54 parameter ( zero = ( 0.0, 0.0 ), one = ( 1.0, 0.0 ) )
55 REAL RZERO, RHALF, RONE
56 parameter ( rzero = 0.0, rhalf = 0.5, rone = 1.0 )
58 parameter ( nmax = 65 )
59 INTEGER NIDMAX, NALMAX, NBEMAX
60 parameter ( nidmax = 9, nalmax = 7, nbemax = 7 )
63 INTEGER I, ISNUM, J, N, NALF, NBET, NIDIM, NTRA,
65 LOGICAL FATAL, LTESTT, REWI, SAME, SFATAL, TRACE,
66 $ tsterr, corder, rorder
67 CHARACTER*1 TRANSA, TRANSB
71 COMPLEX AA( nmax*nmax ), AB( nmax, 2*nmax ),
72 $ alf( nalmax ), as( nmax*nmax ),
73 $ bb( nmax*nmax ), bet( nbemax ),
74 $ bs( nmax*nmax ), c( nmax, nmax ),
75 $ cc( nmax*nmax ), cs( nmax*nmax ), ct( nmax ),
78 INTEGER IDIM( nidmax )
79 LOGICAL LTEST( nsubs )
80 CHARACTER*12 SNAMES( nsubs )
94 COMMON /infoc/infot, noutc, ok, lerr
97 DATA snames/
'cblas_cgemm ',
'cblas_chemm ',
98 $
'cblas_csymm ',
'cblas_ctrmm ',
'cblas_ctrsm ',
99 $
'cblas_cherk ',
'cblas_csyrk ',
'cblas_cher2k',
107 READ( nin, fmt = * )snaps
108 READ( nin, fmt = * )ntra
111 OPEN( ntra, file = snaps )
114 READ( nin, fmt = * )rewi
115 rewi = rewi.AND.trace
117 READ( nin, fmt = * )sfatal
119 READ( nin, fmt = * )tsterr
121 READ( nin, fmt = * )layout
123 READ( nin, fmt = * )thresh
128 READ( nin, fmt = * )nidim
129 IF( nidim.LT.1.OR.nidim.GT.nidmax )
THEN
130 WRITE( nout, fmt = 9997 )
'N', nidmax
133 READ( nin, fmt = * )( idim( i ), i = 1, nidim )
135 IF( idim( i ).LT.0.OR.idim( i ).GT.nmax )
THEN
136 WRITE( nout, fmt = 9996 )nmax
141 READ( nin, fmt = * )nalf
142 IF( nalf.LT.1.OR.nalf.GT.nalmax )
THEN
143 WRITE( nout, fmt = 9997 )
'ALPHA', nalmax
146 READ( nin, fmt = * )( alf( i ), i = 1, nalf )
148 READ( nin, fmt = * )nbet
149 IF( nbet.LT.1.OR.nbet.GT.nbemax )
THEN
150 WRITE( nout, fmt = 9997 )
'BETA', nbemax
153 READ( nin, fmt = * )( bet( i ), i = 1, nbet )
157 WRITE( nout, fmt = 9995 )
158 WRITE( nout, fmt = 9994 )( idim( i ), i = 1, nidim )
159 WRITE( nout, fmt = 9993 )( alf( i ), i = 1, nalf )
160 WRITE( nout, fmt = 9992 )( bet( i ), i = 1, nbet )
161 IF( .NOT.tsterr )
THEN
162 WRITE( nout, fmt = * )
163 WRITE( nout, fmt = 9984 )
165 WRITE( nout, fmt = * )
166 WRITE( nout, fmt = 9999 )thresh
167 WRITE( nout, fmt = * )
171 IF (layout.EQ.2)
THEN
174 WRITE( *, fmt = 10002 )
175 ELSE IF (layout.EQ.1)
THEN
177 WRITE( *, fmt = 10001 )
178 ELSE IF (layout.EQ.0)
THEN
180 WRITE( *, fmt = 10000 )
191 30
READ( nin, fmt = 9988, end = 60 )snamet, ltestt
193 IF( snamet.EQ.snames( i ) )
196 WRITE( nout, fmt = 9990 )snamet
198 50 ltest( i ) = ltestt
208 IF( sdiff( rone + eps, rone ).EQ.rzero )
214 WRITE( nout, fmt = 9998 )eps
221 ab( i, j ) = max( i - j + 1, 0 )
223 ab( j, nmax + 1 ) = j
224 ab( 1, nmax + j ) = j
228 cc( j ) = j*( ( j + 1 )*j )/2 - ( ( j + 1 )*j*( j - 1 ) )/3
234 CALL cmmch( transa, transb, n, 1, n, one, ab, nmax,
235 $ ab( 1, nmax + 1 ), nmax, zero, c, nmax, ct, g, cc,
236 $ nmax, eps, err, fatal, nout, .true. )
237 same = lce( cc, ct, n )
238 IF( .NOT.same.OR.err.NE.rzero )
THEN
239 WRITE( nout, fmt = 9989 )transa, transb, same, err
243 CALL cmmch( transa, transb, n, 1, n, one, ab, nmax,
244 $ ab( 1, nmax + 1 ), nmax, zero, c, nmax, ct, g, cc,
245 $ nmax, eps, err, fatal, nout, .true. )
246 same = lce( cc, ct, n )
247 IF( .NOT.same.OR.err.NE.rzero )
THEN
248 WRITE( nout, fmt = 9989 )transa, transb, same, err
252 ab( j, nmax + 1 ) = n - j + 1
253 ab( 1, nmax + j ) = n - j + 1
256 cc( n - j + 1 ) = j*( ( j + 1 )*j )/2 -
257 $ ( ( j + 1 )*j*( j - 1 ) )/3
261 CALL cmmch( transa, transb, n, 1, n, one, ab, nmax,
262 $ ab( 1, nmax + 1 ), nmax, zero, c, nmax, ct, g, cc,
263 $ nmax, eps, err, fatal, nout, .true. )
264 same = lce( cc, ct, n )
265 IF( .NOT.same.OR.err.NE.rzero )
THEN
266 WRITE( nout, fmt = 9989 )transa, transb, same, err
270 CALL cmmch( transa, transb, n, 1, n, one, ab, nmax,
271 $ ab( 1, nmax + 1 ), nmax, zero, c, nmax, ct, g, cc,
272 $ nmax, eps, err, fatal, nout, .true. )
273 same = lce( cc, ct, n )
274 IF( .NOT.same.OR.err.NE.rzero )
THEN
275 WRITE( nout, fmt = 9989 )transa, transb, same, err
281 DO 200 isnum = 1, nsubs
282 WRITE( nout, fmt = * )
283 IF( .NOT.ltest( isnum ) )
THEN
285 WRITE( nout, fmt = 9987 )snames( isnum )
287 srnamt = snames( isnum )
290 CALL cc3chke( snames( isnum ) )
291 WRITE( nout, fmt = * )
297 GO TO ( 140, 150, 150, 160, 160, 170, 170,
301 CALL cchk1(snames( isnum ), eps, thresh, nout, ntra, trace,
302 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
303 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
307 CALL cchk1(snames( isnum ), eps, thresh, nout, ntra, trace,
308 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
309 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
315 CALL cchk2(snames( isnum ), eps, thresh, nout, ntra, trace,
316 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
317 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
321 CALL cchk2(snames( isnum ), eps, thresh, nout, ntra, trace,
322 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
323 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
329 CALL cchk3(snames( isnum ), eps, thresh, nout, ntra, trace,
330 $ rewi, fatal, nidim, idim, nalf, alf, nmax, ab,
331 $ aa, as, ab( 1, nmax + 1 ), bb, bs, ct, g, c,
335 CALL cchk3(snames( isnum ), eps, thresh, nout, ntra, trace,
336 $ rewi, fatal, nidim, idim, nalf, alf, nmax, ab,
337 $ aa, as, ab( 1, nmax + 1 ), bb, bs, ct, g, c,
343 CALL cchk4(snames( isnum ), eps, thresh, nout, ntra, trace,
344 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
345 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
349 CALL cchk4(snames( isnum ), eps, thresh, nout, ntra, trace,
350 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
351 $ nmax, ab, aa, as, ab( 1, nmax + 1 ), bb, bs, c,
357 CALL cchk5(snames( isnum ), eps, thresh, nout, ntra, trace,
358 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
359 $ nmax, ab, aa, as, bb, bs, c, cc, cs, ct, g, w,
363 CALL cchk5(snames( isnum ), eps, thresh, nout, ntra, trace,
364 $ rewi, fatal, nidim, idim, nalf, alf, nbet, bet,
365 $ nmax, ab, aa, as, bb, bs, c, cc, cs, ct, g, w,
370 190
IF( fatal.AND.sfatal )
374 WRITE( nout, fmt = 9986 )
378 WRITE( nout, fmt = 9985 )
382 WRITE( nout, fmt = 9991 )
390 10002
FORMAT(
' COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED' )
391 10001
FORMAT(
' ROW-MAJOR DATA LAYOUT IS TESTED' )
392 10000
FORMAT(
' COLUMN-MAJOR DATA LAYOUT IS TESTED' )
393 9999
FORMAT(
' ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LES',
395 9998
FORMAT(
' RELATIVE MACHINE PRECISION IS TAKEN TO BE', 1p, e9.1 )
396 9997
FORMAT(
' NUMBER OF VALUES OF ', a,
' IS LESS THAN 1 OR GREATER ',
398 9996
FORMAT(
' VALUE OF N IS LESS THAN 0 OR GREATER THAN ', i2 )
399 9995
FORMAT(
' TESTS OF THE COMPLEX LEVEL 3 BLAS', //
' THE F',
400 $
'OLLOWING PARAMETER VALUES WILL BE USED:' )
401 9994
FORMAT(
' FOR N ', 9i6 )
402 9993
FORMAT(
' FOR ALPHA ',
403 $ 7(
'(', f4.1,
',', f4.1,
') ', : ) )
404 9992
FORMAT(
' FOR BETA ',
405 $ 7(
'(', f4.1,
',', f4.1,
') ', : ) )
406 9991
FORMAT(
' AMEND DATA FILE OR INCREASE ARRAY SIZES IN PROGRAM',
407 $ /
' ******* TESTS ABANDONED *******' )
408 9990
FORMAT(
' SUBPROGRAM NAME ', a12,
' NOT RECOGNIZED', /
' ******* T',
409 $
'ESTS ABANDONED *******' )
410 9989
FORMAT(
' ERROR IN CMMCH - IN-LINE DOT PRODUCTS ARE BEING EVALU',
411 $
'ATED WRONGLY.', /
' CMMCH WAS CALLED WITH TRANSA = ', a1,
412 $
'AND TRANSB = ', a1, /
' AND RETURNED SAME = ', l1,
' AND ',
413 $
' ERR = ', f12.3,
'.', /
' THIS MAY BE DUE TO FAULTS IN THE ',
414 $
'ARITHMETIC OR THE COMPILER.', /
' ******* TESTS ABANDONED ',
416 9988
FORMAT( a12,l2 )
417 9987
FORMAT( 1x, a12,
' WAS NOT TESTED' )
418 9986
FORMAT( /
' END OF TESTS' )
419 9985
FORMAT( /
' ******* FATAL ERROR - TESTS ABANDONED *******' )
420 9984
FORMAT(
' ERROR-EXITS WILL NOT BE TESTED' )
425 SUBROUTINE cchk1( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
426 $ fatal, nidim, idim, nalf, alf, nbet, bet, nmax,
427 $ a, aa, as, b, bb, bs, c, cc, cs, ct, g,
442 parameter ( zero = ( 0.0, 0.0 ) )
444 parameter ( rzero = 0.0 )
447 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
448 LOGICAL FATAL, REWI, TRACE
451 COMPLEX A( nmax, nmax ), AA( nmax*nmax ), ALF( nalf ),
452 $ as( nmax*nmax ), b( nmax, nmax ),
453 $ bb( nmax*nmax ), bet( nbet ), bs( nmax*nmax ),
454 $ c( nmax, nmax ), cc( nmax*nmax ),
455 $ cs( nmax*nmax ), ct( nmax )
457 INTEGER IDIM( nidim )
459 COMPLEX ALPHA, ALS, BETA, BLS
461 INTEGER I, IA, IB, ICA, ICB, IK, IM, IN, K, KS, LAA,
462 $ lbb, lcc, lda, ldas, ldb, ldbs, ldc, ldcs, m,
463 $ ma, mb, ms, n, na, nargs, nb, nc, ns
464 LOGICAL NULL, RESET, SAME, TRANA, TRANB
465 CHARACTER*1 TRANAS, TRANBS, TRANSA, TRANSB
480 COMMON /infoc/infot, noutc, ok, lerr
503 null = n.LE.0.OR.m.LE.0
509 transa = ich( ica: ica )
510 trana = transa.EQ.
'T'.OR.transa.EQ.
'C'
530 CALL cmake(
'ge',
' ',
' ', ma, na, a, nmax, aa, lda,
534 transb = ich( icb: icb )
535 tranb = transb.EQ.
'T'.OR.transb.EQ.
'C'
555 CALL cmake(
'ge',
' ',
' ', mb, nb, b, nmax, bb,
566 CALL cmake(
'ge',
' ',
' ', m, n, c, nmax,
567 $ cc, ldc, reset, zero )
597 $
CALL cprcn1(ntra, nc, sname, iorder,
598 $ transa, transb, m, n, k, alpha, lda,
602 CALL ccgemm( iorder, transa, transb, m, n,
603 $ k, alpha, aa, lda, bb, ldb,
609 WRITE( nout, fmt = 9994 )
616 isame( 1 ) = transa.EQ.tranas
617 isame( 2 ) = transb.EQ.tranbs
621 isame( 6 ) = als.EQ.alpha
622 isame( 7 ) = lce( as, aa, laa )
623 isame( 8 ) = ldas.EQ.lda
624 isame( 9 ) = lce( bs, bb, lbb )
625 isame( 10 ) = ldbs.EQ.ldb
626 isame( 11 ) = bls.EQ.beta
628 isame( 12 ) = lce( cs, cc, lcc )
630 isame( 12 ) = lceres(
'ge',
' ', m, n, cs,
633 isame( 13 ) = ldcs.EQ.ldc
640 same = same.AND.isame( i )
641 IF( .NOT.isame( i ) )
642 $
WRITE( nout, fmt = 9998 )i
653 CALL cmmch( transa, transb, m, n, k,
654 $ alpha, a, nmax, b, nmax, beta,
655 $ c, nmax, ct, g, cc, ldc, eps,
656 $ err, fatal, nout, .true. )
657 errmax = max( errmax, err )
680 IF( errmax.LT.thresh )
THEN
681 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
682 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
684 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
685 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
690 WRITE( nout, fmt = 9996 )sname
691 CALL cprcn1(nout, nc, sname, iorder, transa, transb,
692 $ m, n, k, alpha, lda, ldb, beta, ldc)
697 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
698 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
699 $
'RATIO ', f8.2,
' - SUSPECT *******' )
700 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
701 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
702 $
'RATIO ', f8.2,
' - SUSPECT *******' )
703 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
704 $
' (', i6,
' CALL',
'S)' )
705 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
706 $
' (', i6,
' CALL',
'S)' )
707 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
708 $
'ANGED INCORRECTLY *******' )
709 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
710 9995
FORMAT( 1x, i6,
': ', a12,
'(''', a1,
''',''', a1,
''',',
711 $ 3( i3,
',' ),
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
712 $
',(', f4.1,
',', f4.1,
'), C,', i3,
').' )
713 9994
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
720 SUBROUTINE cprcn1(NOUT, NC, SNAME, IORDER, TRANSA, TRANSB, M, N,
721 $ k, alpha, lda, ldb, beta, ldc)
722 INTEGER NOUT, NC, IORDER, M, N, K, LDA, LDB, LDC
724 CHARACTER*1 TRANSA, TRANSB
726 CHARACTER*14 CRC, CTA,CTB
728 IF (transa.EQ.
'N')
THEN
729 cta =
' CblasNoTrans'
730 ELSE IF (transa.EQ.
'T')
THEN
733 cta =
'CblasConjTrans'
735 IF (transb.EQ.
'N')
THEN
736 ctb =
' CblasNoTrans'
737 ELSE IF (transb.EQ.
'T')
THEN
740 ctb =
'CblasConjTrans'
743 crc =
' CblasRowMajor'
745 crc =
' CblasColMajor'
747 WRITE(nout, fmt = 9995)nc,sname,crc, cta,ctb
748 WRITE(nout, fmt = 9994)m, n, k, alpha, lda, ldb, beta, ldc
750 9995
FORMAT( 1x, i6,
': ', a12,
'(', a14,
',', a14,
',', a14,
',')
751 9994
FORMAT( 10x, 3( i3,
',' ) ,
' (', f4.1,
',',f4.1,
') , A,',
752 $ i3,
', B,', i3,
', (', f4.1,
',',f4.1,
') , C,', i3,
').' )
755 SUBROUTINE cchk2( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
756 $ fatal, nidim, idim, nalf, alf, nbet, bet, nmax,
757 $ a, aa, as, b, bb, bs, c, cc, cs, ct, g,
772 parameter ( zero = ( 0.0, 0.0 ) )
774 parameter ( rzero = 0.0 )
777 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
778 LOGICAL FATAL, REWI, TRACE
781 COMPLEX A( nmax, nmax ), AA( nmax*nmax ), ALF( nalf ),
782 $ as( nmax*nmax ), b( nmax, nmax ),
783 $ bb( nmax*nmax ), bet( nbet ), bs( nmax*nmax ),
784 $ c( nmax, nmax ), cc( nmax*nmax ),
785 $ cs( nmax*nmax ), ct( nmax )
787 INTEGER IDIM( nidim )
789 COMPLEX ALPHA, ALS, BETA, BLS
791 INTEGER I, IA, IB, ICS, ICU, IM, IN, LAA, LBB, LCC,
792 $ lda, ldas, ldb, ldbs, ldc, ldcs, m, ms, n, na,
794 LOGICAL CONJ, LEFT, NULL, RESET, SAME
795 CHARACTER*1 SIDE, SIDES, UPLO, UPLOS
796 CHARACTER*2 ICHS, ICHU
810 COMMON /infoc/infot, noutc, ok, lerr
812 DATA ichs/
'LR'/, ichu/
'UL'/
814 conj = sname( 8: 9 ).EQ.
'he'
834 null = n.LE.0.OR.m.LE.0
846 CALL cmake(
'ge',
' ',
' ', m, n, b, nmax, bb, ldb, reset,
850 side = ichs( ics: ics )
868 uplo = ichu( icu: icu )
872 CALL cmake(sname( 8: 9 ), uplo,
' ', na, na, a, nmax,
873 $ aa, lda, reset, zero )
883 CALL cmake(
'ge',
' ',
' ', m, n, c, nmax, cc,
913 $
CALL cprcn2(ntra, nc, sname, iorder,
914 $ side, uplo, m, n, alpha, lda, ldb,
919 CALL cchemm( iorder, side, uplo, m, n,
920 $ alpha, aa, lda, bb, ldb, beta,
923 CALL ccsymm( iorder, side, uplo, m, n,
924 $ alpha, aa, lda, bb, ldb, beta,
931 WRITE( nout, fmt = 9994 )
938 isame( 1 ) = sides.EQ.side
939 isame( 2 ) = uplos.EQ.uplo
942 isame( 5 ) = als.EQ.alpha
943 isame( 6 ) = lce( as, aa, laa )
944 isame( 7 ) = ldas.EQ.lda
945 isame( 8 ) = lce( bs, bb, lbb )
946 isame( 9 ) = ldbs.EQ.ldb
947 isame( 10 ) = bls.EQ.beta
949 isame( 11 ) = lce( cs, cc, lcc )
951 isame( 11 ) = lceres(
'ge',
' ', m, n, cs,
954 isame( 12 ) = ldcs.EQ.ldc
961 same = same.AND.isame( i )
962 IF( .NOT.isame( i ) )
963 $
WRITE( nout, fmt = 9998 )i
975 CALL cmmch(
'N',
'N', m, n, m, alpha, a,
976 $ nmax, b, nmax, beta, c, nmax,
977 $ ct, g, cc, ldc, eps, err,
978 $ fatal, nout, .true. )
980 CALL cmmch(
'N',
'N', m, n, n, alpha, b,
981 $ nmax, a, nmax, beta, c, nmax,
982 $ ct, g, cc, ldc, eps, err,
983 $ fatal, nout, .true. )
985 errmax = max( errmax, err )
1006 IF( errmax.LT.thresh )
THEN
1007 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
1008 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
1010 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
1011 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
1016 WRITE( nout, fmt = 9996 )sname
1017 CALL cprcn2(nout, nc, sname, iorder, side, uplo, m, n, alpha, lda,
1023 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
1024 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1025 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1026 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
1027 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1028 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1029 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
1030 $
' (', i6,
' CALL',
'S)' )
1031 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
1032 $
' (', i6,
' CALL',
'S)' )
1033 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
1034 $
'ANGED INCORRECTLY *******' )
1035 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
1036 9995
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
1037 $
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
',(', f4.1,
1038 $
',', f4.1,
'), C,', i3,
') .' )
1039 9994
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1046 SUBROUTINE cprcn2(NOUT, NC, SNAME, IORDER, SIDE, UPLO, M, N,
1047 $ alpha, lda, ldb, beta, ldc)
1048 INTEGER NOUT, NC, IORDER, M, N, LDA, LDB, LDC
1050 CHARACTER*1 SIDE, UPLO
1052 CHARACTER*14 CRC, CS,CU
1054 IF (side.EQ.
'L')
THEN
1059 IF (uplo.EQ.
'U')
THEN
1064 IF (iorder.EQ.1)
THEN
1065 crc =
' CblasRowMajor'
1067 crc =
' CblasColMajor'
1069 WRITE(nout, fmt = 9995)nc,sname,crc, cs,cu
1070 WRITE(nout, fmt = 9994)m, n, alpha, lda, ldb, beta, ldc
1072 9995
FORMAT( 1x, i6,
': ', a12,
'(', a14,
',', a14,
',', a14,
',')
1073 9994
FORMAT( 10x, 2( i3,
',' ),
' (',f4.1,
',',f4.1,
'), A,', i3,
1074 $
', B,', i3,
', (',f4.1,
',',f4.1,
'), ',
'C,', i3,
').' )
1077 SUBROUTINE cchk3( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
1078 $ fatal, nidim, idim, nalf, alf, nmax, a, aa, as,
1079 $ b, bb, bs, ct, g, c, iorder )
1093 parameter ( zero = ( 0.0, 0.0 ), one = ( 1.0, 0.0 ) )
1095 parameter ( rzero = 0.0 )
1098 INTEGER NALF, NIDIM, NMAX, NOUT, NTRA, IORDER
1099 LOGICAL FATAL, REWI, TRACE
1102 COMPLEX A( nmax, nmax ), AA( nmax*nmax ), ALF( nalf ),
1103 $ as( nmax*nmax ), b( nmax, nmax ),
1104 $ bb( nmax*nmax ), bs( nmax*nmax ),
1105 $ c( nmax, nmax ), ct( nmax )
1107 INTEGER IDIM( nidim )
1111 INTEGER I, IA, ICD, ICS, ICT, ICU, IM, IN, J, LAA, LBB,
1112 $ lda, ldas, ldb, ldbs, m, ms, n, na, nargs, nc,
1114 LOGICAL LEFT, NULL, RESET, SAME
1115 CHARACTER*1 DIAG, DIAGS, SIDE, SIDES, TRANAS, TRANSA, UPLO,
1117 CHARACTER*2 ICHD, ICHS, ICHU
1123 EXTERNAL lce, lceres
1129 INTEGER INFOT, NOUTC
1132 COMMON /infoc/infot, noutc, ok, lerr
1134 DATA ichu/
'UL'/, icht/
'NTC'/, ichd/
'UN'/, ichs/
'LR'/
1148 DO 140 im = 1, nidim
1151 DO 130 in = 1, nidim
1161 null = m.LE.0.OR.n.LE.0
1164 side = ichs( ics: ics )
1181 uplo = ichu( icu: icu )
1184 transa = icht( ict: ict )
1187 diag = ichd( icd: icd )
1194 CALL cmake(
'tr', uplo, diag, na, na, a,
1195 $ nmax, aa, lda, reset, zero )
1199 CALL cmake(
'ge',
' ',
' ', m, n, b, nmax,
1200 $ bb, ldb, reset, zero )
1225 IF( sname( 10: 11 ).EQ.
'mm' )
THEN
1227 $
CALL cprcn3( ntra, nc, sname, iorder,
1228 $ side, uplo, transa, diag, m, n, alpha,
1232 CALL cctrmm(iorder, side, uplo, transa,
1233 $ diag, m, n, alpha, aa, lda,
1235 ELSE IF( sname( 10: 11 ).EQ.
'sm' )
THEN
1237 $
CALL cprcn3( ntra, nc, sname, iorder,
1238 $ side, uplo, transa, diag, m, n, alpha,
1242 CALL cctrsm(iorder, side, uplo, transa,
1243 $ diag, m, n, alpha, aa, lda,
1250 WRITE( nout, fmt = 9994 )
1257 isame( 1 ) = sides.EQ.side
1258 isame( 2 ) = uplos.EQ.uplo
1259 isame( 3 ) = tranas.EQ.transa
1260 isame( 4 ) = diags.EQ.diag
1261 isame( 5 ) = ms.EQ.m
1262 isame( 6 ) = ns.EQ.n
1263 isame( 7 ) = als.EQ.alpha
1264 isame( 8 ) = lce( as, aa, laa )
1265 isame( 9 ) = ldas.EQ.lda
1267 isame( 10 ) = lce( bs, bb, lbb )
1269 isame( 10 ) = lceres(
'ge',
' ', m, n, bs,
1272 isame( 11 ) = ldbs.EQ.ldb
1279 same = same.AND.isame( i )
1280 IF( .NOT.isame( i ) )
1281 $
WRITE( nout, fmt = 9998 )i
1289 IF( sname( 10: 11 ).EQ.
'mm' )
THEN
1294 CALL cmmch( transa,
'N', m, n, m,
1295 $ alpha, a, nmax, b, nmax,
1296 $ zero, c, nmax, ct, g,
1297 $ bb, ldb, eps, err,
1298 $ fatal, nout, .true. )
1300 CALL cmmch(
'N', transa, m, n, n,
1301 $ alpha, b, nmax, a, nmax,
1302 $ zero, c, nmax, ct, g,
1303 $ bb, ldb, eps, err,
1304 $ fatal, nout, .true. )
1306 ELSE IF( sname( 10: 11 ).EQ.
'sm' )
THEN
1313 c( i, j ) = bb( i + ( j - 1 )*
1315 bb( i + ( j - 1 )*ldb ) = alpha*
1321 CALL cmmch( transa,
'N', m, n, m,
1322 $ one, a, nmax, c, nmax,
1323 $ zero, b, nmax, ct, g,
1324 $ bb, ldb, eps, err,
1325 $ fatal, nout, .false. )
1327 CALL cmmch(
'N', transa, m, n, n,
1328 $ one, c, nmax, a, nmax,
1329 $ zero, b, nmax, ct, g,
1330 $ bb, ldb, eps, err,
1331 $ fatal, nout, .false. )
1334 errmax = max( errmax, err )
1357 IF( errmax.LT.thresh )
THEN
1358 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
1359 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
1361 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
1362 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
1367 WRITE( nout, fmt = 9996 )sname
1369 $
CALL cprcn3( ntra, nc, sname, iorder, side, uplo, transa, diag,
1370 $ m, n, alpha, lda, ldb)
1375 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
1376 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1377 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1378 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
1379 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1380 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1381 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
1382 $
' (', i6,
' CALL',
'S)' )
1383 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
1384 $
' (', i6,
' CALL',
'S)' )
1385 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
1386 $
'ANGED INCORRECTLY *******' )
1387 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
1388 9995
FORMAT(1x, i6,
': ', a12,
'(', 4(
'''', a1,
''',' ), 2( i3,
',' ),
1389 $
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
') ',
1391 9994
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1398 SUBROUTINE cprcn3(NOUT, NC, SNAME, IORDER, SIDE, UPLO, TRANSA,
1399 $ diag, m, n, alpha, lda, ldb)
1400 INTEGER NOUT, NC, IORDER, M, N, LDA, LDB
1402 CHARACTER*1 SIDE, UPLO, TRANSA, DIAG
1404 CHARACTER*14 CRC, CS, CU, CA, CD
1406 IF (side.EQ.
'L')
THEN
1411 IF (uplo.EQ.
'U')
THEN
1416 IF (transa.EQ.
'N')
THEN
1417 ca =
' CblasNoTrans'
1418 ELSE IF (transa.EQ.
'T')
THEN
1421 ca =
'CblasConjTrans'
1423 IF (diag.EQ.
'N')
THEN
1424 cd =
' CblasNonUnit'
1428 IF (iorder.EQ.1)
THEN
1429 crc =
' CblasRowMajor'
1431 crc =
' CblasColMajor'
1433 WRITE(nout, fmt = 9995)nc,sname,crc, cs,cu
1434 WRITE(nout, fmt = 9994)ca, cd, m, n, alpha, lda, ldb
1436 9995
FORMAT( 1x, i6,
': ', a12,
'(', a14,
',', a14,
',', a14,
',')
1437 9994
FORMAT( 10x, 2( a14,
',') , 2( i3,
',' ),
' (', f4.1,
',',
1438 $ f4.1,
'), A,', i3,
', B,', i3,
').' )
1441 SUBROUTINE cchk4( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
1442 $ fatal, nidim, idim, nalf, alf, nbet, bet, nmax,
1443 $ a, aa, as, b, bb, bs, c, cc, cs, ct, g,
1458 parameter ( zero = ( 0.0, 0.0 ) )
1460 parameter ( rone = 1.0, rzero = 0.0 )
1463 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
1464 LOGICAL FATAL, REWI, TRACE
1467 COMPLEX A( nmax, nmax ), AA( nmax*nmax ), ALF( nalf ),
1468 $ as( nmax*nmax ), b( nmax, nmax ),
1469 $ bb( nmax*nmax ), bet( nbet ), bs( nmax*nmax ),
1470 $ c( nmax, nmax ), cc( nmax*nmax ),
1471 $ cs( nmax*nmax ), ct( nmax )
1473 INTEGER IDIM( nidim )
1475 COMPLEX ALPHA, ALS, BETA, BETS
1476 REAL ERR, ERRMAX, RALPHA, RALS, RBETA, RBETS
1477 INTEGER I, IA, IB, ICT, ICU, IK, IN, J, JC, JJ, K, KS,
1478 $ laa, lcc, lda, ldas, ldc, ldcs, lj, ma, n, na,
1480 LOGICAL CONJ, NULL, RESET, SAME, TRAN, UPPER
1481 CHARACTER*1 TRANS, TRANSS, TRANST, UPLO, UPLOS
1482 CHARACTER*2 ICHT, ICHU
1487 EXTERNAL lce, lceres
1491 INTRINSIC cmplx, max, real
1493 INTEGER INFOT, NOUTC
1496 COMMON /infoc/infot, noutc, ok, lerr
1498 DATA icht/
'NC'/, ichu/
'UL'/
1500 conj = sname( 8: 9 ).EQ.
'he'
1507 DO 100 in = 1, nidim
1522 trans = icht( ict: ict )
1524 IF( tran.AND..NOT.conj )
1544 CALL cmake(
'ge',
' ',
' ', ma, na, a, nmax, aa, lda,
1548 uplo = ichu( icu: icu )
1554 ralpha =
REAL( alpha )
1555 alpha = cmplx( ralpha, rzero )
1561 rbeta =
REAL( beta )
1562 beta = cmplx( rbeta, rzero )
1566 $ null = null.OR.( ( k.LE.0.OR.ralpha.EQ.
1567 $ rzero ).AND.rbeta.EQ.rone )
1571 CALL cmake( sname( 8: 9 ), uplo,
' ', n, n, c,
1572 $ nmax, cc, ldc, reset, zero )
1605 $
CALL cprcn6( ntra, nc, sname, iorder,
1606 $ uplo, trans, n, k, ralpha, lda, rbeta,
1610 CALL ccherk( iorder, uplo, trans, n, k,
1611 $ ralpha, aa, lda, rbeta, cc,
1615 $
CALL cprcn4( ntra, nc, sname, iorder,
1616 $ uplo, trans, n, k, alpha, lda, beta, ldc)
1619 CALL ccsyrk( iorder, uplo, trans, n, k,
1620 $ alpha, aa, lda, beta, cc, ldc )
1626 WRITE( nout, fmt = 9992 )
1633 isame( 1 ) = uplos.EQ.uplo
1634 isame( 2 ) = transs.EQ.trans
1635 isame( 3 ) = ns.EQ.n
1636 isame( 4 ) = ks.EQ.k
1638 isame( 5 ) = rals.EQ.ralpha
1640 isame( 5 ) = als.EQ.alpha
1642 isame( 6 ) = lce( as, aa, laa )
1643 isame( 7 ) = ldas.EQ.lda
1645 isame( 8 ) = rbets.EQ.rbeta
1647 isame( 8 ) = bets.EQ.beta
1650 isame( 9 ) = lce( cs, cc, lcc )
1652 isame( 9 ) = lceres( sname( 8: 9 ), uplo, n,
1655 isame( 10 ) = ldcs.EQ.ldc
1662 same = same.AND.isame( i )
1663 IF( .NOT.isame( i ) )
1664 $
WRITE( nout, fmt = 9998 )i
1690 CALL cmmch( transt,
'N', lj, 1, k,
1691 $ alpha, a( 1, jj ), nmax,
1692 $ a( 1, j ), nmax, beta,
1693 $ c( jj, j ), nmax, ct, g,
1694 $ cc( jc ), ldc, eps, err,
1695 $ fatal, nout, .true. )
1697 CALL cmmch(
'N', transt, lj, 1, k,
1698 $ alpha, a( jj, 1 ), nmax,
1699 $ a( j, 1 ), nmax, beta,
1700 $ c( jj, j ), nmax, ct, g,
1701 $ cc( jc ), ldc, eps, err,
1702 $ fatal, nout, .true. )
1709 errmax = max( errmax, err )
1731 IF( errmax.LT.thresh )
THEN
1732 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
1733 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
1735 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
1736 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
1742 $
WRITE( nout, fmt = 9995 )j
1745 WRITE( nout, fmt = 9996 )sname
1747 CALL cprcn6( nout, nc, sname, iorder, uplo, trans, n, k, ralpha,
1750 CALL cprcn4( nout, nc, sname, iorder, uplo, trans, n, k, alpha,
1757 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
1758 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1759 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1760 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
1761 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
1762 $
'RATIO ', f8.2,
' - SUSPECT *******' )
1763 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
1764 $
' (', i6,
' CALL',
'S)' )
1765 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
1766 $
' (', i6,
' CALL',
'S)' )
1767 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
1768 $
'ANGED INCORRECTLY *******' )
1769 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
1770 9995
FORMAT(
' THESE ARE THE RESULTS FOR COLUMN ', i3 )
1771 9994
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
1772 $ f4.1,
', A,', i3,
',', f4.1,
', C,', i3,
') ',
1774 9993
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
1775 $
'(', f4.1,
',', f4.1,
') , A,', i3,
',(', f4.1,
',', f4.1,
1776 $
'), C,', i3,
') .' )
1777 9992
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1784 SUBROUTINE cprcn4(NOUT, NC, SNAME, IORDER, UPLO, TRANSA,
1785 $ n, k, alpha, lda, beta, ldc)
1786 INTEGER NOUT, NC, IORDER, N, K, LDA, LDC
1788 CHARACTER*1 UPLO, TRANSA
1790 CHARACTER*14 CRC, CU, CA
1792 IF (uplo.EQ.
'U')
THEN
1797 IF (transa.EQ.
'N')
THEN
1798 ca =
' CblasNoTrans'
1799 ELSE IF (transa.EQ.
'T')
THEN
1802 ca =
'CblasConjTrans'
1804 IF (iorder.EQ.1)
THEN
1805 crc =
' CblasRowMajor'
1807 crc =
' CblasColMajor'
1809 WRITE(nout, fmt = 9995)nc, sname, crc, cu, ca
1810 WRITE(nout, fmt = 9994)n, k, alpha, lda, beta, ldc
1812 9995
FORMAT( 1x, i6,
': ', a12,
'(', 3( a14,
',') )
1813 9994
FORMAT( 10x, 2( i3,
',' ),
' (', f4.1,
',', f4.1 ,
'), A,',
1814 $ i3,
', (', f4.1,
',', f4.1,
'), C,', i3,
').' )
1818 SUBROUTINE cprcn6(NOUT, NC, SNAME, IORDER, UPLO, TRANSA,
1819 $ n, k, alpha, lda, beta, ldc)
1820 INTEGER NOUT, NC, IORDER, N, K, LDA, LDC
1822 CHARACTER*1 UPLO, TRANSA
1824 CHARACTER*14 CRC, CU, CA
1826 IF (uplo.EQ.
'U')
THEN
1831 IF (transa.EQ.
'N')
THEN
1832 ca =
' CblasNoTrans'
1833 ELSE IF (transa.EQ.
'T')
THEN
1836 ca =
'CblasConjTrans'
1838 IF (iorder.EQ.1)
THEN
1839 crc =
' CblasRowMajor'
1841 crc =
' CblasColMajor'
1843 WRITE(nout, fmt = 9995)nc, sname, crc, cu, ca
1844 WRITE(nout, fmt = 9994)n, k, alpha, lda, beta, ldc
1846 9995
FORMAT( 1x, i6,
': ', a12,
'(', 3( a14,
',') )
1847 9994
FORMAT( 10x, 2( i3,
',' ),
1848 $ f4.1,
', A,', i3,
',', f4.1,
', C,', i3,
').' )
1851 SUBROUTINE cchk5( SNAME, EPS, THRESH, NOUT, NTRA, TRACE, REWI,
1852 $ fatal, nidim, idim, nalf, alf, nbet, bet, nmax,
1853 $ ab, aa, as, bb, bs, c, cc, cs, ct, g, w,
1868 parameter ( zero = ( 0.0, 0.0 ), one = ( 1.0, 0.0 ) )
1870 parameter ( rone = 1.0, rzero = 0.0 )
1873 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
1874 LOGICAL FATAL, REWI, TRACE
1877 COMPLEX AA( nmax*nmax ), AB( 2*nmax*nmax ),
1878 $ alf( nalf ), as( nmax*nmax ), bb( nmax*nmax ),
1879 $ bet( nbet ), bs( nmax*nmax ), c( nmax, nmax ),
1880 $ cc( nmax*nmax ), cs( nmax*nmax ), ct( nmax ),
1883 INTEGER IDIM( nidim )
1885 COMPLEX ALPHA, ALS, BETA, BETS
1886 REAL ERR, ERRMAX, RBETA, RBETS
1887 INTEGER I, IA, IB, ICT, ICU, IK, IN, J, JC, JJ, JJAB,
1888 $ k, ks, laa, lbb, lcc, lda, ldas, ldb, ldbs,
1889 $ ldc, ldcs, lj, ma, n, na, nargs, nc, ns
1890 LOGICAL CONJ, NULL, RESET, SAME, TRAN, UPPER
1891 CHARACTER*1 TRANS, TRANSS, TRANST, UPLO, UPLOS
1892 CHARACTER*2 ICHT, ICHU
1897 EXTERNAL lce, lceres
1901 INTRINSIC cmplx, conjg, max, real
1903 INTEGER INFOT, NOUTC
1906 COMMON /infoc/infot, noutc, ok, lerr
1908 DATA icht/
'NC'/, ichu/
'UL'/
1910 conj = sname( 8: 9 ).EQ.
'he'
1917 DO 130 in = 1, nidim
1928 DO 120 ik = 1, nidim
1932 trans = icht( ict: ict )
1934 IF( tran.AND..NOT.conj )
1955 CALL cmake(
'ge',
' ',
' ', ma, na, ab, 2*nmax, aa,
1956 $ lda, reset, zero )
1958 CALL cmake(
'ge',
' ',
' ', ma, na, ab, nmax, aa, lda,
1967 CALL cmake(
'ge',
' ',
' ', ma, na, ab( k + 1 ),
1968 $ 2*nmax, bb, ldb, reset, zero )
1970 CALL cmake(
'ge',
' ',
' ', ma, na, ab( k*nmax + 1 ),
1971 $ nmax, bb, ldb, reset, zero )
1975 uplo = ichu( icu: icu )
1984 rbeta =
REAL( beta )
1985 beta = cmplx( rbeta, rzero )
1989 $ null = null.OR.( ( k.LE.0.OR.alpha.EQ.
1990 $ zero ).AND.rbeta.EQ.rone )
1994 CALL cmake( sname( 8: 9 ), uplo,
' ', n, n, c,
1995 $ nmax, cc, ldc, reset, zero )
2028 $
CALL cprcn7( ntra, nc, sname, iorder,
2029 $ uplo, trans, n, k, alpha, lda, ldb,
2033 CALL ccher2k( iorder, uplo, trans, n, k,
2034 $ alpha, aa, lda, bb, ldb, rbeta,
2038 $
CALL cprcn5( ntra, nc, sname, iorder,
2039 $ uplo, trans, n, k, alpha, lda, ldb,
2043 CALL ccsyr2k( iorder, uplo, trans, n, k,
2044 $ alpha, aa, lda, bb, ldb, beta,
2051 WRITE( nout, fmt = 9992 )
2058 isame( 1 ) = uplos.EQ.uplo
2059 isame( 2 ) = transs.EQ.trans
2060 isame( 3 ) = ns.EQ.n
2061 isame( 4 ) = ks.EQ.k
2062 isame( 5 ) = als.EQ.alpha
2063 isame( 6 ) = lce( as, aa, laa )
2064 isame( 7 ) = ldas.EQ.lda
2065 isame( 8 ) = lce( bs, bb, lbb )
2066 isame( 9 ) = ldbs.EQ.ldb
2068 isame( 10 ) = rbets.EQ.rbeta
2070 isame( 10 ) = bets.EQ.beta
2073 isame( 11 ) = lce( cs, cc, lcc )
2075 isame( 11 ) = lceres(
'he', uplo, n, n, cs,
2078 isame( 12 ) = ldcs.EQ.ldc
2085 same = same.AND.isame( i )
2086 IF( .NOT.isame( i ) )
2087 $
WRITE( nout, fmt = 9998 )i
2115 w( i ) = alpha*ab( ( j - 1 )*2*
2118 w( k + i ) = conjg( alpha )*
2127 CALL cmmch( transt,
'N', lj, 1, 2*k,
2128 $ one, ab( jjab ), 2*nmax, w,
2129 $ 2*nmax, beta, c( jj, j ),
2130 $ nmax, ct, g, cc( jc ), ldc,
2131 $ eps, err, fatal, nout,
2136 w( i ) = alpha*conjg( ab( ( k +
2137 $ i - 1 )*nmax + j ) )
2138 w( k + i ) = conjg( alpha*
2139 $ ab( ( i - 1 )*nmax +
2142 w( i ) = alpha*ab( ( k + i - 1 )*
2145 $ ab( ( i - 1 )*nmax +
2149 CALL cmmch(
'N',
'N', lj, 1, 2*k, one,
2150 $ ab( jj ), nmax, w, 2*nmax,
2151 $ beta, c( jj, j ), nmax, ct,
2152 $ g, cc( jc ), ldc, eps, err,
2153 $ fatal, nout, .true. )
2160 $ jjab = jjab + 2*nmax
2162 errmax = max( errmax, err )
2184 IF( errmax.LT.thresh )
THEN
2185 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10000 )sname, nc
2186 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10001 )sname, nc
2188 IF ( iorder.EQ.0)
WRITE( nout, fmt = 10002 )sname, nc, errmax
2189 IF ( iorder.EQ.1)
WRITE( nout, fmt = 10003 )sname, nc, errmax
2195 $
WRITE( nout, fmt = 9995 )j
2198 WRITE( nout, fmt = 9996 )sname
2200 CALL cprcn7( nout, nc, sname, iorder, uplo, trans, n, k,
2201 $ alpha, lda, ldb, rbeta, ldc)
2203 CALL cprcn5( nout, nc, sname, iorder, uplo, trans, n, k,
2204 $ alpha, lda, ldb, beta, ldc)
2210 10003
FORMAT(
' ', a12,
' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
2211 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
2212 $
'RATIO ', f8.2,
' - SUSPECT *******' )
2213 10002
FORMAT(
' ', a12,
' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
2214 $
'TESTS (', i6,
' CALLS)', /
' ******* BUT WITH MAXIMUM TEST ',
2215 $
'RATIO ', f8.2,
' - SUSPECT *******' )
2216 10001
FORMAT(
' ', a12,
' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
2217 $
' (', i6,
' CALL',
'S)' )
2218 10000
FORMAT(
' ', a12,
' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
2219 $
' (', i6,
' CALL',
'S)' )
2220 9998
FORMAT(
' ******* FATAL ERROR - PARAMETER NUMBER ', i2,
' WAS CH',
2221 $
'ANGED INCORRECTLY *******' )
2222 9996
FORMAT(
' ******* ', a12,
' FAILED ON CALL NUMBER:' )
2223 9995
FORMAT(
' THESE ARE THE RESULTS FOR COLUMN ', i3 )
2224 9994
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
2225 $
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
',', f4.1,
2226 $
', C,', i3,
') .' )
2227 9993
FORMAT(1x, i6,
': ', a12,
'(', 2(
'''', a1,
''',' ), 2( i3,
',' ),
2228 $
'(', f4.1,
',', f4.1,
'), A,', i3,
', B,', i3,
',(', f4.1,
2229 $
',', f4.1,
'), C,', i3,
') .' )
2230 9992
FORMAT(
' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
2237 SUBROUTINE cprcn5(NOUT, NC, SNAME, IORDER, UPLO, TRANSA,
2238 $ n, k, alpha, lda, ldb, beta, ldc)
2239 INTEGER NOUT, NC, IORDER, N, K, LDA, LDB, LDC
2241 CHARACTER*1 UPLO, TRANSA
2243 CHARACTER*14 CRC, CU, CA
2245 IF (uplo.EQ.
'U')
THEN
2250 IF (transa.EQ.
'N')
THEN
2251 ca =
' CblasNoTrans'
2252 ELSE IF (transa.EQ.
'T')
THEN
2255 ca =
'CblasConjTrans'
2257 IF (iorder.EQ.1)
THEN
2258 crc =
' CblasRowMajor'
2260 crc =
' CblasColMajor'
2262 WRITE(nout, fmt = 9995)nc, sname, crc, cu, ca
2263 WRITE(nout, fmt = 9994)n, k, alpha, lda, ldb, beta, ldc
2265 9995
FORMAT( 1x, i6,
': ', a12,
'(', 3( a14,
',') )
2266 9994
FORMAT( 10x, 2( i3,
',' ),
' (', f4.1,
',', f4.1,
'), A,',
2267 $ i3,
', B', i3,
', (', f4.1,
',', f4.1,
'), C,', i3,
').' )
2271 SUBROUTINE cprcn7(NOUT, NC, SNAME, IORDER, UPLO, TRANSA,
2272 $ n, k, alpha, lda, ldb, beta, ldc)
2273 INTEGER NOUT, NC, IORDER, N, K, LDA, LDB, LDC
2276 CHARACTER*1 UPLO, TRANSA
2278 CHARACTER*14 CRC, CU, CA
2280 IF (uplo.EQ.
'U')
THEN
2285 IF (transa.EQ.
'N')
THEN
2286 ca =
' CblasNoTrans'
2287 ELSE IF (transa.EQ.
'T')
THEN
2290 ca =
'CblasConjTrans'
2292 IF (iorder.EQ.1)
THEN
2293 crc =
' CblasRowMajor'
2295 crc =
' CblasColMajor'
2297 WRITE(nout, fmt = 9995)nc, sname, crc, cu, ca
2298 WRITE(nout, fmt = 9994)n, k, alpha, lda, ldb, beta, ldc
2300 9995
FORMAT( 1x, i6,
': ', a12,
'(', 3( a14,
',') )
2301 9994
FORMAT( 10x, 2( i3,
',' ),
' (', f4.1,
',', f4.1,
'), A,',
2302 $ i3,
', B', i3,
',', f4.1,
', C,', i3,
').' )
2305 SUBROUTINE cmake(TYPE, UPLO, DIAG, M, N, A, NMAX, AA, LDA, RESET,
2324 parameter ( zero = ( 0.0, 0.0 ), one = ( 1.0, 0.0 ) )
2326 parameter ( rogue = ( -1.0e10, 1.0e10 ) )
2328 parameter ( rzero = 0.0 )
2330 parameter ( rrogue = -1.0e10 )
2333 INTEGER LDA, M, N, NMAX
2335 CHARACTER*1 DIAG, UPLO
2338 COMPLEX A( nmax, * ), AA( * )
2340 INTEGER I, IBEG, IEND, J, JJ
2341 LOGICAL GEN, HER, LOWER, SYM, TRI, UNIT, UPPER
2346 INTRINSIC cmplx, conjg, real
2352 upper = ( her.OR.sym.OR.tri ).AND.uplo.EQ.
'U'
2353 lower = ( her.OR.sym.OR.tri ).AND.uplo.EQ.
'L'
2354 unit = tri.AND.diag.EQ.
'U'
2360 IF( gen.OR.( upper.AND.i.LE.j ).OR.( lower.AND.i.GE.j ) )
2362 a( i, j ) = cbeg( reset ) + transl
2365 IF( n.GT.3.AND.j.EQ.n/2 )
2368 a( j, i ) = conjg( a( i, j ) )
2370 a( j, i ) = a( i, j )
2378 $ a( j, j ) = cmplx(
REAL( A( J, J ) ), RZERO )
2380 $ a( j, j ) = a( j, j ) + one
2387 IF( type.EQ.
'ge' )
THEN
2390 aa( i + ( j - 1 )*lda ) = a( i, j )
2392 DO 40 i = m + 1, lda
2393 aa( i + ( j - 1 )*lda ) = rogue
2396 ELSE IF( type.EQ.
'he'.OR.type.EQ.
'sy'.OR.type.EQ.
'tr' )
THEN
2413 DO 60 i = 1, ibeg - 1
2414 aa( i + ( j - 1 )*lda ) = rogue
2416 DO 70 i = ibeg, iend
2417 aa( i + ( j - 1 )*lda ) = a( i, j )
2419 DO 80 i = iend + 1, lda
2420 aa( i + ( j - 1 )*lda ) = rogue
2423 jj = j + ( j - 1 )*lda
2424 aa( jj ) = cmplx(
REAL( AA( JJ ) ), RROGUE )
2433 SUBROUTINE cmmch(TRANSA, TRANSB, M, N, KK, ALPHA, A, LDA, B, LDB,
2434 $ beta, c, ldc, ct, g, cc, ldcc, eps, err, fatal,
2449 parameter ( zero = ( 0.0, 0.0 ) )
2451 parameter ( rzero = 0.0, rone = 1.0 )
2455 INTEGER KK, LDA, LDB, LDC, LDCC, M, N, NOUT
2457 CHARACTER*1 TRANSA, TRANSB
2459 COMPLEX A( lda, * ), B( ldb, * ), C( ldc, * ),
2460 $ cc( ldcc, * ), ct( * )
2466 LOGICAL CTRANA, CTRANB, TRANA, TRANB
2468 INTRINSIC abs, aimag, conjg, max,
REAL, SQRT
2472 abs1( cl ) = abs(
REAL( CL ) ) + abs( AIMAG( cl ) )
2474 trana = transa.EQ.
'T'.OR.transa.EQ.
'C'
2475 tranb = transb.EQ.
'T'.OR.transb.EQ.
'C'
2476 ctrana = transa.EQ.
'C'
2477 ctranb = transb.EQ.
'C'
2489 IF( .NOT.trana.AND..NOT.tranb )
THEN
2492 ct( i ) = ct( i ) + a( i, k )*b( k, j )
2493 g( i ) = g( i ) + abs1( a( i, k ) )*abs1( b( k, j ) )
2496 ELSE IF( trana.AND..NOT.tranb )
THEN
2500 ct( i ) = ct( i ) + conjg( a( k, i ) )*b( k, j )
2501 g( i ) = g( i ) + abs1( a( k, i ) )*
2508 ct( i ) = ct( i ) + a( k, i )*b( k, j )
2509 g( i ) = g( i ) + abs1( a( k, i ) )*
2514 ELSE IF( .NOT.trana.AND.tranb )
THEN
2518 ct( i ) = ct( i ) + a( i, k )*conjg( b( j, k ) )
2519 g( i ) = g( i ) + abs1( a( i, k ) )*
2526 ct( i ) = ct( i ) + a( i, k )*b( j, k )
2527 g( i ) = g( i ) + abs1( a( i, k ) )*
2532 ELSE IF( trana.AND.tranb )
THEN
2537 ct( i ) = ct( i ) + conjg( a( k, i ) )*
2538 $ conjg( b( j, k ) )
2539 g( i ) = g( i ) + abs1( a( k, i ) )*
2546 ct( i ) = ct( i ) + conjg( a( k, i ) )*b( j, k )
2547 g( i ) = g( i ) + abs1( a( k, i ) )*
2556 ct( i ) = ct( i ) + a( k, i )*conjg( b( j, k ) )
2557 g( i ) = g( i ) + abs1( a( k, i ) )*
2564 ct( i ) = ct( i ) + a( k, i )*b( j, k )
2565 g( i ) = g( i ) + abs1( a( k, i ) )*
2573 ct( i ) = alpha*ct( i ) + beta*c( i, j )
2574 g( i ) = abs1( alpha )*g( i ) +
2575 $ abs1( beta )*abs1( c( i, j ) )
2582 erri = abs1( ct( i ) - cc( i, j ) )/eps
2583 IF( g( i ).NE.rzero )
2584 $ erri = erri/g( i )
2585 err = max( err, erri )
2586 IF( err*sqrt( eps ).GE.rone )
2598 WRITE( nout, fmt = 9999 )
2601 WRITE( nout, fmt = 9998 )i, ct( i ), cc( i, j )
2603 WRITE( nout, fmt = 9998 )i, cc( i, j ), ct( i )
2607 $
WRITE( nout, fmt = 9997 )j
2612 9999
FORMAT(
' ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HAL',
2613 $
'F ACCURATE *******', /
' EXPECTED RE',
2614 $
'SULT COMPUTED RESULT' )
2615 9998
FORMAT( 1x, i7, 2(
' (', g15.6,
',', g15.6,
')' ) )
2616 9997
FORMAT(
' THESE ARE THE RESULTS FOR COLUMN ', i3 )
2621 LOGICAL FUNCTION lce( RI, RJ, LR )
2636 COMPLEX RI( * ), RJ( * )
2641 IF( ri( i ).NE.rj( i ) )
2653 LOGICAL FUNCTION lceres( TYPE, UPLO, M, N, AA, AS, LDA )
2672 COMPLEX AA( lda, * ), AS( lda, * )
2674 INTEGER I, IBEG, IEND, J
2678 IF( type.EQ.
'ge' )
THEN
2680 DO 10 i = m + 1, lda
2681 IF( aa( i, j ).NE.as( i, j ) )
2685 ELSE IF( type.EQ.
'he'.OR.type.EQ.
'sy' )
THEN
2694 DO 30 i = 1, ibeg - 1
2695 IF( aa( i, j ).NE.as( i, j ) )
2698 DO 40 i = iend + 1, lda
2699 IF( aa( i, j ).NE.as( i, j ) )
2715 COMPLEX FUNCTION cbeg( RESET )
2731 INTEGER I, IC, J, MI, MJ
2733 SAVE i, ic, j, mi, mj
2757 i = i - 1000*( i/1000 )
2758 j = j - 1000*( j/1000 )
2763 cbeg = cmplx( ( i - 500 )/1001.0, ( j - 500 )/1001.0 )
2769 REAL FUNCTION sdiff( X, Y )
subroutine cprcn2(NOUT, NC, SNAME, IORDER, SIDE, UPLO, M, N, ALPHA, LDA, LDB, BETA, LDC)
subroutine cprcn4(NOUT, NC, SNAME, IORDER, UPLO, TRANSA, N, K, ALPHA, LDA, BETA, LDC)
subroutine cprcn5(NOUT, NC, SNAME, IORDER, UPLO, TRANSA, N, K, ALPHA, LDA, LDB, BETA, LDC)
subroutine cmmch(TRANSA, TRANSB, M, N, KK, ALPHA, A, LDA, B, LDB, BETA, C, LDC, CT, G, CC, LDCC, EPS, ERR, FATAL, NOUT, MV)
subroutine cchk5(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 cprcn1(NOUT, NC, SNAME, IORDER, TRANSA, TRANSB, M, N, K, ALPHA, LDA, LDB, BETA, LDC)
subroutine cprcn7(NOUT, NC, SNAME, IORDER, UPLO, TRANSA, N, K, ALPHA, LDA, LDB, BETA, LDC)
subroutine cchk3(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 cprcn6(NOUT, NC, SNAME, IORDER, UPLO, TRANSA, N, K, ALPHA, LDA, BETA, LDC)
subroutine cchk2(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)
logical function lce(RI, RJ, LR)
real function sdiff(SA, SB)
subroutine cmake(TYPE, UPLO, DIAG, M, N, A, NMAX, AA, LDA, KL, KU, RESET, TRANSL)
subroutine cprcn3(NOUT, NC, SNAME, IORDER, SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, LDA, LDB)
logical function lceres(TYPE, UPLO, M, N, AA, AS, LDA)
complex function cbeg(RESET)
subroutine cchk4(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 cchk1(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)