LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ csyt01_3()

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

CSYT01_3

Purpose:
 CSYT01_3 reconstructs a symmetric indefinite matrix A from its
 block L*D*L' or U*D*U' factorization computed by CSYTRF_RK
 (or CSYTRF_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 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 array, dimension (LDAFAC,N)
          Diagonal of the block diagonal matrix D and factors U or L
          as computed by CSYTRF_RK and CSYTRF_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 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 CSYTRF_RK (or CSYTRF_BK).
[out]C
          C is COMPLEX array, dimension (LDC,N)
[in]LDC
          LDC is INTEGER
          The leading dimension of the array C.  LDC >= max(1,N).
[out]RWORK
          RWORK is REAL array, dimension (N)
[out]RESID
          RESID is REAL
          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.
Date
June 2017

Definition at line 143 of file csyt01_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  REAL resid
153 * ..
154 * .. Array Arguments ..
155  INTEGER ipiv( * )
156  REAL rwork( * )
157  COMPLEX a( lda, * ), afac( ldafac, * ), c( ldc, * ),
158  $ e( * )
159 * ..
160 *
161 * =====================================================================
162 *
163 * .. Parameters ..
164  REAL zero, one
165  parameter( zero = 0.0e+0, one = 1.0e+0 )
166  COMPLEX czero, cone
167  parameter( czero = ( 0.0e+0, 0.0e+0 ),
168  $ cone = ( 1.0e+0, 0.0e+0 ) )
169 * ..
170 * .. Local Scalars ..
171  INTEGER i, info, j
172  REAL anorm, eps
173 * ..
174 * .. External Functions ..
175  LOGICAL lsame
176  REAL slamch, clansy
177  EXTERNAL lsame, slamch, clansy
178 * ..
179 * .. External Subroutines ..
180  EXTERNAL claset, clavsy_rook, csyconvf_rook
181 * ..
182 * .. Intrinsic Functions ..
183  INTRINSIC real
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 csyconvf_rook( uplo, 'R', n, afac, ldafac, e, ipiv, info )
197 *
198 * 1) Determine EPS and the norm of A.
199 *
200  eps = slamch( 'Epsilon' )
201  anorm = clansy( '1', uplo, n, a, lda, rwork )
202 *
203 * 2) Initialize C to the identity matrix.
204 *
205  CALL claset( '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 clavsy_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 clavsy_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 = clansy( '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 / REAL( N ) ) / anorm ) / eps
242  END IF
243 
244 *
245 * b) Convert to factor of L (or U)
246 *
247  CALL csyconvf_rook( uplo, 'C', n, afac, ldafac, e, ipiv, info )
248 *
249  RETURN
250 *
251 * End of CSYT01_3
252 *
subroutine clavsy_rook(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
CLAVSY_ROOK
Definition: clavsy_rook.f:157
subroutine csyconvf_rook(UPLO, WAY, N, A, LDA, E, IPIV, INFO)
CSYCONVF_ROOK
subroutine claset(UPLO, M, N, ALPHA, BETA, A, LDA)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: claset.f:108
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
real function clansy(NORM, UPLO, N, A, LDA, WORK)
CLANSY 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: clansy.f:125
Here is the call graph for this function:
Here is the caller graph for this function: