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

SPPT02

Purpose:
``` SPPT02 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 REAL array, dimension (N*(N+1)/2) The original symmetric matrix A, stored as a packed triangular matrix.``` [in] X ``` X is REAL 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 REAL 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 REAL array, dimension (N)` [out] RESID ``` RESID is REAL The maximum over the number of right hand sides of norm(B - A*X) / ( norm(A) * norm(X) * EPS ).```
Date
November 2011

Definition at line 124 of file sppt02.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  REAL resid
134 * ..
135 * .. Array Arguments ..
136  REAL a( * ), b( ldb, * ), rwork( * ), x( ldx, * )
137 * ..
138 *
139 * =====================================================================
140 *
141 * .. Parameters ..
142  REAL zero, one
143  parameter ( zero = 0.0e+0, one = 1.0e+0 )
144 * ..
145 * .. Local Scalars ..
146  INTEGER j
147  REAL anorm, bnorm, eps, xnorm
148 * ..
149 * .. External Functions ..
150  REAL sasum, slamch, slansp
151  EXTERNAL sasum, slamch, slansp
152 * ..
153 * .. External Subroutines ..
154  EXTERNAL sspmv
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 = slamch( 'Epsilon' )
171  anorm = slansp( '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 sspmv( 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 = sasum( n, b( 1, j ), 1 )
189  xnorm = sasum( 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 SPPT02
200 *
subroutine sspmv(UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY)
SSPMV
Definition: sspmv.f:149
real function sasum(N, SX, INCX)
SASUM
Definition: sasum.f:54
real function slansp(NORM, UPLO, N, AP, WORK)
SLANSP 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: slansp.f:116
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69

Here is the call graph for this function:

Here is the caller graph for this function: