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

◆ dmmtch()

subroutine dmmtch ( character*1 uplo,
character*1 transa,
character*1 transb,
integer n,
integer kk,
double precision alpha,
double precision, dimension( lda, * ) a,
integer lda,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision beta,
double precision, dimension( ldc, * ) c,
integer ldc,
double precision, dimension( * ) ct,
double precision, dimension( * ) g,
double precision, dimension( ldcc, * ) cc,
integer ldcc,
double precision eps,
double precision err,
logical fatal,
integer nout,
logical mv )

Definition at line 3242 of file dblat3.f.

3245*
3246* Checks the results of the computational tests.
3247*
3248* Auxiliary routine for test program for Level 3 Blas. (DGEMMTR)
3249*
3250* -- Written on 19-July-2023.
3251* Martin Koehler, MPI Magdeburg
3252*
3253* .. Parameters ..
3254 DOUBLE PRECISION ZERO, ONE
3255 parameter( zero = 0.0d0, one = 1.0d0 )
3256* .. Scalar Arguments ..
3257 DOUBLE PRECISION ALPHA, BETA, EPS, ERR
3258 INTEGER KK, LDA, LDB, LDC, LDCC, N, NOUT
3259 LOGICAL FATAL, MV
3260 CHARACTER*1 UPLO, TRANSA, TRANSB
3261* .. Array Arguments ..
3262 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * ),
3263 $ CC( LDCC, * ), CT( * ), G( * )
3264* .. Local Scalars ..
3265 DOUBLE PRECISION ERRI
3266 INTEGER I, J, K, ISTART, ISTOP
3267 LOGICAL TRANA, TRANB, UPPER
3268* .. Intrinsic Functions ..
3269 INTRINSIC abs, max, sqrt
3270* .. Executable Statements ..
3271 upper = uplo.EQ.'U'
3272 trana = transa.EQ.'T'.OR.transa.EQ.'C'
3273 tranb = transb.EQ.'T'.OR.transb.EQ.'C'
3274*
3275* Compute expected result, one column at a time, in CT using data
3276* in A, B and C.
3277* Compute gauges in G.
3278*
3279 istart = 1
3280 istop = n
3281
3282 DO 120 j = 1, n
3283*
3284 IF ( upper ) THEN
3285 istart = 1
3286 istop = j
3287 ELSE
3288 istart = j
3289 istop = n
3290 END IF
3291 DO 10 i = istart, istop
3292 ct( i ) = zero
3293 g( i ) = zero
3294 10 CONTINUE
3295 IF( .NOT.trana.AND..NOT.tranb )THEN
3296 DO 30 k = 1, kk
3297 DO 20 i = istart, istop
3298 ct( i ) = ct( i ) + a( i, k )*b( k, j )
3299 g( i ) = g( i ) + abs( a( i, k ) )*abs( b( k, j ) )
3300 20 CONTINUE
3301 30 CONTINUE
3302 ELSE IF( trana.AND..NOT.tranb )THEN
3303 DO 50 k = 1, kk
3304 DO 40 i = istart, istop
3305 ct( i ) = ct( i ) + a( k, i )*b( k, j )
3306 g( i ) = g( i ) + abs( a( k, i ) )*abs( b( k, j ) )
3307 40 CONTINUE
3308 50 CONTINUE
3309 ELSE IF( .NOT.trana.AND.tranb )THEN
3310 DO 70 k = 1, kk
3311 DO 60 i = istart, istop
3312 ct( i ) = ct( i ) + a( i, k )*b( j, k )
3313 g( i ) = g( i ) + abs( a( i, k ) )*abs( b( j, k ) )
3314 60 CONTINUE
3315 70 CONTINUE
3316 ELSE IF( trana.AND.tranb )THEN
3317 DO 90 k = 1, kk
3318 DO 80 i = istart, istop
3319 ct( i ) = ct( i ) + a( k, i )*b( j, k )
3320 g( i ) = g( i ) + abs( a( k, i ) )*abs( b( j, k ) )
3321 80 CONTINUE
3322 90 CONTINUE
3323 END IF
3324 DO 100 i = istart, istop
3325 ct( i ) = alpha*ct( i ) + beta*c( i, j )
3326 g( i ) = abs( alpha )*g( i ) + abs( beta )*abs( c( i, j ) )
3327 100 CONTINUE
3328*
3329* Compute the error ratio for this result.
3330*
3331 err = zero
3332 DO 110 i = istart, istop
3333 erri = abs( ct( i ) - cc( i, j ) )/eps
3334 IF( g( i ).NE.zero )
3335 $ erri = erri/g( i )
3336 err = max( err, erri )
3337 IF( err*sqrt( eps ).GE.one )
3338 $ GO TO 130
3339 110 CONTINUE
3340*
3341 120 CONTINUE
3342*
3343* If the loop completes, all results are at least half accurate.
3344 GO TO 150
3345*
3346* Report fatal error.
3347*
3348 130 fatal = .true.
3349 WRITE( nout, fmt = 9999 )
3350 DO 140 i = istart, istop
3351 IF( mv )THEN
3352 WRITE( nout, fmt = 9998 )i, ct( i ), cc( i, j )
3353 ELSE
3354 WRITE( nout, fmt = 9998 )i, cc( i, j ), ct( i )
3355 END IF
3356 140 CONTINUE
3357 IF( n.GT.1 )
3358 $ WRITE( nout, fmt = 9997 )j
3359*
3360 150 CONTINUE
3361 RETURN
3362*
3363 9999 FORMAT( ' ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HAL',
3364 $ 'F ACCURATE *******', /' EXPECTED RESULT COMPU',
3365 $ 'TED RESULT' )
3366 9998 FORMAT( 1x, i7, 2g18.6 )
3367 9997 FORMAT( ' THESE ARE THE RESULTS FOR COLUMN ', i3 )
3368*
3369* End of DMMTCH
3370*
Here is the caller graph for this function: