LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zhet01()

subroutine zhet01 ( 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

Purpose:
 ZHET01 reconstructs a 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 conjugate transpose of L, and U' is the conjugate transpose
 of U.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          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 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 ZHETRF.
[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 ZHETRF.
[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.
Date
November 2013

Definition at line 128 of file zhet01.f.

128 *
129 * -- LAPACK test routine (version 3.5.0) --
130 * -- LAPACK is a software package provided by Univ. of Tennessee, --
131 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
132 * November 2013
133 *
134 * .. Scalar Arguments ..
135  CHARACTER uplo
136  INTEGER lda, ldafac, ldc, n
137  DOUBLE PRECISION resid
138 * ..
139 * .. Array Arguments ..
140  INTEGER ipiv( * )
141  DOUBLE PRECISION rwork( * )
142  COMPLEX*16 a( lda, * ), afac( ldafac, * ), c( ldc, * )
143 * ..
144 *
145 * =====================================================================
146 *
147 * .. Parameters ..
148  DOUBLE PRECISION zero, one
149  parameter( zero = 0.0d+0, one = 1.0d+0 )
150  COMPLEX*16 czero, cone
151  parameter( czero = ( 0.0d+0, 0.0d+0 ),
152  $ cone = ( 1.0d+0, 0.0d+0 ) )
153 * ..
154 * .. Local Scalars ..
155  INTEGER i, info, j
156  DOUBLE PRECISION anorm, eps
157 * ..
158 * .. External Functions ..
159  LOGICAL lsame
160  DOUBLE PRECISION dlamch, zlanhe
161  EXTERNAL lsame, dlamch, zlanhe
162 * ..
163 * .. External Subroutines ..
164  EXTERNAL zlaset, zlavhe
165 * ..
166 * .. Intrinsic Functions ..
167  INTRINSIC dble, dimag
168 * ..
169 * .. Executable Statements ..
170 *
171 * Quick exit if N = 0.
172 *
173  IF( n.LE.0 ) THEN
174  resid = zero
175  RETURN
176  END IF
177 *
178 * Determine EPS and the norm of A.
179 *
180  eps = dlamch( 'Epsilon' )
181  anorm = zlanhe( '1', uplo, n, a, lda, rwork )
182 *
183 * Check the imaginary parts of the diagonal elements and return with
184 * an error code if any are nonzero.
185 *
186  DO 10 j = 1, n
187  IF( dimag( afac( j, j ) ).NE.zero ) THEN
188  resid = one / eps
189  RETURN
190  END IF
191  10 CONTINUE
192 *
193 * Initialize C to the identity matrix.
194 *
195  CALL zlaset( 'Full', n, n, czero, cone, c, ldc )
196 *
197 * Call ZLAVHE to form the product D * U' (or D * L' ).
198 *
199  CALL zlavhe( uplo, 'Conjugate', 'Non-unit', n, n, afac, ldafac,
200  $ ipiv, c, ldc, info )
201 *
202 * Call ZLAVHE again to multiply by U (or L ).
203 *
204  CALL zlavhe( uplo, 'No transpose', 'Unit', n, n, afac, ldafac,
205  $ ipiv, c, ldc, info )
206 *
207 * Compute the difference C - A .
208 *
209  IF( lsame( uplo, 'U' ) ) THEN
210  DO 30 j = 1, n
211  DO 20 i = 1, j - 1
212  c( i, j ) = c( i, j ) - a( i, j )
213  20 CONTINUE
214  c( j, j ) = c( j, j ) - dble( a( j, j ) )
215  30 CONTINUE
216  ELSE
217  DO 50 j = 1, n
218  c( j, j ) = c( j, j ) - dble( a( j, j ) )
219  DO 40 i = j + 1, n
220  c( i, j ) = c( i, j ) - a( i, j )
221  40 CONTINUE
222  50 CONTINUE
223  END IF
224 *
225 * Compute norm( C - A ) / ( N * norm(A) * EPS )
226 *
227  resid = zlanhe( '1', uplo, n, c, ldc, rwork )
228 *
229  IF( anorm.LE.zero ) THEN
230  IF( resid.NE.zero )
231  $ resid = one / eps
232  ELSE
233  resid = ( ( resid / dble( n ) ) / anorm ) / eps
234  END IF
235 *
236  RETURN
237 *
238 * End of ZHET01
239 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
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
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
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine zlavhe(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
ZLAVHE
Definition: zlavhe.f:155
Here is the call graph for this function:
Here is the caller graph for this function: