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

◆ smmch()

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

Definition at line 2591 of file sblat3.f.

2594*
2595* Checks the results of the computational tests.
2596*
2597* Auxiliary routine for test program for Level 3 Blas.
2598*
2599* -- Written on 8-February-1989.
2600* Jack Dongarra, Argonne National Laboratory.
2601* Iain Duff, AERE Harwell.
2602* Jeremy Du Croz, Numerical Algorithms Group Ltd.
2603* Sven Hammarling, Numerical Algorithms Group Ltd.
2604*
2605* .. Parameters ..
2606 REAL ZERO, ONE
2607 parameter( zero = 0.0, one = 1.0 )
2608* .. Scalar Arguments ..
2609 REAL ALPHA, BETA, EPS, ERR
2610 INTEGER KK, LDA, LDB, LDC, LDCC, M, N, NOUT
2611 LOGICAL FATAL, MV
2612 CHARACTER*1 TRANSA, TRANSB
2613* .. Array Arguments ..
2614 REAL A( LDA, * ), B( LDB, * ), C( LDC, * ),
2615 $ CC( LDCC, * ), CT( * ), G( * )
2616* .. Local Scalars ..
2617 REAL ERRI
2618 INTEGER I, J, K
2619 LOGICAL TRANA, TRANB
2620* .. Intrinsic Functions ..
2621 INTRINSIC abs, max, sqrt
2622* .. Executable Statements ..
2623 trana = transa.EQ.'T'.OR.transa.EQ.'C'
2624 tranb = transb.EQ.'T'.OR.transb.EQ.'C'
2625*
2626* Compute expected result, one column at a time, in CT using data
2627* in A, B and C.
2628* Compute gauges in G.
2629*
2630 DO 120 j = 1, n
2631*
2632 DO 10 i = 1, m
2633 ct( i ) = zero
2634 g( i ) = zero
2635 10 CONTINUE
2636 IF( .NOT.trana.AND..NOT.tranb )THEN
2637 DO 30 k = 1, kk
2638 DO 20 i = 1, m
2639 ct( i ) = ct( i ) + a( i, k )*b( k, j )
2640 g( i ) = g( i ) + abs( a( i, k ) )*abs( b( k, j ) )
2641 20 CONTINUE
2642 30 CONTINUE
2643 ELSE IF( trana.AND..NOT.tranb )THEN
2644 DO 50 k = 1, kk
2645 DO 40 i = 1, m
2646 ct( i ) = ct( i ) + a( k, i )*b( k, j )
2647 g( i ) = g( i ) + abs( a( k, i ) )*abs( b( k, j ) )
2648 40 CONTINUE
2649 50 CONTINUE
2650 ELSE IF( .NOT.trana.AND.tranb )THEN
2651 DO 70 k = 1, kk
2652 DO 60 i = 1, m
2653 ct( i ) = ct( i ) + a( i, k )*b( j, k )
2654 g( i ) = g( i ) + abs( a( i, k ) )*abs( b( j, k ) )
2655 60 CONTINUE
2656 70 CONTINUE
2657 ELSE IF( trana.AND.tranb )THEN
2658 DO 90 k = 1, kk
2659 DO 80 i = 1, m
2660 ct( i ) = ct( i ) + a( k, i )*b( j, k )
2661 g( i ) = g( i ) + abs( a( k, i ) )*abs( b( j, k ) )
2662 80 CONTINUE
2663 90 CONTINUE
2664 END IF
2665 DO 100 i = 1, m
2666 ct( i ) = alpha*ct( i ) + beta*c( i, j )
2667 g( i ) = abs( alpha )*g( i ) + abs( beta )*abs( c( i, j ) )
2668 100 CONTINUE
2669*
2670* Compute the error ratio for this result.
2671*
2672 err = zero
2673 DO 110 i = 1, m
2674 erri = abs( ct( i ) - cc( i, j ) )/eps
2675 IF( g( i ).NE.zero )
2676 $ erri = erri/g( i )
2677 err = max( err, erri )
2678 IF( err*sqrt( eps ).GE.one )
2679 $ GO TO 130
2680 110 CONTINUE
2681*
2682 120 CONTINUE
2683*
2684* If the loop completes, all results are at least half accurate.
2685 GO TO 150
2686*
2687* Report fatal error.
2688*
2689 130 fatal = .true.
2690 WRITE( nout, fmt = 9999 )
2691 DO 140 i = 1, m
2692 IF( mv )THEN
2693 WRITE( nout, fmt = 9998 )i, ct( i ), cc( i, j )
2694 ELSE
2695 WRITE( nout, fmt = 9998 )i, cc( i, j ), ct( i )
2696 END IF
2697 140 CONTINUE
2698 IF( n.GT.1 )
2699 $ WRITE( nout, fmt = 9997 )j
2700*
2701 150 CONTINUE
2702 RETURN
2703*
2704 9999 FORMAT( ' ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HAL',
2705 $ 'F ACCURATE *******', /' EXPECTED RESULT COMPU',
2706 $ 'TED RESULT' )
2707 9998 FORMAT( 1x, i7, 2g18.6 )
2708 9997 FORMAT( ' THESE ARE THE RESULTS FOR COLUMN ', i3 )
2709*
2710* End of SMMCH
2711*
Here is the caller graph for this function: