LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
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.
Date
November 2013

Definition at line 126 of file dsyt01_rook.f.

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