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

◆ dsyt01_rook()

subroutine dsyt01_rook ( character  UPLO,
integer  N,
double precision, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( ldafac, * )  AFAC,
integer  LDAFAC,
integer, dimension( * )  IPIV,
double precision, dimension( ldc, * )  C,
integer  LDC,
double precision, dimension( * )  RWORK,
double precision  RESID 
)

DSYT01_ROOK

Purpose:
 DSYT01_ROOK reconstructs a symmetric indefinite 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 (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)
          The factored form of the matrix A.  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 DSYTRF_ROOK.
[in]LDAFAC
          LDAFAC is INTEGER
          The leading dimension of the array AFAC.  LDAFAC >= max(1,N).
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          The pivot indices from DSYTRF_ROOK.
[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 122 of file dsyt01_rook.f.

124*
125* -- LAPACK test routine --
126* -- LAPACK is a software package provided by Univ. of Tennessee, --
127* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
128*
129* .. Scalar Arguments ..
130 CHARACTER UPLO
131 INTEGER LDA, LDAFAC, LDC, N
132 DOUBLE PRECISION RESID
133* ..
134* .. Array Arguments ..
135 INTEGER IPIV( * )
136 DOUBLE PRECISION A( LDA, * ), AFAC( LDAFAC, * ), C( LDC, * ),
137 $ RWORK( * )
138* ..
139*
140* =====================================================================
141*
142* .. Parameters ..
143 DOUBLE PRECISION ZERO, ONE
144 parameter( zero = 0.0d+0, one = 1.0d+0 )
145* ..
146* .. Local Scalars ..
147 INTEGER I, INFO, J
148 DOUBLE PRECISION ANORM, EPS
149* ..
150* .. External Functions ..
151 LOGICAL LSAME
152 DOUBLE PRECISION DLAMCH, DLANSY
153 EXTERNAL lsame, dlamch, dlansy
154* ..
155* .. External Subroutines ..
156 EXTERNAL dlaset, dlavsy_rook
157* ..
158* .. Intrinsic Functions ..
159 INTRINSIC dble
160* ..
161* .. Executable Statements ..
162*
163* Quick exit if N = 0.
164*
165 IF( n.LE.0 ) THEN
166 resid = zero
167 RETURN
168 END IF
169*
170* Determine EPS and the norm of A.
171*
172 eps = dlamch( 'Epsilon' )
173 anorm = dlansy( '1', uplo, n, a, lda, rwork )
174*
175* Initialize C to the identity matrix.
176*
177 CALL dlaset( 'Full', n, n, zero, one, c, ldc )
178*
179* Call DLAVSY_ROOK to form the product D * U' (or D * L' ).
180*
181 CALL dlavsy_rook( uplo, 'Transpose', 'Non-unit', n, n, afac,
182 $ ldafac, ipiv, c, ldc, info )
183*
184* Call DLAVSY_ROOK again to multiply by U (or L ).
185*
186 CALL dlavsy_rook( uplo, 'No transpose', 'Unit', n, n, afac,
187 $ ldafac, ipiv, c, ldc, info )
188*
189* Compute the difference C - A .
190*
191 IF( lsame( uplo, 'U' ) ) THEN
192 DO 20 j = 1, n
193 DO 10 i = 1, j
194 c( i, j ) = c( i, j ) - a( i, j )
195 10 CONTINUE
196 20 CONTINUE
197 ELSE
198 DO 40 j = 1, n
199 DO 30 i = j, n
200 c( i, j ) = c( i, j ) - a( i, j )
201 30 CONTINUE
202 40 CONTINUE
203 END IF
204*
205* Compute norm( C - A ) / ( N * norm(A) * EPS )
206*
207 resid = dlansy( '1', uplo, n, c, ldc, rwork )
208*
209 IF( anorm.LE.zero ) THEN
210 IF( resid.NE.zero )
211 $ resid = one / eps
212 ELSE
213 resid = ( ( resid / dble( n ) ) / anorm ) / eps
214 END IF
215*
216 RETURN
217*
218* End of DSYT01_ROOK
219*
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:69
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:110
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine dlavsy_rook(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
DLAVSY_ROOK
Definition: dlavsy_rook.f:157
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,...
Definition: dlansy.f:122
Here is the call graph for this function:
Here is the caller graph for this function: