LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ 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.
Date
December 2016

Definition at line 111 of file dget03.f.

111 *
112 * -- LAPACK test routine (version 3.7.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 * December 2016
116 *
117 * .. Scalar Arguments ..
118  INTEGER lda, ldainv, ldwork, n
119  DOUBLE PRECISION rcond, resid
120 * ..
121 * .. Array Arguments ..
122  DOUBLE PRECISION a( lda, * ), ainv( ldainv, * ), rwork( * ),
123  $ work( ldwork, * )
124 * ..
125 *
126 * =====================================================================
127 *
128 * .. Parameters ..
129  DOUBLE PRECISION zero, one
130  parameter( zero = 0.0d+0, one = 1.0d+0 )
131 * ..
132 * .. Local Scalars ..
133  INTEGER i
134  DOUBLE PRECISION ainvnm, anorm, eps
135 * ..
136 * .. External Functions ..
137  DOUBLE PRECISION dlamch, dlange
138  EXTERNAL dlamch, dlange
139 * ..
140 * .. External Subroutines ..
141  EXTERNAL dgemm
142 * ..
143 * .. Intrinsic Functions ..
144  INTRINSIC dble
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 = dlamch( 'Epsilon' )
159  anorm = dlange( '1', n, n, a, lda, rwork )
160  ainvnm = dlange( '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 dgemm( 'No transpose', 'No transpose', n, n, n, -one, ainv,
171  $ 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 = dlange( '1', n, n, work, ldwork, rwork )
179 *
180  resid = ( ( resid*rcond ) / eps ) / dble( n )
181 *
182  RETURN
183 *
184 * End of DGET03
185 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DGEMM
Definition: dgemm.f:189
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:116
Here is the call graph for this function:
Here is the caller graph for this function: