LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ zsyt01()

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

ZSYT01

Purpose:
 ZSYT01 reconstructs a complex symmetric indefinite matrix A from its
 block L*D*L' or U*D*U' factorization and computes the residual
    norm( C - A ) / ( N * norm(A) * EPS ),
 where C is the reconstructed matrix, EPS is the machine epsilon,
 L' is the transpose of L, and U' is the transpose of U.
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]AFAC
          AFAC is COMPLEX*16 array, dimension (LDAFAC,N)
          The factored form of the matrix A.  AFAC contains the block
          diagonal matrix D and the multipliers used to obtain the
          factor L or U from the block L*D*L' or U*D*U' factorization
          as computed by ZSYTRF.
[in]LDAFAC
          LDAFAC is INTEGER
          The leading dimension of the array AFAC.  LDAFAC >= max(1,N).
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          The pivot indices from ZSYTRF.
[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 )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 123 of file zsyt01.f.

125 *
126 * -- LAPACK test routine --
127 * -- LAPACK is a software package provided by Univ. of Tennessee, --
128 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
129 *
130 * .. Scalar Arguments ..
131  CHARACTER UPLO
132  INTEGER LDA, LDAFAC, LDC, N
133  DOUBLE PRECISION RESID
134 * ..
135 * .. Array Arguments ..
136  INTEGER IPIV( * )
137  DOUBLE PRECISION RWORK( * )
138  COMPLEX*16 A( LDA, * ), AFAC( LDAFAC, * ), C( LDC, * )
139 * ..
140 *
141 * =====================================================================
142 *
143 * .. Parameters ..
144  DOUBLE PRECISION ZERO, ONE
145  parameter( zero = 0.0d+0, one = 1.0d+0 )
146  COMPLEX*16 CZERO, CONE
147  parameter( czero = ( 0.0d+0, 0.0d+0 ),
148  $ cone = ( 1.0d+0, 0.0d+0 ) )
149 * ..
150 * .. Local Scalars ..
151  INTEGER I, INFO, J
152  DOUBLE PRECISION ANORM, EPS
153 * ..
154 * .. External Functions ..
155  LOGICAL LSAME
156  DOUBLE PRECISION DLAMCH, ZLANSY
157  EXTERNAL lsame, dlamch, zlansy
158 * ..
159 * .. External Subroutines ..
160  EXTERNAL zlaset, zlavsy
161 * ..
162 * .. Intrinsic Functions ..
163  INTRINSIC dble
164 * ..
165 * .. Executable Statements ..
166 *
167 * Quick exit if N = 0.
168 *
169  IF( n.LE.0 ) THEN
170  resid = zero
171  RETURN
172  END IF
173 *
174 * Determine EPS and the norm of A.
175 *
176  eps = dlamch( 'Epsilon' )
177  anorm = zlansy( '1', uplo, n, a, lda, rwork )
178 *
179 * Initialize C to the identity matrix.
180 *
181  CALL zlaset( 'Full', n, n, czero, cone, c, ldc )
182 *
183 * Call ZLAVSY to form the product D * U' (or D * L' ).
184 *
185  CALL zlavsy( uplo, 'Transpose', 'Non-unit', n, n, afac, ldafac,
186  $ ipiv, c, ldc, info )
187 *
188 * Call ZLAVSY again to multiply by U (or L ).
189 *
190  CALL zlavsy( uplo, 'No transpose', 'Unit', n, n, afac, ldafac,
191  $ ipiv, c, ldc, info )
192 *
193 * Compute the difference C - A .
194 *
195  IF( lsame( uplo, 'U' ) ) THEN
196  DO 20 j = 1, n
197  DO 10 i = 1, j
198  c( i, j ) = c( i, j ) - a( i, j )
199  10 CONTINUE
200  20 CONTINUE
201  ELSE
202  DO 40 j = 1, n
203  DO 30 i = j, n
204  c( i, j ) = c( i, j ) - a( i, j )
205  30 CONTINUE
206  40 CONTINUE
207  END IF
208 *
209 * Compute norm( C - A ) / ( N * norm(A) * EPS )
210 *
211  resid = zlansy( '1', uplo, n, c, ldc, rwork )
212 *
213  IF( anorm.LE.zero ) THEN
214  IF( resid.NE.zero )
215  $ resid = one / eps
216  ELSE
217  resid = ( ( resid / dble( n ) ) / anorm ) / eps
218  END IF
219 *
220  RETURN
221 *
222 * End of ZSYT01
223 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:69
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine zlavsy(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZLAVSY
Definition: zlavsy.f:153
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:106
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
Here is the call graph for this function:
Here is the caller graph for this function: