LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dptt02()

subroutine dptt02 ( integer  N,
integer  NRHS,
double precision, dimension( * )  D,
double precision, dimension( * )  E,
double precision, dimension( ldx, * )  X,
integer  LDX,
double precision, dimension( ldb, * )  B,
integer  LDB,
double precision  RESID 
)

DPTT02

Purpose:
 DPTT02 computes the residual for the solution to a symmetric
 tridiagonal system of equations:
    RESID = norm(B - A*X) / (norm(A) * norm(X) * EPS),
 where EPS is the machine epsilon.
Parameters
[in]N
          N is INTEGTER
          The order of the matrix A.
[in]NRHS
          NRHS is INTEGER
          The number of right hand sides, i.e., the number of columns
          of the matrices B and X.  NRHS >= 0.
[in]D
          D is DOUBLE PRECISION array, dimension (N)
          The n diagonal elements of the tridiagonal matrix A.
[in]E
          E is DOUBLE PRECISION array, dimension (N-1)
          The (n-1) subdiagonal elements of the tridiagonal matrix A.
[in]X
          X is DOUBLE PRECISION array, dimension (LDX,NRHS)
          The n by nrhs matrix of solution vectors X.
[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 n by nrhs matrix of right hand side vectors B.
          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]RESID
          RESID is DOUBLE PRECISION
          norm(B - A*X) / (norm(A) * norm(X) * EPS)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 106 of file dptt02.f.

106 *
107 * -- LAPACK test routine (version 3.7.0) --
108 * -- LAPACK is a software package provided by Univ. of Tennessee, --
109 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
110 * December 2016
111 *
112 * .. Scalar Arguments ..
113  INTEGER ldb, ldx, n, nrhs
114  DOUBLE PRECISION resid
115 * ..
116 * .. Array Arguments ..
117  DOUBLE PRECISION b( ldb, * ), d( * ), e( * ), x( ldx, * )
118 * ..
119 *
120 * =====================================================================
121 *
122 * .. Parameters ..
123  DOUBLE PRECISION one, zero
124  parameter( one = 1.0d+0, zero = 0.0d+0 )
125 * ..
126 * .. Local Scalars ..
127  INTEGER j
128  DOUBLE PRECISION anorm, bnorm, eps, xnorm
129 * ..
130 * .. External Functions ..
131  DOUBLE PRECISION dasum, dlamch, dlanst
132  EXTERNAL dasum, dlamch, dlanst
133 * ..
134 * .. Intrinsic Functions ..
135  INTRINSIC max
136 * ..
137 * .. External Subroutines ..
138  EXTERNAL dlaptm
139 * ..
140 * .. Executable Statements ..
141 *
142 * Quick return if possible
143 *
144  IF( n.LE.0 ) THEN
145  resid = zero
146  RETURN
147  END IF
148 *
149 * Compute the 1-norm of the tridiagonal matrix A.
150 *
151  anorm = dlanst( '1', n, d, e )
152 *
153 * Exit with RESID = 1/EPS if ANORM = 0.
154 *
155  eps = dlamch( 'Epsilon' )
156  IF( anorm.LE.zero ) THEN
157  resid = one / eps
158  RETURN
159  END IF
160 *
161 * Compute B - A*X.
162 *
163  CALL dlaptm( n, nrhs, -one, d, e, x, ldx, one, b, ldb )
164 *
165 * Compute the maximum over the number of right hand sides of
166 * norm(B - A*X) / ( norm(A) * norm(X) * EPS ).
167 *
168  resid = zero
169  DO 10 j = 1, nrhs
170  bnorm = dasum( n, b( 1, j ), 1 )
171  xnorm = dasum( n, x( 1, j ), 1 )
172  IF( xnorm.LE.zero ) THEN
173  resid = one / eps
174  ELSE
175  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
176  END IF
177  10 CONTINUE
178 *
179  RETURN
180 *
181 * End of DPTT02
182 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine dlaptm(N, NRHS, ALPHA, D, E, X, LDX, BETA, B, LDB)
DLAPTM
Definition: dlaptm.f:118
double precision function dasum(N, DX, INCX)
DASUM
Definition: dasum.f:73
double precision function dlanst(NORM, N, D, E)
DLANST 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 tridiagonal matrix.
Definition: dlanst.f:102
Here is the call graph for this function:
Here is the caller graph for this function: