LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ zsyt01_3()

 subroutine zsyt01_3 ( character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldafac, * ) AFAC, integer LDAFAC, complex*16, dimension( * ) E, integer, dimension( * ) IPIV, complex*16, dimension( ldc, * ) C, integer LDC, double precision, dimension( * ) RWORK, double precision RESID )

ZSYT01_3

Purpose:
``` ZSYT01_3 reconstructs a symmetric indefinite matrix A from its
block L*D*L' or U*D*U' factorization computed by ZSYTRF_RK
(or ZSYTRF_BK) and computes the residual
norm( C - A ) / ( N * norm(A) * EPS ),
where C is the reconstructed matrix and EPS is the machine epsilon.```
Parameters
 [in] UPLO ``` UPLO is CHARACTER*1 Specifies whether the upper or lower triangular part of the 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 symmetric matrix A.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N)``` [in] AFAC ``` AFAC is COMPLEX*16 array, dimension (LDAFAC,N) Diagonal of the block diagonal matrix D and factors U or L as computed by ZSYTRF_RK and ZSYTRF_BK: a) ONLY diagonal elements of the symmetric block diagonal matrix D on the diagonal of A, i.e. D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements of D should be provided on entry in array E), and b) If UPLO = 'U': factor U in the superdiagonal part of A. If UPLO = 'L': factor L in the subdiagonal part of A.``` [in] LDAFAC ``` LDAFAC is INTEGER The leading dimension of the array AFAC. LDAFAC >= max(1,N).``` [in] E ``` E is COMPLEX*16 array, dimension (N) On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where If UPLO = 'U': E(i) = D(i-1,i),i=2:N, E(1) not referenced; If UPLO = 'L': E(i) = D(i+1,i),i=1:N-1, E(N) not referenced.``` [in] IPIV ``` IPIV is INTEGER array, dimension (N) The pivot indices from ZSYTRF_RK (or ZSYTRF_BK).``` [out] C ` C is COMPLEX*16 array, dimension (LDC,N)` [in] LDC ``` LDC is INTEGER The leading dimension of the array C. LDC >= max(1,N).``` [out] RWORK ` RWORK is DOUBLE PRECISION array, dimension (N)` [out] RESID ``` RESID is DOUBLE PRECISION If UPLO = 'L', norm(L*D*L' - A) / ( N * norm(A) * EPS ) If UPLO = 'U', norm(U*D*U' - A) / ( N * norm(A) * EPS )```
Date
June 2017

Definition at line 143 of file zsyt01_3.f.

143 *
144 * -- LAPACK test routine (version 3.7.1) --
145 * -- LAPACK is a software package provided by Univ. of Tennessee, --
146 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
147 * June 2017
148 *
149 * .. Scalar Arguments ..
150  CHARACTER uplo
151  INTEGER lda, ldafac, ldc, n
152  DOUBLE PRECISION resid
153 * ..
154 * .. Array Arguments ..
155  INTEGER ipiv( * )
156  DOUBLE PRECISION rwork( * )
157  COMPLEX*16 a( lda, * ), afac( ldafac, * ), c( ldc, * ),
158  \$ e( * )
159 * ..
160 *
161 * =====================================================================
162 *
163 * .. Parameters ..
164  DOUBLE PRECISION zero, one
165  parameter( zero = 0.0d+0, one = 1.0d+0 )
166  COMPLEX*16 czero, cone
167  parameter( czero = ( 0.0d+0, 0.0d+0 ),
168  \$ cone = ( 1.0d+0, 0.0d+0 ) )
169 * ..
170 * .. Local Scalars ..
171  INTEGER i, info, j
172  DOUBLE PRECISION anorm, eps
173 * ..
174 * .. External Functions ..
175  LOGICAL lsame
176  DOUBLE PRECISION dlamch, zlansy
177  EXTERNAL lsame, dlamch, zlansy
178 * ..
179 * .. External Subroutines ..
180  EXTERNAL zlaset, zlavsy_rook, zsyconvf_rook
181 * ..
182 * .. Intrinsic Functions ..
183  INTRINSIC dble
184 * ..
185 * .. Executable Statements ..
186 *
187 * Quick exit if N = 0.
188 *
189  IF( n.LE.0 ) THEN
190  resid = zero
191  RETURN
192  END IF
193 *
194 * a) Revert to multiplyers of L
195 *
196  CALL zsyconvf_rook( uplo, 'R', n, afac, ldafac, e, ipiv, info )
197 *
198 * 1) Determine EPS and the norm of A.
199 *
200  eps = dlamch( 'Epsilon' )
201  anorm = zlansy( '1', uplo, n, a, lda, rwork )
202 *
203 * 2) Initialize C to the identity matrix.
204 *
205  CALL zlaset( 'Full', n, n, czero, cone, c, ldc )
206 *
207 * 3) Call ZLAVSY_ROOK to form the product D * U' (or D * L' ).
208 *
209  CALL zlavsy_rook( uplo, 'Transpose', 'Non-unit', n, n, afac,
210  \$ ldafac, ipiv, c, ldc, info )
211 *
212 * 4) Call ZLAVSY_ROOK again to multiply by U (or L ).
213 *
214  CALL zlavsy_rook( uplo, 'No transpose', 'Unit', n, n, afac,
215  \$ ldafac, ipiv, c, ldc, info )
216 *
217 * 5) Compute the difference C - A .
218 *
219  IF( lsame( uplo, 'U' ) ) THEN
220  DO j = 1, n
221  DO i = 1, j
222  c( i, j ) = c( i, j ) - a( i, j )
223  END DO
224  END DO
225  ELSE
226  DO j = 1, n
227  DO i = j, n
228  c( i, j ) = c( i, j ) - a( i, j )
229  END DO
230  END DO
231  END IF
232 *
233 * 6) Compute norm( C - A ) / ( N * norm(A) * EPS )
234 *
235  resid = zlansy( '1', uplo, n, c, ldc, rwork )
236 *
237  IF( anorm.LE.zero ) THEN
238  IF( resid.NE.zero )
239  \$ resid = one / eps
240  ELSE
241  resid = ( ( resid / dble( n ) ) / anorm ) / eps
242  END IF
243
244 *
245 * b) Convert to factor of L (or U)
246 *
247  CALL zsyconvf_rook( uplo, 'C', n, afac, ldafac, e, ipiv, info )
248 *
249  RETURN
250 *
251 * End of ZSYT01_3
252 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zsyconvf_rook(UPLO, WAY, N, A, LDA, E, IPIV, INFO)
ZSYCONVF_ROOK
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, or the element of largest absolute value of a complex symmetric matrix.
Definition: zlansy.f:125
subroutine zlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: zlaset.f:108
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine zlavsy_rook(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZLAVSY_ROOK
Definition: zlavsy_rook.f:157
Here is the call graph for this function:
Here is the caller graph for this function: