LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zppt03 ( character  UPLO,
integer  N,
complex*16, dimension( * )  A,
complex*16, dimension( * )  AINV,
complex*16, dimension( ldwork, * )  WORK,
integer  LDWORK,
double precision, dimension( * )  RWORK,
double precision  RCOND,
double precision  RESID 
)

ZPPT03

Purpose:
 ZPPT03 computes the residual for a Hermitian packed matrix times its
 inverse:
    norm( I - A*AINV ) / ( N * norm(A) * norm(AINV) * EPS ),
 where EPS is the machine epsilon.
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]AINV
          AINV is COMPLEX*16 array, dimension (N*(N+1)/2)
          The (Hermitian) inverse of the matrix A, stored as a packed
          triangular matrix.
[out]WORK
          WORK is COMPLEX*16 array, dimension (LDWORK,N)
[in]LDWORK
          LDWORK is INTEGER
          The leading dimension of the array WORK.  LDWORK >= max(1,N).
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (N)
[out]RCOND
          RCOND is DOUBLE PRECISION
          The reciprocal of the condition number of A, computed as
          ( 1/norm(A) ) / norm(AINV).
[out]RESID
          RESID is DOUBLE PRECISION
          norm(I - A*AINV) / ( N * norm(A) * norm(AINV) * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 112 of file zppt03.f.

112 *
113 * -- LAPACK test routine (version 3.4.0) --
114 * -- LAPACK is a software package provided by Univ. of Tennessee, --
115 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
116 * November 2011
117 *
118 * .. Scalar Arguments ..
119  CHARACTER uplo
120  INTEGER ldwork, n
121  DOUBLE PRECISION rcond, resid
122 * ..
123 * .. Array Arguments ..
124  DOUBLE PRECISION rwork( * )
125  COMPLEX*16 a( * ), ainv( * ), work( ldwork, * )
126 * ..
127 *
128 * =====================================================================
129 *
130 * .. Parameters ..
131  DOUBLE PRECISION zero, one
132  parameter ( zero = 0.0d+0, one = 1.0d+0 )
133  COMPLEX*16 czero, cone
134  parameter ( czero = ( 0.0d+0, 0.0d+0 ),
135  $ cone = ( 1.0d+0, 0.0d+0 ) )
136 * ..
137 * .. Local Scalars ..
138  INTEGER i, j, jj
139  DOUBLE PRECISION ainvnm, anorm, eps
140 * ..
141 * .. External Functions ..
142  LOGICAL lsame
143  DOUBLE PRECISION dlamch, zlange, zlanhp
144  EXTERNAL lsame, dlamch, zlange, zlanhp
145 * ..
146 * .. Intrinsic Functions ..
147  INTRINSIC dble, dconjg
148 * ..
149 * .. External Subroutines ..
150  EXTERNAL zcopy, zhpmv
151 * ..
152 * .. Executable Statements ..
153 *
154 * Quick exit if N = 0.
155 *
156  IF( n.LE.0 ) THEN
157  rcond = one
158  resid = zero
159  RETURN
160  END IF
161 *
162 * Exit with RESID = 1/EPS if ANORM = 0 or AINVNM = 0.
163 *
164  eps = dlamch( 'Epsilon' )
165  anorm = zlanhp( '1', uplo, n, a, rwork )
166  ainvnm = zlanhp( '1', uplo, n, ainv, rwork )
167  IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
168  rcond = zero
169  resid = one / eps
170  RETURN
171  END IF
172  rcond = ( one / anorm ) / ainvnm
173 *
174 * UPLO = 'U':
175 * Copy the leading N-1 x N-1 submatrix of AINV to WORK(1:N,2:N) and
176 * expand it to a full matrix, then multiply by A one column at a
177 * time, moving the result one column to the left.
178 *
179  IF( lsame( uplo, 'U' ) ) THEN
180 *
181 * Copy AINV
182 *
183  jj = 1
184  DO 20 j = 1, n - 1
185  CALL zcopy( j, ainv( jj ), 1, work( 1, j+1 ), 1 )
186  DO 10 i = 1, j - 1
187  work( j, i+1 ) = dconjg( ainv( jj+i-1 ) )
188  10 CONTINUE
189  jj = jj + j
190  20 CONTINUE
191  jj = ( ( n-1 )*n ) / 2 + 1
192  DO 30 i = 1, n - 1
193  work( n, i+1 ) = dconjg( ainv( jj+i-1 ) )
194  30 CONTINUE
195 *
196 * Multiply by A
197 *
198  DO 40 j = 1, n - 1
199  CALL zhpmv( 'Upper', n, -cone, a, work( 1, j+1 ), 1, czero,
200  $ work( 1, j ), 1 )
201  40 CONTINUE
202  CALL zhpmv( 'Upper', n, -cone, a, ainv( jj ), 1, czero,
203  $ work( 1, n ), 1 )
204 *
205 * UPLO = 'L':
206 * Copy the trailing N-1 x N-1 submatrix of AINV to WORK(1:N,1:N-1)
207 * and multiply by A, moving each column to the right.
208 *
209  ELSE
210 *
211 * Copy AINV
212 *
213  DO 50 i = 1, n - 1
214  work( 1, i ) = dconjg( ainv( i+1 ) )
215  50 CONTINUE
216  jj = n + 1
217  DO 70 j = 2, n
218  CALL zcopy( n-j+1, ainv( jj ), 1, work( j, j-1 ), 1 )
219  DO 60 i = 1, n - j
220  work( j, j+i-1 ) = dconjg( ainv( jj+i ) )
221  60 CONTINUE
222  jj = jj + n - j + 1
223  70 CONTINUE
224 *
225 * Multiply by A
226 *
227  DO 80 j = n, 2, -1
228  CALL zhpmv( 'Lower', n, -cone, a, work( 1, j-1 ), 1, czero,
229  $ work( 1, j ), 1 )
230  80 CONTINUE
231  CALL zhpmv( 'Lower', n, -cone, a, ainv( 1 ), 1, czero,
232  $ work( 1, 1 ), 1 )
233 *
234  END IF
235 *
236 * Add the identity matrix to WORK .
237 *
238  DO 90 i = 1, n
239  work( i, i ) = work( i, i ) + cone
240  90 CONTINUE
241 *
242 * Compute norm(I - A*AINV) / (N * norm(A) * norm(AINV) * EPS)
243 *
244  resid = zlange( '1', n, n, work, ldwork, rwork )
245 *
246  resid = ( ( resid*rcond ) / eps ) / dble( n )
247 *
248  RETURN
249 *
250 * End of ZPPT03
251 *
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
Definition: zcopy.f:52
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
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
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlange.f:117
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine zhpmv(UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY)
ZHPMV
Definition: zhpmv.f:151

Here is the call graph for this function:

Here is the caller graph for this function: