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

SSYT01_AA

Purpose:
 SSYT01_AA 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 REAL 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 REAL 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 SSYTRF.
[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 SSYTRF.
[out]C
          C is REAL array, dimension (LDC,N)
[in]LDC
          LDC is INTEGER
          The leading dimension of the array C.  LDC >= max(1,N).
[out]RWORK
          RWORK is REAL array, dimension (N)
[out]RESID
          RESID is REAL
          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 127 of file ssyt01_aa.f.

127 *
128 * -- LAPACK test routine (version 3.7.0) --
129 * -- LAPACK is a software package provided by Univ. of Tennessee, --
130 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
131 * December 2016
132 *
133 * .. Scalar Arguments ..
134  CHARACTER uplo
135  INTEGER lda, ldafac, ldc, n
136  REAL resid
137 * ..
138 * .. Array Arguments ..
139  INTEGER ipiv( * )
140  REAL a( lda, * ), afac( ldafac, * ), c( ldc, * ),
141  $ rwork( * )
142 * ..
143 *
144 * =====================================================================
145 *
146 * .. Parameters ..
147  REAL zero, one
148  parameter ( zero = 0.0e+0, one = 1.0e+0 )
149 * ..
150 * .. Local Scalars ..
151  INTEGER i, j
152  REAL anorm, eps
153 * ..
154 * .. External Functions ..
155  LOGICAL lsame
156  REAL slamch, slansy
157  EXTERNAL lsame, slamch, slansy
158 * ..
159 * .. External Subroutines ..
160  EXTERNAL slaset, slavsy
161 * ..
162 * .. Intrinsic Functions ..
163  INTRINSIC dble
164 * ..
165 * .. Executable Statements ..
166 *
167 * Quick exit if N = 0.
168 *
169  IF( n.LE.0 ) THEN
170  resid = zero
171  RETURN
172  END IF
173 *
174 * Determine EPS and the norm of A.
175 *
176  eps = slamch( 'Epsilon' )
177  anorm = slansy( '1', uplo, n, a, lda, rwork )
178 *
179 * Initialize C to the tridiagonal matrix T.
180 *
181  CALL slaset( 'Full', n, n, zero, zero, c, ldc )
182  CALL slacpy( 'F', 1, n, afac( 1, 1 ), ldafac+1, c( 1, 1 ), ldc+1 )
183  IF( n.GT.1 ) THEN
184  IF( lsame( uplo, 'U' ) ) THEN
185  CALL slacpy( 'F', 1, n-1, afac( 1, 2 ), ldafac+1, c( 1, 2 ),
186  $ ldc+1 )
187  CALL slacpy( 'F', 1, n-1, afac( 1, 2 ), ldafac+1, c( 2, 1 ),
188  $ ldc+1 )
189  ELSE
190  CALL slacpy( 'F', 1, n-1, afac( 2, 1 ), ldafac+1, c( 1, 2 ),
191  $ ldc+1 )
192  CALL slacpy( 'F', 1, n-1, afac( 2, 1 ), ldafac+1, c( 2, 1 ),
193  $ ldc+1 )
194  ENDIF
195 *
196 * Call STRMM to form the product U' * D (or L * D ).
197 *
198  IF( lsame( uplo, 'U' ) ) THEN
199  CALL strmm( 'Left', uplo, 'Transpose', 'Unit', n-1, n,
200  $ one, afac( 1, 2 ), ldafac, c( 2, 1 ), ldc )
201  ELSE
202  CALL strmm( 'Left', uplo, 'No transpose', 'Unit', n-1, n,
203  $ one, afac( 2, 1 ), ldafac, c( 2, 1 ), ldc )
204  END IF
205 *
206 * Call STRMM again to multiply by U (or L ).
207 *
208  IF( lsame( uplo, 'U' ) ) THEN
209  CALL strmm( 'Right', uplo, 'No transpose', 'Unit', n, n-1,
210  $ one, afac( 1, 2 ), ldafac, c( 1, 2 ), ldc )
211  ELSE
212  CALL strmm( 'Right', uplo, 'Transpose', 'Unit', n, n-1,
213  $ one, afac( 2, 1 ), ldafac, c( 1, 2 ), ldc )
214  END IF
215  ENDIF
216 *
217 * Apply symmetric pivots
218 *
219  DO j = n, 1, -1
220  i = ipiv( j )
221  IF( i.NE.j )
222  $ CALL sswap( n, c( j, 1 ), ldc, c( i, 1 ), ldc )
223  END DO
224  DO j = n, 1, -1
225  i = ipiv( j )
226  IF( i.NE.j )
227  $ CALL sswap( n, c( 1, j ), 1, c( 1, i ), 1 )
228  END DO
229 *
230 *
231 * Compute the difference C - A .
232 *
233  IF( lsame( uplo, 'U' ) ) THEN
234  DO j = 1, n
235  DO i = 1, j
236  c( i, j ) = c( i, j ) - a( i, j )
237  END DO
238  END DO
239  ELSE
240  DO j = 1, n
241  DO i = j, n
242  c( i, j ) = c( i, j ) - a( i, j )
243  END DO
244  END DO
245  END IF
246 *
247 * Compute norm( C - A ) / ( N * norm(A) * EPS )
248 *
249  resid = slansy( '1', uplo, n, c, ldc, rwork )
250 *
251  IF( anorm.LE.zero ) THEN
252  IF( resid.NE.zero )
253  $ resid = one / eps
254  ELSE
255  resid = ( ( resid / dble( n ) ) / anorm ) / eps
256  END IF
257 *
258  RETURN
259 *
260 * End of SSYT01_AA
261 *
subroutine slavsy(UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
SLAVSY
Definition: slavsy.f:157
subroutine strmm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
STRMM
Definition: strmm.f:179
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 sswap(N, SX, INCX, SY, INCY)
SSWAP
Definition: sswap.f:53
subroutine slacpy(UPLO, M, N, A, LDA, B, LDB)
SLACPY copies all or part of one two-dimensional array to another.
Definition: slacpy.f:105
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: