LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zget03()

subroutine zget03 ( integer  N,
complex*16, dimension( lda, * )  A,
integer  LDA,
complex*16, dimension( ldainv, * )  AINV,
integer  LDAINV,
complex*16, dimension( ldwork, * )  WORK,
integer  LDWORK,
double precision, dimension( * )  RWORK,
double precision  RCOND,
double precision  RESID 
)

ZGET03

Purpose:
 ZGET03 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*16 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*16 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*16 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 112 of file zget03.f.

112 *
113 * -- LAPACK test routine (version 3.7.0) --
114 * -- LAPACK is a software package provided by Univ. of Tennessee, --
115 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
116 * December 2016
117 *
118 * .. Scalar Arguments ..
119  INTEGER lda, ldainv, ldwork, n
120  DOUBLE PRECISION rcond, resid
121 * ..
122 * .. Array Arguments ..
123  DOUBLE PRECISION rwork( * )
124  COMPLEX*16 a( lda, * ), ainv( ldainv, * ),
125  $ work( ldwork, * )
126 * ..
127 *
128 * =====================================================================
129 *
130 * .. Parameters ..
131  DOUBLE PRECISION zero, one
132  parameter( zero = 0.0d+0, one = 1.0d+0 )
133  COMPLEX*16 czero, cone
134  parameter( czero = ( 0.0d+0, 0.0d+0 ),
135  $ cone = ( 1.0d+0, 0.0d+0 ) )
136 * ..
137 * .. Local Scalars ..
138  INTEGER i
139  DOUBLE PRECISION ainvnm, anorm, eps
140 * ..
141 * .. External Functions ..
142  DOUBLE PRECISION dlamch, zlange
143  EXTERNAL dlamch, zlange
144 * ..
145 * .. External Subroutines ..
146  EXTERNAL zgemm
147 * ..
148 * .. Intrinsic Functions ..
149  INTRINSIC dble
150 * ..
151 * .. Executable Statements ..
152 *
153 * Quick exit if N = 0.
154 *
155  IF( n.LE.0 ) THEN
156  rcond = one
157  resid = zero
158  RETURN
159  END IF
160 *
161 * Exit with RESID = 1/EPS if ANORM = 0 or AINVNM = 0.
162 *
163  eps = dlamch( 'Epsilon' )
164  anorm = zlange( '1', n, n, a, lda, rwork )
165  ainvnm = zlange( '1', n, n, ainv, ldainv, rwork )
166  IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
167  rcond = zero
168  resid = one / eps
169  RETURN
170  END IF
171  rcond = ( one / anorm ) / ainvnm
172 *
173 * Compute I - A * AINV
174 *
175  CALL zgemm( 'No transpose', 'No transpose', n, n, n, -cone, ainv,
176  $ ldainv, a, lda, czero, work, ldwork )
177  DO 10 i = 1, n
178  work( i, i ) = cone + work( i, i )
179  10 CONTINUE
180 *
181 * Compute norm(I - AINV*A) / (N * norm(A) * norm(AINV) * EPS)
182 *
183  resid = zlange( '1', n, n, work, ldwork, rwork )
184 *
185  resid = ( ( resid*rcond ) / eps ) / dble( n )
186 *
187  RETURN
188 *
189 * End of ZGET03
190 *
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlange.f:117
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
Definition: zgemm.f:189
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
Here is the call graph for this function:
Here is the caller graph for this function: