 LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 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 )```
Date
November 2011

Definition at line 111 of file sget03.f.

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

Here is the call graph for this function:

Here is the caller graph for this function: