LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zhpt01()

subroutine zhpt01 ( character  UPLO,
integer  N,
complex*16, dimension( * )  A,
complex*16, dimension( * )  AFAC,
integer, dimension( * )  IPIV,
complex*16, dimension( ldc, * )  C,
integer  LDC,
double precision, dimension( * )  RWORK,
double precision  RESID 
)

ZHPT01

Purpose:
 ZHPT01 reconstructs a Hermitian indefinite packed 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 (N*(N+1)/2)
          The original Hermitian matrix A, stored as a packed
          triangular matrix.
[in]AFAC
          AFAC is COMPLEX*16 array, dimension (N*(N+1)/2)
          The factored form of the matrix A, stored as a packed
          triangular matrix.  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 ZHPTRF.
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          The pivot indices from ZHPTRF.
[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
December 2016

Definition at line 115 of file zhpt01.f.

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