LAPACK  3.10.1 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 )```

Definition at line 123 of file zhet01_rook.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 ZLANHE, DLAMCH
157  EXTERNAL lsame, zlanhe, dlamch
158 * ..
159 * .. External Subroutines ..
160  EXTERNAL zlaset, zlavhe_rook
161 * ..
162 * .. Intrinsic Functions ..
163  INTRINSIC dimag, 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 = zlanhe( '1', uplo, n, a, lda, rwork )
178 *
179 * Check the imaginary parts of the diagonal elements and return with
180 * an error code if any are nonzero.
181 *
182  DO 10 j = 1, n
183  IF( dimag( afac( j, j ) ).NE.zero ) THEN
184  resid = one / eps
185  RETURN
186  END IF
187  10 CONTINUE
188 *
189 * Initialize C to the identity matrix.
190 *
191  CALL zlaset( 'Full', n, n, czero, cone, c, ldc )
192 *
193 * Call ZLAVHE_ROOK to form the product D * U' (or D * L' ).
194 *
195  CALL zlavhe_rook( uplo, 'Conjugate', 'Non-unit', n, n, afac,
196  \$ ldafac, ipiv, c, ldc, info )
197 *
198 * Call ZLAVHE_ROOK again to multiply by U (or L ).
199 *
200  CALL zlavhe_rook( uplo, 'No transpose', 'Unit', n, n, afac,
201  \$ ldafac, ipiv, c, ldc, info )
202 *
203 * Compute the difference C - A .
204 *
205  IF( lsame( uplo, 'U' ) ) THEN
206  DO 30 j = 1, n
207  DO 20 i = 1, j - 1
208  c( i, j ) = c( i, j ) - a( i, j )
209  20 CONTINUE
210  c( j, j ) = c( j, j ) - dble( a( j, j ) )
211  30 CONTINUE
212  ELSE
213  DO 50 j = 1, n
214  c( j, j ) = c( j, j ) - dble( a( j, j ) )
215  DO 40 i = j + 1, n
216  c( i, j ) = c( i, j ) - a( i, j )
217  40 CONTINUE
218  50 CONTINUE
219  END IF
220 *
221 * Compute norm( C - A ) / ( N * norm(A) * EPS )
222 *
223  resid = zlanhe( '1', uplo, n, c, ldc, rwork )
224 *
225  IF( anorm.LE.zero ) THEN
226  IF( resid.NE.zero )
227  \$ resid = one / eps
228  ELSE
229  resid = ( ( resid/dble( n ) )/anorm ) / eps
230  END IF
231 *
232  RETURN
233 *
234 * End of ZHET01_ROOK
235 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:69
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine zlavhe_rook(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZLAVHE_ROOK
Definition: zlavhe_rook.f:153
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,...
Definition: zlanhe.f:124
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
Here is the call graph for this function:
Here is the caller graph for this function: