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

◆ cget03()

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.

Definition at line 108 of file cget03.f.

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