1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      65
      66
      67
      68
      69
      70
      71
      72
      73
      74
      75
      76
      77
      78
      79
      80
      81
      82
      83
      84
      85
      86
      87
      88
      89
      90
      91
      92
      93
      94
      95
      96
      97
      98
      99
     100
     101
     102
      SUBROUTINE SGET10MNALDABLDBWORKRESULT )
*
*  -- LAPACK test routine (version 3.1) --
*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
*     November 2006
*
*     .. Scalar Arguments ..
      INTEGER            LDALDBMN
      REAL               RESULT
*     ..
*     .. Array Arguments ..
      REAL               ALDA* ), BLDB* ), WORK* )
*     ..
*
*  Purpose
*  =======
*
*  SGET10 compares two matrices A and B and computes the ratio
*  RESULT = norm( A - B ) / ( norm(A) * M * EPS )
*
*  Arguments
*  =========
*
*  M       (input) INTEGER
*          The number of rows of the matrices A and B.
*
*  N       (input) INTEGER
*          The number of columns of the matrices A and B.
*
*  A       (input) REAL array, dimension (LDA,N)
*          The m by n matrix A.
*
*  LDA     (input) INTEGER
*          The leading dimension of the array A.  LDA >= max(1,M).
*
*  B       (input) REAL array, dimension (LDB,N)
*          The m by n matrix B.
*
*  LDB     (input) INTEGER
*          The leading dimension of the array B.  LDB >= max(1,M).
*
*  WORK    (workspace) REAL array, dimension (M)
*
*  RESULT  (output) REAL
*          RESULT = norm( A - B ) / ( norm(A) * M * EPS )
*
*  =====================================================================
*
*     .. Parameters ..
      REAL               ONEZERO
      PARAMETER          ( ONE = 1.0E+0ZERO = 0.0E+0 )
*     ..
*     .. Local Scalars ..
      INTEGER            J
      REAL               ANORMEPSUNFLWNORM
*     ..
*     .. External Functions ..
      REAL               SASUMSLAMCHSLANGE
      EXTERNAL           SASUMSLAMCHSLANGE
*     ..
*     .. External Subroutines ..
      EXTERNAL           SAXPYSCOPY
*     ..
*     .. Intrinsic Functions ..
      INTRINSIC          MAXMINREAL
*     ..
*     .. Executable Statements ..
*
*     Quick return if possible
*
      IFM.LE.0 .OR. N.LE.0 ) THEN
         RESULT = ZERO
         RETURN
      END IF
*
      UNFL = SLAMCH'Safe minimum' )
      EPS = SLAMCH'Precision' )
*
      WNORM = ZERO
      DO 10 J = 1N
         CALL SCOPYMA1J ), 1WORK1 )
         CALL SAXPYM-ONEB1J ), 1WORK1 )
         WNORM = MAXWNORMSASUMNWORK1 ) )
   10 CONTINUE
*
      ANORM = MAXSLANGE'1'MNALDAWORK ), UNFL )
*
      IFANORM.GT.WNORM ) THEN
         RESULT = ( WNORM / ANORM ) / ( M*EPS )
      ELSE
         IFANORM.LT.ONE ) THEN
            RESULT = ( MINWNORMM*ANORM ) / ANORM ) / ( M*EPS )
         ELSE
            RESULT = MINWNORM / ANORMREALM ) ) / ( M*EPS )
         END IF
      END IF
*
      RETURN
*
*     End of SGET10
*
      END