LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ csyt01_rook()

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

CSYT01_ROOK

Purpose:
 CSYT01_ROOK 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 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 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 CSYTRF_ROOK.
[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 CSYTRF_ROOK.
[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
November 2013

Definition at line 127 of file csyt01_rook.f.

127 *
128 * -- LAPACK test routine (version 3.5.0) --
129 * -- LAPACK is a software package provided by Univ. of Tennessee, --
130 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
131 * November 2013
132 *
133 * .. Scalar Arguments ..
134  CHARACTER uplo
135  INTEGER lda, ldafac, ldc, n
136  REAL resid
137 * ..
138 * .. Array Arguments ..
139  INTEGER ipiv( * )
140  REAL rwork( * )
141  COMPLEX a( lda, * ), afac( ldafac, * ), c( ldc, * )
142 * ..
143 *
144 * =====================================================================
145 *
146 * .. Parameters ..
147  REAL zero, one
148  parameter( zero = 0.0e+0, one = 1.0e+0 )
149  COMPLEX czero, cone
150  parameter( czero = ( 0.0e+0, 0.0e+0 ),
151  $ cone = ( 1.0e+0, 0.0e+0 ) )
152 * ..
153 * .. Local Scalars ..
154  INTEGER i, info, j
155  REAL anorm, eps
156 * ..
157 * .. External Functions ..
158  LOGICAL lsame
159  REAL clansy, slamch
160  EXTERNAL lsame, clansy, slamch
161 * ..
162 * .. External Subroutines ..
163  EXTERNAL claset, clavsy_rook
164 * ..
165 * .. Intrinsic Functions ..
166  INTRINSIC real
167 * ..
168 * .. Executable Statements ..
169 *
170 * Quick exit if N = 0.
171 *
172  IF( n.LE.0 ) THEN
173  resid = zero
174  RETURN
175  END IF
176 *
177 * Determine EPS and the norm of A.
178 *
179  eps = slamch( 'Epsilon' )
180  anorm = clansy( '1', uplo, n, a, lda, rwork )
181 *
182 * Initialize C to the identity matrix.
183 *
184  CALL claset( 'Full', n, n, czero, cone, c, ldc )
185 *
186 * Call CLAVSY_ROOK to form the product D * U' (or D * L' ).
187 *
188  CALL clavsy_rook( uplo, 'Transpose', 'Non-unit', n, n, afac,
189  $ ldafac, ipiv, c, ldc, info )
190 *
191 * Call CLAVSY_ROOK again to multiply by U (or L ).
192 *
193  CALL clavsy_rook( uplo, 'No transpose', 'Unit', n, n, afac,
194  $ ldafac, ipiv, c, ldc, info )
195 *
196 * Compute the difference C - A .
197 *
198  IF( lsame( uplo, 'U' ) ) THEN
199  DO 20 j = 1, n
200  DO 10 i = 1, j
201  c( i, j ) = c( i, j ) - a( i, j )
202  10 CONTINUE
203  20 CONTINUE
204  ELSE
205  DO 40 j = 1, n
206  DO 30 i = j, n
207  c( i, j ) = c( i, j ) - a( i, j )
208  30 CONTINUE
209  40 CONTINUE
210  END IF
211 *
212 * Compute norm( C - A ) / ( N * norm(A) * EPS )
213 *
214  resid = clansy( '1', uplo, n, c, ldc, rwork )
215 *
216  IF( anorm.LE.zero ) THEN
217  IF( resid.NE.zero )
218  $ resid = one / eps
219  ELSE
220  resid = ( ( resid/REAL( N ) )/anorm ) / eps
221  END IF
222 *
223  RETURN
224 *
225 * End of CSYT01_ROOK
226 *
subroutine clavsy_rook(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
CLAVSY_ROOK
Definition: clavsy_rook.f:157
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: