LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dpot02 ( character  UPLO,
integer  N,
integer  NRHS,
double precision, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( ldx, * )  X,
integer  LDX,
double precision, dimension( ldb, * )  B,
integer  LDB,
double precision, dimension( * )  RWORK,
double precision  RESID 
)

DPOT02

Purpose:
 DPOT02 computes the residual for the solution of a symmetric system
 of linear equations  A*x = b:

    RESID = norm(B - A*X) / ( norm(A) * norm(X) * 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]NRHS
          NRHS is INTEGER
          The number of columns of B, the matrix of right hand sides.
          NRHS >= 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]X
          X is DOUBLE PRECISION array, dimension (LDX,NRHS)
          The computed solution vectors for the system of linear
          equations.
[in]LDX
          LDX is INTEGER
          The leading dimension of the array X.   LDX >= max(1,N).
[in,out]B
          B is DOUBLE PRECISION array, dimension (LDB,NRHS)
          On entry, the right hand side vectors for the system of
          linear equations.
          On exit, B is overwritten with the difference B - A*X.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (N)
[out]RESID
          RESID is DOUBLE PRECISION
          The maximum over the number of right hand sides of
          norm(B - A*X) / ( norm(A) * norm(X) * EPS ).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 129 of file dpot02.f.

129 *
130 * -- LAPACK test routine (version 3.4.0) --
131 * -- LAPACK is a software package provided by Univ. of Tennessee, --
132 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
133 * November 2011
134 *
135 * .. Scalar Arguments ..
136  CHARACTER uplo
137  INTEGER lda, ldb, ldx, n, nrhs
138  DOUBLE PRECISION resid
139 * ..
140 * .. Array Arguments ..
141  DOUBLE PRECISION a( lda, * ), b( ldb, * ), rwork( * ),
142  $ x( ldx, * )
143 * ..
144 *
145 * =====================================================================
146 *
147 * .. Parameters ..
148  DOUBLE PRECISION zero, one
149  parameter ( zero = 0.0d+0, one = 1.0d+0 )
150 * ..
151 * .. Local Scalars ..
152  INTEGER j
153  DOUBLE PRECISION anorm, bnorm, eps, xnorm
154 * ..
155 * .. External Functions ..
156  DOUBLE PRECISION dasum, dlamch, dlansy
157  EXTERNAL dasum, dlamch, dlansy
158 * ..
159 * .. External Subroutines ..
160  EXTERNAL dsymm
161 * ..
162 * .. Intrinsic Functions ..
163  INTRINSIC max
164 * ..
165 * .. Executable Statements ..
166 *
167 * Quick exit if N = 0 or NRHS = 0.
168 *
169  IF( n.LE.0 .OR. nrhs.LE.0 ) THEN
170  resid = zero
171  RETURN
172  END IF
173 *
174 * Exit with RESID = 1/EPS if ANORM = 0.
175 *
176  eps = dlamch( 'Epsilon' )
177  anorm = dlansy( '1', uplo, n, a, lda, rwork )
178  IF( anorm.LE.zero ) THEN
179  resid = one / eps
180  RETURN
181  END IF
182 *
183 * Compute B - A*X
184 *
185  CALL dsymm( 'Left', uplo, n, nrhs, -one, a, lda, x, ldx, one, b,
186  $ ldb )
187 *
188 * Compute the maximum over the number of right hand sides of
189 * norm( B - A*X ) / ( norm(A) * norm(X) * EPS ) .
190 *
191  resid = zero
192  DO 10 j = 1, nrhs
193  bnorm = dasum( n, b( 1, j ), 1 )
194  xnorm = dasum( n, x( 1, j ), 1 )
195  IF( xnorm.LE.zero ) THEN
196  resid = one / eps
197  ELSE
198  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
199  END IF
200  10 CONTINUE
201 *
202  RETURN
203 *
204 * End of DPOT02
205 *
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 dasum(N, DX, INCX)
DASUM
Definition: dasum.f:53

Here is the call graph for this function:

Here is the caller graph for this function: