LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

◆ zhet01_rook()

 subroutine zhet01_rook ( 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 )

ZHET01_ROOK

Purpose:
``` ZHET01_ROOK reconstructs a complex Hermitian 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 Hermitian 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 Hermitian 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 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*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
November 2013

Definition at line 127 of file zhet01_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  DOUBLE PRECISION resid
137 * ..
138 * .. Array Arguments ..
139  INTEGER ipiv( * )
140  DOUBLE PRECISION rwork( * )
141  COMPLEX*16 a( lda, * ), afac( ldafac, * ), c( ldc, * )
142 * ..
143 *
144 * =====================================================================
145 *
146 * .. Parameters ..
147  DOUBLE PRECISION zero, one
148  parameter( zero = 0.0d+0, one = 1.0d+0 )
149  COMPLEX*16 czero, cone
150  parameter( czero = ( 0.0d+0, 0.0d+0 ),
151  \$ cone = ( 1.0d+0, 0.0d+0 ) )
152 * ..
153 * .. Local Scalars ..
154  INTEGER i, info, j
155  DOUBLE PRECISION anorm, eps
156 * ..
157 * .. External Functions ..
158  LOGICAL lsame
159  DOUBLE PRECISION zlanhe, dlamch
160  EXTERNAL lsame, zlanhe, dlamch
161 * ..
162 * .. External Subroutines ..
163  EXTERNAL zlaset, zlavhe_rook
164 * ..
165 * .. Intrinsic Functions ..
166  INTRINSIC dimag, dble
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 = dlamch( 'Epsilon' )
180  anorm = zlanhe( '1', uplo, n, a, lda, rwork )
181 *
182 * Check the imaginary parts of the diagonal elements and return with
183 * an error code if any are nonzero.
184 *
185  DO 10 j = 1, n
186  IF( dimag( afac( j, j ) ).NE.zero ) THEN
187  resid = one / eps
188  RETURN
189  END IF
190  10 CONTINUE
191 *
192 * Initialize C to the identity matrix.
193 *
194  CALL zlaset( 'Full', n, n, czero, cone, c, ldc )
195 *
196 * Call ZLAVHE_ROOK to form the product D * U' (or D * L' ).
197 *
198  CALL zlavhe_rook( uplo, 'Conjugate', 'Non-unit', n, n, afac,
199  \$ ldafac, ipiv, c, ldc, info )
200 *
201 * Call ZLAVHE_ROOK again to multiply by U (or L ).
202 *
203  CALL zlavhe_rook( uplo, 'No transpose', 'Unit', n, n, afac,
204  \$ ldafac, ipiv, c, ldc, info )
205 *
206 * Compute the difference C - A .
207 *
208  IF( lsame( uplo, 'U' ) ) THEN
209  DO 30 j = 1, n
210  DO 20 i = 1, j - 1
211  c( i, j ) = c( i, j ) - a( i, j )
212  20 CONTINUE
213  c( j, j ) = c( j, j ) - dble( a( j, j ) )
214  30 CONTINUE
215  ELSE
216  DO 50 j = 1, n
217  c( j, j ) = c( j, j ) - dble( a( j, j ) )
218  DO 40 i = j + 1, n
219  c( i, j ) = c( i, j ) - a( i, j )
220  40 CONTINUE
221  50 CONTINUE
222  END IF
223 *
224 * Compute norm( C - A ) / ( N * norm(A) * EPS )
225 *
226  resid = zlanhe( '1', uplo, n, c, ldc, rwork )
227 *
228  IF( anorm.LE.zero ) THEN
229  IF( resid.NE.zero )
230  \$ resid = one / eps
231  ELSE
232  resid = ( ( resid/dble( n ) )/anorm ) / eps
233  END IF
234 *
235  RETURN
236 *
237 * End of ZHET01_ROOK
238 *
subroutine zlavhe_rook(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZLAVHE_ROOK
Definition: zlavhe_rook.f:155
double precision function zlanhe(NORM, UPLO, N, A, LDA, WORK)
ZLANHE 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 Hermitian matrix.
Definition: zlanhe.f:126
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
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
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
Here is the call graph for this function:
Here is the caller graph for this function: