LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine cget03 ( integer  N,
complex, dimension( lda, * )  A,
integer  LDA,
complex, dimension( ldainv, * )  AINV,
integer  LDAINV,
complex, dimension( ldwork, * )  WORK,
integer  LDWORK,
real, dimension( * )  RWORK,
real  RCOND,
real  RESID 
)

CGET03

Purpose:
 CGET03 computes the residual for a general matrix times its inverse:
    norm( I - AINV*A ) / ( N * norm(A) * norm(AINV) * EPS ),
 where EPS is the machine epsilon.
Parameters
[in]N
          N is INTEGER
          The number of rows and columns of the matrix A.  N >= 0.
[in]A
          A is COMPLEX array, dimension (LDA,N)
          The original N x N matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[in]AINV
          AINV is COMPLEX array, dimension (LDAINV,N)
          The inverse of the matrix A.
[in]LDAINV
          LDAINV is INTEGER
          The leading dimension of the array AINV.  LDAINV >= max(1,N).
[out]WORK
          WORK is COMPLEX array, dimension (LDWORK,N)
[in]LDWORK
          LDWORK is INTEGER
          The leading dimension of the array WORK.  LDWORK >= max(1,N).
[out]RWORK
          RWORK is REAL array, dimension (N)
[out]RCOND
          RCOND is REAL
          The reciprocal of the condition number of A, computed as
          ( 1/norm(A) ) / norm(AINV).
[out]RESID
          RESID is REAL
          norm(I - AINV*A) / ( N * norm(A) * norm(AINV) * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 112 of file cget03.f.

112 *
113 * -- LAPACK test routine (version 3.4.0) --
114 * -- LAPACK is a software package provided by Univ. of Tennessee, --
115 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
116 * November 2011
117 *
118 * .. Scalar Arguments ..
119  INTEGER lda, ldainv, ldwork, n
120  REAL rcond, resid
121 * ..
122 * .. Array Arguments ..
123  REAL rwork( * )
124  COMPLEX a( lda, * ), ainv( ldainv, * ),
125  $ work( ldwork, * )
126 * ..
127 *
128 * =====================================================================
129 *
130 * .. Parameters ..
131  REAL zero, one
132  parameter ( zero = 0.0e+0, one = 1.0e+0 )
133  COMPLEX czero, cone
134  parameter ( czero = ( 0.0e+0, 0.0e+0 ),
135  $ cone = ( 1.0e+0, 0.0e+0 ) )
136 * ..
137 * .. Local Scalars ..
138  INTEGER i
139  REAL ainvnm, anorm, eps
140 * ..
141 * .. External Functions ..
142  REAL clange, slamch
143  EXTERNAL clange, slamch
144 * ..
145 * .. External Subroutines ..
146  EXTERNAL cgemm
147 * ..
148 * .. Intrinsic Functions ..
149  INTRINSIC real
150 * ..
151 * .. Executable Statements ..
152 *
153 * Quick exit if N = 0.
154 *
155  IF( n.LE.0 ) THEN
156  rcond = one
157  resid = zero
158  RETURN
159  END IF
160 *
161 * Exit with RESID = 1/EPS if ANORM = 0 or AINVNM = 0.
162 *
163  eps = slamch( 'Epsilon' )
164  anorm = clange( '1', n, n, a, lda, rwork )
165  ainvnm = clange( '1', n, n, ainv, ldainv, rwork )
166  IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
167  rcond = zero
168  resid = one / eps
169  RETURN
170  END IF
171  rcond = ( one/anorm ) / ainvnm
172 *
173 * Compute I - A * AINV
174 *
175  CALL cgemm( 'No transpose', 'No transpose', n, n, n, -cone,
176  $ ainv, ldainv, a, lda, czero, work, ldwork )
177  DO 10 i = 1, n
178  work( i, i ) = cone + work( i, i )
179  10 CONTINUE
180 *
181 * Compute norm(I - AINV*A) / (N * norm(A) * norm(AINV) * EPS)
182 *
183  resid = clange( '1', n, n, work, ldwork, rwork )
184 *
185  resid = ( ( resid*rcond )/eps ) / REAL( n )
186 *
187  RETURN
188 *
189 * End of CGET03
190 *
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:117
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine cgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CGEMM
Definition: cgemm.f:189

Here is the call graph for this function:

Here is the caller graph for this function: