LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dpot03 ( character  UPLO,
integer  N,
double precision, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( ldainv, * )  AINV,
integer  LDAINV,
double precision, dimension( ldwork, * )  WORK,
integer  LDWORK,
double precision, dimension( * )  RWORK,
double precision  RCOND,
double precision  RESID 
)

DPOT03

Purpose:
 DPOT03 computes the residual for a symmetric matrix times its
 inverse:
    norm( I - A*AINV ) / ( N * norm(A) * norm(AINV) * EPS ),
 where 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,out]AINV
          AINV is DOUBLE PRECISION array, dimension (LDAINV,N)
          On entry, the inverse of the matrix A, stored as a symmetric
          matrix in the same format as A.
          In this version, AINV is expanded into a full matrix and
          multiplied by A, so the opposing triangle of AINV will be
          changed; i.e., if the upper triangular part of AINV is
          stored, the lower triangular part will be used as work space.
[in]LDAINV
          LDAINV is INTEGER
          The leading dimension of the array AINV.  LDAINV >= max(1,N).
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (LDWORK,N)
[in]LDWORK
          LDWORK is INTEGER
          The leading dimension of the array WORK.  LDWORK >= max(1,N).
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (N)
[out]RCOND
          RCOND is DOUBLE PRECISION
          The reciprocal of the condition number of A, computed as
          ( 1/norm(A) ) / norm(AINV).
[out]RESID
          RESID is DOUBLE PRECISION
          norm(I - A*AINV) / ( N * norm(A) * norm(AINV) * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 127 of file dpot03.f.

127 *
128 * -- LAPACK test routine (version 3.4.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 * November 2011
132 *
133 * .. Scalar Arguments ..
134  CHARACTER uplo
135  INTEGER lda, ldainv, ldwork, n
136  DOUBLE PRECISION rcond, resid
137 * ..
138 * .. Array Arguments ..
139  DOUBLE PRECISION a( lda, * ), ainv( ldainv, * ), rwork( * ),
140  $ work( ldwork, * )
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, j
151  DOUBLE PRECISION ainvnm, anorm, eps
152 * ..
153 * .. External Functions ..
154  LOGICAL lsame
155  DOUBLE PRECISION dlamch, dlange, dlansy
156  EXTERNAL lsame, dlamch, dlange, dlansy
157 * ..
158 * .. External Subroutines ..
159  EXTERNAL dsymm
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  rcond = one
170  resid = zero
171  RETURN
172  END IF
173 *
174 * Exit with RESID = 1/EPS if ANORM = 0 or AINVNM = 0.
175 *
176  eps = dlamch( 'Epsilon' )
177  anorm = dlansy( '1', uplo, n, a, lda, rwork )
178  ainvnm = dlansy( '1', uplo, n, ainv, ldainv, rwork )
179  IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
180  rcond = zero
181  resid = one / eps
182  RETURN
183  END IF
184  rcond = ( one / anorm ) / ainvnm
185 *
186 * Expand AINV into a full matrix and call DSYMM to multiply
187 * AINV on the left by A.
188 *
189  IF( lsame( uplo, 'U' ) ) THEN
190  DO 20 j = 1, n
191  DO 10 i = 1, j - 1
192  ainv( j, i ) = ainv( i, j )
193  10 CONTINUE
194  20 CONTINUE
195  ELSE
196  DO 40 j = 1, n
197  DO 30 i = j + 1, n
198  ainv( j, i ) = ainv( i, j )
199  30 CONTINUE
200  40 CONTINUE
201  END IF
202  CALL dsymm( 'Left', uplo, n, n, -one, a, lda, ainv, ldainv, zero,
203  $ work, ldwork )
204 *
205 * Add the identity matrix to WORK .
206 *
207  DO 50 i = 1, n
208  work( i, i ) = work( i, i ) + one
209  50 CONTINUE
210 *
211 * Compute norm(I - A*AINV) / (N * norm(A) * norm(AINV) * EPS)
212 *
213  resid = dlange( '1', n, n, work, ldwork, rwork )
214 *
215  resid = ( ( resid*rcond ) / eps ) / dble( n )
216 *
217  RETURN
218 *
219 * End of DPOT03
220 *
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 dsymm(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DSYMM
Definition: dsymm.f:191
double precision function dlange(NORM, M, N, A, LDA, WORK)
DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: dlange.f:116
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: