 LAPACK  3.10.0 LAPACK: Linear Algebra PACKage

◆ 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 )

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 *
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
Definition: ccopy.f:81
subroutine caxpy(N, CA, CX, INCX, CY, INCY)
CAXPY
Definition: caxpy.f:88
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
real function scasum(N, CX, INCX)
SCASUM
Definition: scasum.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: