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

◆ zsyt03()

subroutine zsyt03 ( character  uplo,
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 
)

ZSYT03

Purpose:
 ZSYT03 computes the residual for a complex symmetric matrix times
 its inverse:
    norm( I - A*AINV ) / ( N * norm(A) * norm(AINV) * EPS )
 where EPS is the machine epsilon.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          complex symmetric matrix A is stored:
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[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 complex symmetric matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N)
[in,out]AINV
          AINV is COMPLEX*16 array, dimension (LDAINV,N)
          On entry, the inverse of the matrix A, stored as a symmetric
          matrix in the same format as A.
          In this version, AINV is expanded into a full matrix and
          multiplied by A, so the opposing triangle of AINV will be
          changed; i.e., if the upper triangular part of AINV is
          stored, the lower triangular part will be used as work space.
[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
          RCOND = 1/ (norm(A) * norm(AINV)).
[out]RESID
          RESID is DOUBLE PRECISION
          norm(I - A*AINV) / ( N * norm(A) * norm(AINV) * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 124 of file zsyt03.f.

126*
127* -- LAPACK test routine --
128* -- LAPACK is a software package provided by Univ. of Tennessee, --
129* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
130*
131* .. Scalar Arguments ..
132 CHARACTER UPLO
133 INTEGER LDA, LDAINV, LDWORK, N
134 DOUBLE PRECISION RCOND, RESID
135* ..
136* .. Array Arguments ..
137 DOUBLE PRECISION RWORK( * )
138 COMPLEX*16 A( LDA, * ), AINV( LDAINV, * ),
139 $ WORK( LDWORK, * )
140* ..
141*
142* =====================================================================
143*
144*
145* .. Parameters ..
146 DOUBLE PRECISION ZERO, ONE
147 parameter( zero = 0.0d+0, one = 1.0d+0 )
148 COMPLEX*16 CZERO, CONE
149 parameter( czero = ( 0.0d+0, 0.0d+0 ),
150 $ cone = ( 1.0d+0, 0.0d+0 ) )
151* ..
152* .. Local Scalars ..
153 INTEGER I, J
154 DOUBLE PRECISION AINVNM, ANORM, EPS
155* ..
156* .. External Functions ..
157 LOGICAL LSAME
158 DOUBLE PRECISION DLAMCH, ZLANGE, ZLANSY
159 EXTERNAL lsame, dlamch, zlange, zlansy
160* ..
161* .. External Subroutines ..
162 EXTERNAL zsymm
163* ..
164* .. Intrinsic Functions ..
165 INTRINSIC dble
166* ..
167* .. Executable Statements ..
168*
169* Quick exit if N = 0
170*
171 IF( n.LE.0 ) THEN
172 rcond = one
173 resid = zero
174 RETURN
175 END IF
176*
177* Exit with RESID = 1/EPS if ANORM = 0 or AINVNM = 0.
178*
179 eps = dlamch( 'Epsilon' )
180 anorm = zlansy( '1', uplo, n, a, lda, rwork )
181 ainvnm = zlansy( '1', uplo, n, ainv, ldainv, rwork )
182 IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
183 rcond = zero
184 resid = one / eps
185 RETURN
186 END IF
187 rcond = ( one / anorm ) / ainvnm
188*
189* Expand AINV into a full matrix and call ZSYMM to multiply
190* AINV on the left by A (store the result in WORK).
191*
192 IF( lsame( uplo, 'U' ) ) THEN
193 DO 20 j = 1, n
194 DO 10 i = 1, j - 1
195 ainv( j, i ) = ainv( i, j )
196 10 CONTINUE
197 20 CONTINUE
198 ELSE
199 DO 40 j = 1, n
200 DO 30 i = j + 1, n
201 ainv( j, i ) = ainv( i, j )
202 30 CONTINUE
203 40 CONTINUE
204 END IF
205 CALL zsymm( 'Left', uplo, n, n, -cone, a, lda, ainv, ldainv,
206 $ czero, work, ldwork )
207*
208* Add the identity matrix to WORK .
209*
210 DO 50 i = 1, n
211 work( i, i ) = work( i, i ) + cone
212 50 CONTINUE
213*
214* Compute norm(I - A*AINV) / (N * norm(A) * norm(AINV) * EPS)
215*
216 resid = zlange( '1', n, n, work, ldwork, rwork )
217*
218 resid = ( ( resid*rcond ) / eps ) / dble( n )
219*
220 RETURN
221*
222* End of ZSYT03
223*
subroutine zsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
ZSYMM
Definition zsymm.f:189
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
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:115
double precision function zlansy(norm, uplo, n, a, lda, work)
ZLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition zlansy.f:123
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: