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

SSYT01_3

Purpose:
 SSYT01_3 reconstructs a symmetric indefinite matrix A from its
 block L*D*L' or U*D*U' factorization computed by SSYTRF_RK
 (or SSYTRF_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 SSYTRF_RK and SSYTRF_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 SSYTRF_RK (or SSYTRF_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 ssyt01_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  REAL resid
152 * ..
153 * .. Array Arguments ..
154  INTEGER ipiv( * )
155  REAL a( lda, * ), afac( ldafac, * ), c( ldc, * ),
156  $ e( * ), rwork( * )
157 * ..
158 *
159 * =====================================================================
160 *
161 * .. Parameters ..
162  REAL zero, one
163  parameter ( zero = 0.0e+0, one = 1.0e+0 )
164 * ..
165 * .. Local Scalars ..
166  INTEGER i, info, j
167  REAL anorm, eps
168 * ..
169 * .. External Functions ..
170  LOGICAL lsame
171  REAL slamch, slansy
172  EXTERNAL lsame, slamch, slansy
173 * ..
174 * .. External Subroutines ..
175  EXTERNAL slaset, slavsy_rook, ssyconvf_rook
176 * ..
177 * .. Intrinsic Functions ..
178  INTRINSIC real
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 ssyconvf_rook( uplo, 'R', n, afac, ldafac, e, ipiv, info )
192 *
193 * 1) Determine EPS and the norm of A.
194 *
195  eps = slamch( 'Epsilon' )
196  anorm = slansy( '1', uplo, n, a, lda, rwork )
197 *
198 * 2) Initialize C to the identity matrix.
199 *
200  CALL slaset( 'Full', n, n, zero, one, c, ldc )
201 *
202 * 3) Call SLAVSY_ROOK to form the product D * U' (or D * L' ).
203 *
204  CALL slavsy_rook( uplo, 'Transpose', 'Non-unit', n, n, afac,
205  $ ldafac, ipiv, c, ldc, info )
206 *
207 * 4) Call SLAVSY_ROOK again to multiply by U (or L ).
208 *
209  CALL slavsy_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 = slansy( '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 / REAL( N ) ) / anorm ) / eps
237  END IF
238 
239 *
240 * b) Convert to factor of L (or U)
241 *
242  CALL ssyconvf_rook( uplo, 'C', n, afac, ldafac, e, ipiv, info )
243 *
244  RETURN
245 *
246 * End of SSYT01_3
247 *
subroutine ssyconvf_rook(UPLO, WAY, N, A, LDA, E, IPIV, INFO)
SSYCONVF_ROOK
subroutine slaset(UPLO, M, N, ALPHA, BETA, A, LDA)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: slaset.f:112
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine slavsy_rook(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
SLAVSY_ROOK
Definition: slavsy_rook.f:159
real function slansy(NORM, UPLO, N, A, LDA, WORK)
SLANSY 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: slansy.f:124

Here is the call graph for this function:

Here is the caller graph for this function: