2960
2961
2962
2963
2964
2965
2966
2967
2968
2969 DOUBLE PRECISION ZERO
2970 parameter( zero = 0.0d0 )
2971
2972 DOUBLE PRECISION EPS, THRESH
2973 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA
2974 LOGICAL FATAL, REWI, TRACE
2975 CHARACTER*7 SNAME
2976
2977 DOUBLE PRECISION A( NMAX, NMAX ), AA( NMAX*NMAX ), ALF( NALF ),
2978 $ AS( NMAX*NMAX ), B( NMAX, NMAX ),
2979 $ BB( NMAX*NMAX ), BET( NBET ), BS( NMAX*NMAX ),
2980 $ C( NMAX, NMAX ), CC( NMAX*NMAX ),
2981 $ CS( NMAX*NMAX ), CT( NMAX ), G( NMAX )
2982 INTEGER IDIM( NIDIM )
2983
2984 DOUBLE PRECISION ALPHA, ALS, BETA, BLS, ERR, ERRMAX
2985 INTEGER I, IA, IB, ICA, ICB, IK, IN, K, KS, LAA,
2986 $ LBB, LCC, LDA, LDAS, LDB, LDBS, LDC, LDCS,
2987 $ MA, MB, N, NA, NARGS, NB, NC, NS, IS
2988 LOGICAL NULL, RESET, SAME, TRANA, TRANB
2989 CHARACTER*1 TRANAS, TRANBS, TRANSA, TRANSB, UPLO, UPLOS
2990 CHARACTER*3 ICH
2991 CHARACTER*2 ISHAPE
2992
2993 LOGICAL ISAME( 13 )
2994
2995 LOGICAL LDE, LDERES
2997
2999
3000 INTRINSIC max
3001
3002 INTEGER INFOT, NOUTC
3003 LOGICAL LERR, OK
3004
3005 COMMON /infoc/infot, noutc, ok, lerr
3006
3007 DATA ich/'NTC'/
3008 DATA ishape/'UL'/
3009
3010
3011 nargs = 13
3012 nc = 0
3013 reset = .true.
3014 errmax = zero
3015
3016 DO 100 in = 1, nidim
3017 n = idim( in )
3018
3019 ldc = n
3020 IF( ldc.LT.nmax )
3021 $ ldc = ldc + 1
3022
3023 IF( ldc.GT.nmax )
3024 $ GO TO 100
3025 lcc = ldc*n
3026 null = n.LE.0
3027
3028 DO 90 ik = 1, nidim
3029 k = idim( ik )
3030
3031 DO 80 ica = 1, 3
3032 transa = ich( ica: ica )
3033 trana = transa.EQ.'T'.OR.transa.EQ.'C'
3034
3035 IF( trana )THEN
3036 ma = k
3037 na = n
3038 ELSE
3039 ma = n
3040 na = k
3041 END IF
3042
3043 lda = ma
3044 IF( lda.LT.nmax )
3045 $ lda = lda + 1
3046
3047 IF( lda.GT.nmax )
3048 $ GO TO 80
3049 laa = lda*na
3050
3051
3052
3053 CALL dmake(
'GE',
' ',
' ', ma, na, a, nmax, aa, lda,
3054 $ reset, zero )
3055
3056 DO 70 icb = 1, 3
3057 transb = ich( icb: icb )
3058 tranb = transb.EQ.'T'.OR.transb.EQ.'C'
3059
3060 IF( tranb )THEN
3061 mb = n
3062 nb = k
3063 ELSE
3064 mb = k
3065 nb = n
3066 END IF
3067
3068 ldb = mb
3069 IF( ldb.LT.nmax )
3070 $ ldb = ldb + 1
3071
3072 IF( ldb.GT.nmax )
3073 $ GO TO 70
3074 lbb = ldb*nb
3075
3076
3077
3078 CALL dmake(
'GE',
' ',
' ', mb, nb, b, nmax, bb,
3079 $ ldb, reset, zero )
3080
3081 DO 60 ia = 1, nalf
3082 alpha = alf( ia )
3083
3084 DO 50 ib = 1, nbet
3085 beta = bet( ib )
3086
3087 DO 45 is = 1, 2
3088 uplo = ishape( is: is )
3089
3090
3091
3092
3093 CALL dmake(
'GE', uplo,
' ', n, n, c,
3094 $ nmax, cc, ldc, reset, zero )
3095
3096 nc = nc + 1
3097
3098
3099
3100
3101 uplos = uplo
3102 tranas = transa
3103 tranbs = transb
3104 ns = n
3105 ks = k
3106 als = alpha
3107 DO 10 i = 1, laa
3108 as( i ) = aa( i )
3109 10 CONTINUE
3110 ldas = lda
3111 DO 20 i = 1, lbb
3112 bs( i ) = bb( i )
3113 20 CONTINUE
3114 ldbs = ldb
3115 bls = beta
3116 DO 30 i = 1, lcc
3117 cs( i ) = cc( i )
3118 30 CONTINUE
3119 ldcs = ldc
3120
3121
3122
3123 IF( trace )
3124 $ WRITE( ntra, fmt = 9995 )nc, sname,
3125 $ uplo, transa, transb, n, k, alpha, lda,
3126 $ ldb, beta, ldc
3127 IF( rewi )
3128 $ rewind ntra
3129 CALL dgemmtr( uplo, transa, transb, n,
3130 $ k, alpha, aa, lda, bb, ldb,
3131 $ beta, cc, ldc )
3132
3133
3134
3135 IF( .NOT.ok )THEN
3136 WRITE( nout, fmt = 9994 )
3137 fatal = .true.
3138 GO TO 120
3139 END IF
3140
3141
3142
3143 isame( 1 ) = uplo.EQ.uplos
3144 isame( 2 ) = transa.EQ.tranas
3145 isame( 3 ) = transb.EQ.tranbs
3146 isame( 4 ) = ns.EQ.n
3147 isame( 5 ) = ks.EQ.k
3148 isame( 6 ) = als.EQ.alpha
3149 isame( 7 ) =
lde( as, aa, laa )
3150 isame( 8 ) = ldas.EQ.lda
3151 isame( 9 ) =
lde( bs, bb, lbb )
3152 isame( 10 ) = ldbs.EQ.ldb
3153 isame( 11 ) = bls.EQ.beta
3154 IF( null )THEN
3155 isame( 12 ) =
lde( cs, cc, lcc )
3156 ELSE
3157 isame( 12 ) =
lderes(
'GE',
' ', n, n,
3158 $ cs, cc, ldc )
3159 END IF
3160 isame( 13 ) = ldcs.EQ.ldc
3161
3162
3163
3164
3165 same = .true.
3166 DO 40 i = 1, nargs
3167 same = same.AND.isame( i )
3168 IF( .NOT.isame( i ) )
3169 $ WRITE( nout, fmt = 9998 )i
3170 40 CONTINUE
3171 IF( .NOT.same )THEN
3172 fatal = .true.
3173 GO TO 120
3174 END IF
3175
3176 IF( .NOT.null )THEN
3177
3178
3179
3180 CALL dmmtch( uplo, transa, transb,
3181 $ n, k,
3182 $ alpha, a, nmax, b, nmax, beta,
3183 $ c, nmax, ct, g, cc, ldc, eps,
3184 $ err, fatal, nout, .true. )
3185 errmax = max( errmax, err )
3186
3187
3188 IF( fatal )
3189 $ GO TO 120
3190 END IF
3191
3192 45 CONTINUE
3193
3194 50 CONTINUE
3195
3196 60 CONTINUE
3197
3198 70 CONTINUE
3199
3200 80 CONTINUE
3201
3202 90 CONTINUE
3203
3204 100 CONTINUE
3205
3206
3207
3208
3209 IF( errmax.LT.thresh )THEN
3210 WRITE( nout, fmt = 9999 )sname, nc
3211 ELSE
3212 WRITE( nout, fmt = 9997 )sname, nc, errmax
3213 END IF
3214 GO TO 130
3215
3216 120 CONTINUE
3217 WRITE( nout, fmt = 9996 )sname
3218 WRITE( nout, fmt = 9995 )nc, sname, uplo, transa, transb, n, k,
3219 $ alpha, lda, ldb, beta, ldc
3220
3221 130 CONTINUE
3222 RETURN
3223
3224 9999 FORMAT( ' ', a6, ' PASSED THE COMPUTATIONAL TESTS (', i6, ' CALL',
3225 $ 'S)' )
3226 9998 FORMAT( ' ******* FATAL ERROR - PARAMETER NUMBER ', i2, ' WAS CH',
3227 $ 'ANGED INCORRECTLY *******' )
3228 9997 FORMAT( ' ', a6, ' COMPLETED THE COMPUTATIONAL TESTS (', i6, ' C',
3229 $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', f8.2,
3230 $ ' - SUSPECT *******' )
3231 9996 FORMAT( ' ******* ', a6, ' FAILED ON CALL NUMBER:' )
3232 9995 FORMAT( 1x, i6, ': ', a6, '(''',a1, ''',''',a1, ''',''', a1,''',',
3233 $ 2( i3, ',' ), f4.1, ', A,', i3, ', B,', i3, ',', f4.1, ', ',
3234 $ 'C,', i3, ').' )
3235 9994 FORMAT( ' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
3236 $ '******' )
3237
3238
3239
logical function lde(ri, rj, lr)
logical function lderes(type, uplo, m, n, aa, as, lda)
subroutine dmake(type, uplo, diag, m, n, a, nmax, aa, lda, kl, ku, reset, transl)
subroutine dmmtch(uplo, transa, transb, n, kk, alpha, a, lda, b, ldb, beta, c, ldc, ct, g, cc, ldcc, eps, err, fatal, nout, mv)
subroutine dgemmtr(uplo, transa, transb, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMMTR