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

◆ cget10()

subroutine cget10 ( integer  m,
integer  n,
complex, dimension( lda, * )  a,
integer  lda,
complex, dimension( ldb, * )  b,
integer  ldb,
complex, dimension( * )  work,
real, dimension( * )  rwork,
real  result 
)

CGET10

Purpose:
 CGET10 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 COMPLEX 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 COMPLEX 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 COMPLEX array, dimension (M)
[out]RWORK
          RWORK is COMPLEX 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 98 of file cget10.f.

99*
100* -- LAPACK test routine --
101* -- LAPACK is a software package provided by Univ. of Tennessee, --
102* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
103*
104* .. Scalar Arguments ..
105 INTEGER LDA, LDB, M, N
106 REAL RESULT
107* ..
108* .. Array Arguments ..
109 REAL RWORK( * )
110 COMPLEX A( LDA, * ), B( LDB, * ), WORK( * )
111* ..
112*
113* =====================================================================
114*
115* .. Parameters ..
116 REAL ONE, ZERO
117 parameter( one = 1.0e+0, zero = 0.0e+0 )
118* ..
119* .. Local Scalars ..
120 INTEGER J
121 REAL ANORM, EPS, UNFL, WNORM
122* ..
123* .. External Functions ..
124 REAL SCASUM, SLAMCH, CLANGE
125 EXTERNAL scasum, slamch, clange
126* ..
127* .. External Subroutines ..
128 EXTERNAL caxpy, ccopy
129* ..
130* .. Intrinsic Functions ..
131 INTRINSIC max, min, real
132* ..
133* .. Executable Statements ..
134*
135* Quick return if possible
136*
137 IF( m.LE.0 .OR. n.LE.0 ) THEN
138 result = zero
139 RETURN
140 END IF
141*
142 unfl = slamch( 'Safe minimum' )
143 eps = slamch( 'Precision' )
144*
145 wnorm = zero
146 DO 10 j = 1, n
147 CALL ccopy( m, a( 1, j ), 1, work, 1 )
148 CALL caxpy( m, cmplx( -one ), b( 1, j ), 1, work, 1 )
149 wnorm = max( wnorm, scasum( n, work, 1 ) )
150 10 CONTINUE
151*
152 anorm = max( clange( '1', m, n, a, lda, rwork ), unfl )
153*
154 IF( anorm.GT.wnorm ) THEN
155 result = ( wnorm / anorm ) / ( m*eps )
156 ELSE
157 IF( anorm.LT.one ) THEN
158 result = ( min( wnorm, m*anorm ) / anorm ) / ( m*eps )
159 ELSE
160 result = min( wnorm / anorm, real( m ) ) / ( m*eps )
161 END IF
162 END IF
163*
164 RETURN
165*
166* End of CGET10
167*
real function scasum(n, cx, incx)
SCASUM
Definition scasum.f:72
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
Definition caxpy.f:88
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
Definition ccopy.f:81
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
real function clange(norm, m, n, a, lda, work)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition clange.f:115
Here is the call graph for this function:
Here is the caller graph for this function: