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

DPPT02

Purpose:
 DPPT02 computes the residual in the solution of a symmetric system
 of linear equations  A*x = b  when packed storage is used for the
 coefficient matrix.  The ratio computed is

    RESID = norm(B - A*X) / ( norm(A) * norm(X) * EPS),

 where EPS is the machine precision.
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 (N*(N+1)/2)
          The original symmetric matrix A, stored as a packed
          triangular matrix.
[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 124 of file dppt02.f.

124 *
125 * -- LAPACK test routine (version 3.4.0) --
126 * -- LAPACK is a software package provided by Univ. of Tennessee, --
127 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
128 * November 2011
129 *
130 * .. Scalar Arguments ..
131  CHARACTER uplo
132  INTEGER ldb, ldx, n, nrhs
133  DOUBLE PRECISION resid
134 * ..
135 * .. Array Arguments ..
136  DOUBLE PRECISION a( * ), b( ldb, * ), rwork( * ), x( ldx, * )
137 * ..
138 *
139 * =====================================================================
140 *
141 * .. Parameters ..
142  DOUBLE PRECISION zero, one
143  parameter ( zero = 0.0d+0, one = 1.0d+0 )
144 * ..
145 * .. Local Scalars ..
146  INTEGER j
147  DOUBLE PRECISION anorm, bnorm, eps, xnorm
148 * ..
149 * .. External Functions ..
150  DOUBLE PRECISION dasum, dlamch, dlansp
151  EXTERNAL dasum, dlamch, dlansp
152 * ..
153 * .. External Subroutines ..
154  EXTERNAL dspmv
155 * ..
156 * .. Intrinsic Functions ..
157  INTRINSIC max
158 * ..
159 * .. Executable Statements ..
160 *
161 * Quick exit if N = 0 or NRHS = 0.
162 *
163  IF( n.LE.0 .OR. nrhs.LE.0 ) THEN
164  resid = zero
165  RETURN
166  END IF
167 *
168 * Exit with RESID = 1/EPS if ANORM = 0.
169 *
170  eps = dlamch( 'Epsilon' )
171  anorm = dlansp( '1', uplo, n, a, rwork )
172  IF( anorm.LE.zero ) THEN
173  resid = one / eps
174  RETURN
175  END IF
176 *
177 * Compute B - A*X for the matrix of right hand sides B.
178 *
179  DO 10 j = 1, nrhs
180  CALL dspmv( uplo, n, -one, a, x( 1, j ), 1, one, b( 1, j ), 1 )
181  10 CONTINUE
182 *
183 * Compute the maximum over the number of right hand sides of
184 * norm( B - A*X ) / ( norm(A) * norm(X) * EPS ) .
185 *
186  resid = zero
187  DO 20 j = 1, nrhs
188  bnorm = dasum( n, b( 1, j ), 1 )
189  xnorm = dasum( n, x( 1, j ), 1 )
190  IF( xnorm.LE.zero ) THEN
191  resid = one / eps
192  ELSE
193  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
194  END IF
195  20 CONTINUE
196 *
197  RETURN
198 *
199 * End of DPPT02
200 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine dspmv(UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY)
DSPMV
Definition: dspmv.f:149
double precision function dasum(N, DX, INCX)
DASUM
Definition: dasum.f:53
double precision function dlansp(NORM, UPLO, N, AP, WORK)
DLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric matrix supplied in packed form.
Definition: dlansp.f:116

Here is the call graph for this function:

Here is the caller graph for this function: