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

◆ dget03()

subroutine dget03 ( integer  n,
double precision, dimension( lda, * )  a,
integer  lda,
double precision, dimension( ldainv, * )  ainv,
integer  ldainv,
double precision, dimension( ldwork, * )  work,
integer  ldwork,
double precision, dimension( * )  rwork,
double precision  rcond,
double precision  resid 
)

DGET03

Purpose:
 DGET03 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension (LDWORK,N)
[in]LDWORK
          LDWORK is INTEGER
          The leading dimension of the array WORK.  LDWORK >= max(1,N).
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (N)
[out]RCOND
          RCOND is DOUBLE PRECISION
          The reciprocal of the condition number of A, computed as
          ( 1/norm(A) ) / norm(AINV).
[out]RESID
          RESID is DOUBLE PRECISION
          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 dget03.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 DOUBLE PRECISION RCOND, RESID
117* ..
118* .. Array Arguments ..
119 DOUBLE PRECISION A( LDA, * ), AINV( LDAINV, * ), RWORK( * ),
120 $ WORK( LDWORK, * )
121* ..
122*
123* =====================================================================
124*
125* .. Parameters ..
126 DOUBLE PRECISION ZERO, ONE
127 parameter( zero = 0.0d+0, one = 1.0d+0 )
128* ..
129* .. Local Scalars ..
130 INTEGER I
131 DOUBLE PRECISION AINVNM, ANORM, EPS
132* ..
133* .. External Functions ..
134 DOUBLE PRECISION DLAMCH, DLANGE
135 EXTERNAL dlamch, dlange
136* ..
137* .. External Subroutines ..
138 EXTERNAL dgemm
139* ..
140* .. Intrinsic Functions ..
141 INTRINSIC dble
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 = dlamch( 'Epsilon' )
156 anorm = dlange( '1', n, n, a, lda, rwork )
157 ainvnm = dlange( '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 dgemm( 'No transpose', 'No transpose', n, n, n, -one, ainv,
168 $ 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 = dlange( '1', n, n, work, ldwork, rwork )
176*
177 resid = ( ( resid*rcond ) / eps ) / dble( n )
178*
179 RETURN
180*
181* End of DGET03
182*
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
Definition dgemm.f:188
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
double precision function dlange(norm, m, n, a, lda, work)
DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition dlange.f:114
Here is the call graph for this function:
Here is the caller graph for this function: