LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ ssyt01_3()

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 referenced;
          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.

Definition at line 138 of file ssyt01_3.f.

140*
141* -- LAPACK test routine --
142* -- LAPACK is a software package provided by Univ. of Tennessee, --
143* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
144*
145* .. Scalar Arguments ..
146 CHARACTER UPLO
147 INTEGER LDA, LDAFAC, LDC, N
148 REAL RESID
149* ..
150* .. Array Arguments ..
151 INTEGER IPIV( * )
152 REAL A( LDA, * ), AFAC( LDAFAC, * ), C( LDC, * ),
153 $ E( * ), RWORK( * )
154* ..
155*
156* =====================================================================
157*
158* .. Parameters ..
159 REAL ZERO, ONE
160 parameter( zero = 0.0e+0, one = 1.0e+0 )
161* ..
162* .. Local Scalars ..
163 INTEGER I, INFO, J
164 REAL ANORM, EPS
165* ..
166* .. External Functions ..
167 LOGICAL LSAME
168 REAL SLAMCH, SLANSY
169 EXTERNAL lsame, slamch, slansy
170* ..
171* .. External Subroutines ..
173* ..
174* .. Intrinsic Functions ..
175 INTRINSIC real
176* ..
177* .. Executable Statements ..
178*
179* Quick exit if N = 0.
180*
181 IF( n.LE.0 ) THEN
182 resid = zero
183 RETURN
184 END IF
185*
186* a) Revert to multipliers of L
187*
188 CALL ssyconvf_rook( uplo, 'R', n, afac, ldafac, e, ipiv, info )
189*
190* 1) Determine EPS and the norm of A.
191*
192 eps = slamch( 'Epsilon' )
193 anorm = slansy( '1', uplo, n, a, lda, rwork )
194*
195* 2) Initialize C to the identity matrix.
196*
197 CALL slaset( 'Full', n, n, zero, one, c, ldc )
198*
199* 3) Call SLAVSY_ROOK to form the product D * U' (or D * L' ).
200*
201 CALL slavsy_rook( uplo, 'Transpose', 'Non-unit', n, n, afac,
202 $ ldafac, ipiv, c, ldc, info )
203*
204* 4) Call SLAVSY_ROOK again to multiply by U (or L ).
205*
206 CALL slavsy_rook( uplo, 'No transpose', 'Unit', n, n, afac,
207 $ ldafac, ipiv, c, ldc, info )
208*
209* 5) Compute the difference C - A.
210*
211 IF( lsame( uplo, 'U' ) ) THEN
212 DO j = 1, n
213 DO i = 1, j
214 c( i, j ) = c( i, j ) - a( i, j )
215 END DO
216 END DO
217 ELSE
218 DO j = 1, n
219 DO i = j, n
220 c( i, j ) = c( i, j ) - a( i, j )
221 END DO
222 END DO
223 END IF
224*
225* 6) Compute norm( C - A ) / ( N * norm(A) * EPS )
226*
227 resid = slansy( '1', uplo, n, c, ldc, rwork )
228*
229 IF( anorm.LE.zero ) THEN
230 IF( resid.NE.zero )
231 $ resid = one / eps
232 ELSE
233 resid = ( ( resid / real( n ) ) / anorm ) / eps
234 END IF
235
236*
237* b) Convert to factor of L (or U)
238*
239 CALL ssyconvf_rook( uplo, 'C', n, afac, ldafac, e, ipiv, info )
240*
241 RETURN
242*
243* End of SSYT01_3
244*
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
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,...
Definition slansy.f:122
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:110
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine ssyconvf_rook(uplo, way, n, a, lda, e, ipiv, info)
SSYCONVF_ROOK
subroutine slavsy_rook(uplo, trans, diag, n, nrhs, a, lda, ipiv, b, ldb, info)
SLAVSY_ROOK
Here is the call graph for this function:
Here is the caller graph for this function: