LAPACK  3.7.0
LAPACK: Linear Algebra PACKage
subroutine dsyt01_3 ( character  UPLO,
integer  N,
double precision, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( ldafac, * )  AFAC,
integer  LDAFAC,
double precision, dimension( * )  E,
integer, dimension( * )  IPIV,
double precision, dimension( ldc, * )  C,
integer  LDC,
double precision, dimension( * )  RWORK,
double precision  RESID 
)

DSYT01_3

Purpose:
 DSYT01_3 reconstructs a symmetric indefinite matrix A from its
 block L*D*L' or U*D*U' factorization computed by DSYTRF_RK
 (or DSYTRF_BK) 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 (LDA,N)
          The original symmetric matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N)
[in]AFAC
          AFAC is DOUBLE PRECISION array, dimension (LDAFAC,N)
          Diagonal of the block diagonal matrix D and factors U or L
          as computed by DSYTRF_RK and DSYTRF_BK:
            a) ONLY diagonal elements of the symmetric block diagonal
               matrix D on the diagonal of A, i.e. D(k,k) = A(k,k);
               (superdiagonal (or subdiagonal) elements of D
                should be provided on entry in array E), and
            b) If UPLO = 'U': factor U in the superdiagonal part of A.
               If UPLO = 'L': factor L in the subdiagonal part of A.
[in]LDAFAC
          LDAFAC is INTEGER
          The leading dimension of the array AFAC.
          LDAFAC >= max(1,N).
[in]E
          E is DOUBLE PRECISION array, dimension (N)
          On entry, contains the superdiagonal (or subdiagonal)
          elements of the symmetric block diagonal matrix D
          with 1-by-1 or 2-by-2 diagonal blocks, where
          If UPLO = 'U': E(i) = D(i-1,i),i=2:N, E(1) not refernced;
          If UPLO = 'L': E(i) = D(i+1,i),i=1:N-1, E(N) not referenced.
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          The pivot indices from DSYTRF_RK (or DSYTRF_BK).
[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 )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 142 of file dsyt01_3.f.

142 *
143 * -- LAPACK test routine (version 3.7.0) --
144 * -- LAPACK is a software package provided by Univ. of Tennessee, --
145 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
146 * December 2016
147 *
148 * .. Scalar Arguments ..
149  CHARACTER uplo
150  INTEGER lda, ldafac, ldc, n
151  DOUBLE PRECISION resid
152 * ..
153 * .. Array Arguments ..
154  INTEGER ipiv( * )
155  DOUBLE PRECISION a( lda, * ), afac( ldafac, * ), c( ldc, * ),
156  $ e( * ), rwork( * )
157 * ..
158 *
159 * =====================================================================
160 *
161 * .. Parameters ..
162  DOUBLE PRECISION zero, one
163  parameter ( zero = 0.0d+0, one = 1.0d+0 )
164 * ..
165 * .. Local Scalars ..
166  INTEGER i, info, j
167  DOUBLE PRECISION anorm, eps
168 * ..
169 * .. External Functions ..
170  LOGICAL lsame
171  DOUBLE PRECISION dlamch, dlansy
172  EXTERNAL lsame, dlamch, dlansy
173 * ..
174 * .. External Subroutines ..
175  EXTERNAL dlaset, dlavsy_rook, dsyconvf_rook
176 * ..
177 * .. Intrinsic Functions ..
178  INTRINSIC dble
179 * ..
180 * .. Executable Statements ..
181 *
182 * Quick exit if N = 0.
183 *
184  IF( n.LE.0 ) THEN
185  resid = zero
186  RETURN
187  END IF
188 *
189 * a) Revert to multiplyers of L
190 *
191  CALL dsyconvf_rook( uplo, 'R', n, afac, ldafac, e, ipiv, info )
192 *
193 * 1) Determine EPS and the norm of A.
194 *
195  eps = dlamch( 'Epsilon' )
196  anorm = dlansy( '1', uplo, n, a, lda, rwork )
197 *
198 * 2) Initialize C to the identity matrix.
199 *
200  CALL dlaset( 'Full', n, n, zero, one, c, ldc )
201 *
202 * 3) Call DLAVSY_ROOK to form the product D * U' (or D * L' ).
203 *
204  CALL dlavsy_rook( uplo, 'Transpose', 'Non-unit', n, n, afac,
205  $ ldafac, ipiv, c, ldc, info )
206 *
207 * 4) Call DLAVSY_ROOK again to multiply by U (or L ).
208 *
209  CALL dlavsy_rook( uplo, 'No transpose', 'Unit', n, n, afac,
210  $ ldafac, ipiv, c, ldc, info )
211 *
212 * 5) Compute the difference C - A.
213 *
214  IF( lsame( uplo, 'U' ) ) THEN
215  DO j = 1, n
216  DO i = 1, j
217  c( i, j ) = c( i, j ) - a( i, j )
218  END DO
219  END DO
220  ELSE
221  DO j = 1, n
222  DO i = j, n
223  c( i, j ) = c( i, j ) - a( i, j )
224  END DO
225  END DO
226  END IF
227 *
228 * 6) Compute norm( C - A ) / ( N * norm(A) * EPS )
229 *
230  resid = dlansy( '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 *
240 * b) Convert to factor of L (or U)
241 *
242  CALL dsyconvf_rook( uplo, 'C', n, afac, ldafac, e, ipiv, info )
243 *
244  RETURN
245 *
246 * End of DSYT01_3
247 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
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
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
subroutine dsyconvf_rook(UPLO, WAY, N, A, LDA, E, IPIV, INFO)
DSYCONVF_ROOK
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine dlavsy_rook(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
DLAVSY_ROOK
Definition: dlavsy_rook.f:159

Here is the call graph for this function:

Here is the caller graph for this function: