LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ sget10()

subroutine sget10 ( integer  M,
integer  N,
real, dimension( lda, * )  A,
integer  LDA,
real, dimension( ldb, * )  B,
integer  LDB,
real, dimension( * )  WORK,
real  RESULT 
)

SGET10

Purpose:
 SGET10 compares two matrices A and B and computes the ratio
 RESULT = norm( A - B ) / ( norm(A) * M * EPS )
Parameters
[in]M
          M is INTEGER
          The number of rows of the matrices A and B.
[in]N
          N is INTEGER
          The number of columns of the matrices A and B.
[in]A
          A is REAL array, dimension (LDA,N)
          The m by n matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,M).
[in]B
          B is REAL array, dimension (LDB,N)
          The m by n matrix B.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,M).
[out]WORK
          WORK is REAL array, dimension (M)
[out]RESULT
          RESULT is REAL
          RESULT = norm( A - B ) / ( norm(A) * M * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 92 of file sget10.f.

93 *
94 * -- LAPACK test routine --
95 * -- LAPACK is a software package provided by Univ. of Tennessee, --
96 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
97 *
98 * .. Scalar Arguments ..
99  INTEGER LDA, LDB, M, N
100  REAL RESULT
101 * ..
102 * .. Array Arguments ..
103  REAL A( LDA, * ), B( LDB, * ), WORK( * )
104 * ..
105 *
106 * =====================================================================
107 *
108 * .. Parameters ..
109  REAL ONE, ZERO
110  parameter( one = 1.0e+0, zero = 0.0e+0 )
111 * ..
112 * .. Local Scalars ..
113  INTEGER J
114  REAL ANORM, EPS, UNFL, WNORM
115 * ..
116 * .. External Functions ..
117  REAL SASUM, SLAMCH, SLANGE
118  EXTERNAL sasum, slamch, slange
119 * ..
120 * .. External Subroutines ..
121  EXTERNAL saxpy, scopy
122 * ..
123 * .. Intrinsic Functions ..
124  INTRINSIC max, min, real
125 * ..
126 * .. Executable Statements ..
127 *
128 * Quick return if possible
129 *
130  IF( m.LE.0 .OR. n.LE.0 ) THEN
131  result = zero
132  RETURN
133  END IF
134 *
135  unfl = slamch( 'Safe minimum' )
136  eps = slamch( 'Precision' )
137 *
138  wnorm = zero
139  DO 10 j = 1, n
140  CALL scopy( m, a( 1, j ), 1, work, 1 )
141  CALL saxpy( m, -one, b( 1, j ), 1, work, 1 )
142  wnorm = max( wnorm, sasum( n, work, 1 ) )
143  10 CONTINUE
144 *
145  anorm = max( slange( '1', m, n, a, lda, work ), unfl )
146 *
147  IF( anorm.GT.wnorm ) THEN
148  result = ( wnorm / anorm ) / ( m*eps )
149  ELSE
150  IF( anorm.LT.one ) THEN
151  result = ( min( wnorm, m*anorm ) / anorm ) / ( m*eps )
152  ELSE
153  result = min( wnorm / anorm, real( m ) ) / ( m*eps )
154  END IF
155  END IF
156 *
157  RETURN
158 *
159 * End of SGET10
160 *
real function slange(NORM, M, N, A, LDA, WORK)
SLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: slange.f:114
subroutine scopy(N, SX, INCX, SY, INCY)
SCOPY
Definition: scopy.f:82
subroutine saxpy(N, SA, SX, INCX, SY, INCY)
SAXPY
Definition: saxpy.f:89
real function sasum(N, SX, INCX)
SASUM
Definition: sasum.f:72
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:68
Here is the call graph for this function:
Here is the caller graph for this function: