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

◆ sget03()

subroutine sget03 ( integer  n,
real, dimension( lda, * )  a,
integer  lda,
real, dimension( ldainv, * )  ainv,
integer  ldainv,
real, dimension( ldwork, * )  work,
integer  ldwork,
real, dimension( * )  rwork,
real  rcond,
real  resid 
)

SGET03

Purpose:
 SGET03 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 REAL 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 REAL 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 REAL 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 107 of file sget03.f.

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