 LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 subroutine dspt01 ( character UPLO, integer N, double precision, dimension( * ) A, double precision, dimension( * ) AFAC, integer, dimension( * ) IPIV, double precision, dimension( ldc, * ) C, integer LDC, double precision, dimension( * ) RWORK, double precision RESID )

DSPT01

Purpose:
``` DSPT01 reconstructs a symmetric 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 and EPS is the machine epsilon.```
Parameters
 [in] UPLO ``` UPLO is CHARACTER*1 Specifies whether the upper or lower triangular part of the symmetric 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 DOUBLE PRECISION array, dimension (N*(N+1)/2) The original symmetric matrix A, stored as a packed triangular matrix.``` [in] AFAC ``` AFAC is DOUBLE PRECISION 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 DSPTRF.``` [in] IPIV ``` IPIV is INTEGER array, dimension (N) The pivot indices from DSPTRF.``` [out] C ` C is DOUBLE PRECISION 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 )```
Date
November 2011

Definition at line 112 of file dspt01.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 ldc, n
121  DOUBLE PRECISION resid
122 * ..
123 * .. Array Arguments ..
124  INTEGER ipiv( * )
125  DOUBLE PRECISION a( * ), afac( * ), c( ldc, * ), rwork( * )
126 * ..
127 *
128 * =====================================================================
129 *
130 * .. Parameters ..
131  DOUBLE PRECISION zero, one
132  parameter ( zero = 0.0d+0, one = 1.0d+0 )
133 * ..
134 * .. Local Scalars ..
135  INTEGER i, info, j, jc
136  DOUBLE PRECISION anorm, eps
137 * ..
138 * .. External Functions ..
139  LOGICAL lsame
140  DOUBLE PRECISION dlamch, dlansp, dlansy
141  EXTERNAL lsame, dlamch, dlansp, dlansy
142 * ..
143 * .. External Subroutines ..
144  EXTERNAL dlaset, dlavsp
145 * ..
146 * .. Intrinsic Functions ..
147  INTRINSIC dble
148 * ..
149 * .. Executable Statements ..
150 *
151 * Quick exit if N = 0.
152 *
153  IF( n.LE.0 ) THEN
154  resid = zero
155  RETURN
156  END IF
157 *
158 * Determine EPS and the norm of A.
159 *
160  eps = dlamch( 'Epsilon' )
161  anorm = dlansp( '1', uplo, n, a, rwork )
162 *
163 * Initialize C to the identity matrix.
164 *
165  CALL dlaset( 'Full', n, n, zero, one, c, ldc )
166 *
167 * Call DLAVSP to form the product D * U' (or D * L' ).
168 *
169  CALL dlavsp( uplo, 'Transpose', 'Non-unit', n, n, afac, ipiv, c,
170  \$ ldc, info )
171 *
172 * Call DLAVSP again to multiply by U ( or L ).
173 *
174  CALL dlavsp( uplo, 'No transpose', 'Unit', n, n, afac, ipiv, c,
175  \$ ldc, info )
176 *
177 * Compute the difference C - A .
178 *
179  IF( lsame( uplo, 'U' ) ) THEN
180  jc = 0
181  DO 20 j = 1, n
182  DO 10 i = 1, j
183  c( i, j ) = c( i, j ) - a( jc+i )
184  10 CONTINUE
185  jc = jc + j
186  20 CONTINUE
187  ELSE
188  jc = 1
189  DO 40 j = 1, n
190  DO 30 i = j, n
191  c( i, j ) = c( i, j ) - a( jc+i-j )
192  30 CONTINUE
193  jc = jc + n - j + 1
194  40 CONTINUE
195  END IF
196 *
197 * Compute norm( C - A ) / ( N * norm(A) * EPS )
198 *
199  resid = dlansy( '1', uplo, n, c, ldc, rwork )
200 *
201  IF( anorm.LE.zero ) THEN
202  IF( resid.NE.zero )
203  \$ resid = one / eps
204  ELSE
205  resid = ( ( resid / dble( n ) ) / anorm ) / eps
206  END IF
207 *
208  RETURN
209 *
210 * End of DSPT01
211 *
subroutine dlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: dlaset.f:112
double precision function dlansy(NORM, UPLO, N, A, LDA, WORK)
DLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric matrix.
Definition: dlansy.f:124
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine dlavsp(UPLO, TRANS, DIAG, N, NRHS, A, IPIV, B, LDB, INFO)
DLAVSP
Definition: dlavsp.f:132
double precision function dlansp(NORM, UPLO, N, AP, WORK)
DLANSP 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: dlansp.f:116
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: