LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zspt01 ( 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 
)

ZSPT01

Purpose:
 ZSPT01 reconstructs a symmetric indefinite packed matrix A from its
 diagonal pivoting factorization A = U*D*U' or A = L*D*L' and computes
 the residual
    norm( C - A ) / ( N * norm(A) * EPS ),
 where C is the reconstructed matrix and 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 order of the matrix A.  N >= 0.
[in]A
          A is COMPLEX*16 array, dimension (N*(N+1)/2)
          The original symmetric 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
          L*D*L' or U*D*U' factorization as computed by ZSPTRF.
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          The pivot indices from ZSPTRF.
[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 2011

Definition at line 114 of file zspt01.f.

114 *
115 * -- LAPACK test routine (version 3.4.0) --
116 * -- LAPACK is a software package provided by Univ. of Tennessee, --
117 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
118 * November 2011
119 *
120 * .. Scalar Arguments ..
121  CHARACTER uplo
122  INTEGER ldc, n
123  DOUBLE PRECISION resid
124 * ..
125 * .. Array Arguments ..
126  INTEGER ipiv( * )
127  DOUBLE PRECISION rwork( * )
128  COMPLEX*16 a( * ), afac( * ), c( ldc, * )
129 * ..
130 *
131 * =====================================================================
132 *
133 * .. Parameters ..
134  DOUBLE PRECISION zero, one
135  parameter ( zero = 0.0d+0, one = 1.0d+0 )
136  COMPLEX*16 czero, cone
137  parameter ( czero = ( 0.0d+0, 0.0d+0 ),
138  $ cone = ( 1.0d+0, 0.0d+0 ) )
139 * ..
140 * .. Local Scalars ..
141  INTEGER i, info, j, jc
142  DOUBLE PRECISION anorm, eps
143 * ..
144 * .. External Functions ..
145  LOGICAL lsame
146  DOUBLE PRECISION dlamch, zlansp, zlansy
147  EXTERNAL lsame, dlamch, zlansp, zlansy
148 * ..
149 * .. External Subroutines ..
150  EXTERNAL zlaset, zlavsp
151 * ..
152 * .. Intrinsic Functions ..
153  INTRINSIC dble
154 * ..
155 * .. Executable Statements ..
156 *
157 * Quick exit if N = 0.
158 *
159  IF( n.LE.0 ) THEN
160  resid = zero
161  RETURN
162  END IF
163 *
164 * Determine EPS and the norm of A.
165 *
166  eps = dlamch( 'Epsilon' )
167  anorm = zlansp( '1', uplo, n, a, rwork )
168 *
169 * Initialize C to the identity matrix.
170 *
171  CALL zlaset( 'Full', n, n, czero, cone, c, ldc )
172 *
173 * Call ZLAVSP to form the product D * U' (or D * L' ).
174 *
175  CALL zlavsp( uplo, 'Transpose', 'Non-unit', n, n, afac, ipiv, c,
176  $ ldc, info )
177 *
178 * Call ZLAVSP again to multiply by U ( or L ).
179 *
180  CALL zlavsp( uplo, 'No transpose', 'Unit', n, n, afac, ipiv, c,
181  $ ldc, info )
182 *
183 * Compute the difference C - A .
184 *
185  IF( lsame( uplo, 'U' ) ) THEN
186  jc = 0
187  DO 20 j = 1, n
188  DO 10 i = 1, j
189  c( i, j ) = c( i, j ) - a( jc+i )
190  10 CONTINUE
191  jc = jc + j
192  20 CONTINUE
193  ELSE
194  jc = 1
195  DO 40 j = 1, n
196  DO 30 i = j, n
197  c( i, j ) = c( i, j ) - a( jc+i-j )
198  30 CONTINUE
199  jc = jc + n - j + 1
200  40 CONTINUE
201  END IF
202 *
203 * Compute norm( C - A ) / ( N * norm(A) * EPS )
204 *
205  resid = zlansy( '1', uplo, n, c, ldc, rwork )
206 *
207  IF( anorm.LE.zero ) THEN
208  IF( resid.NE.zero )
209  $ resid = one / eps
210  ELSE
211  resid = ( ( resid / dble( n ) ) / anorm ) / eps
212  END IF
213 *
214  RETURN
215 *
216 * End of ZSPT01
217 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
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 zlansy(NORM, UPLO, N, A, LDA, WORK)
ZLANSY 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 symmetric matrix.
Definition: zlansy.f:125
double precision function zlansp(NORM, UPLO, N, AP, WORK)
ZLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric matrix supplied in packed form.
Definition: zlansp.f:117
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine zlavsp(UPLO, TRANS, DIAG, N, NRHS, A, IPIV, B, LDB, INFO)
ZLAVSP
Definition: zlavsp.f:133

Here is the call graph for this function:

Here is the caller graph for this function: