LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zptt01()

subroutine zptt01 ( integer  n,
double precision, dimension( * )  d,
complex*16, dimension( * )  e,
double precision, dimension( * )  df,
complex*16, dimension( * )  ef,
complex*16, dimension( * )  work,
double precision  resid 
)

ZPTT01

Purpose:
 ZPTT01 reconstructs a tridiagonal matrix A from its L*D*L'
 factorization and computes the residual
    norm(L*D*L' - A) / ( n * norm(A) * EPS ),
 where EPS is the machine epsilon.
Parameters
[in]N
          N is INTEGER
          The order of the matrix A.
[in]D
          D is DOUBLE PRECISION array, dimension (N)
          The n diagonal elements of the tridiagonal matrix A.
[in]E
          E is COMPLEX*16 array, dimension (N-1)
          The (n-1) subdiagonal elements of the tridiagonal matrix A.
[in]DF
          DF is DOUBLE PRECISION array, dimension (N)
          The n diagonal elements of the factor L from the L*D*L'
          factorization of A.
[in]EF
          EF is COMPLEX*16 array, dimension (N-1)
          The (n-1) subdiagonal elements of the factor L from the
          L*D*L' factorization of A.
[out]WORK
          WORK is COMPLEX*16 array, dimension (2*N)
[out]RESID
          RESID is DOUBLE PRECISION
          norm(L*D*L' - A) / (n * norm(A) * EPS)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 91 of file zptt01.f.

92*
93* -- LAPACK test routine --
94* -- LAPACK is a software package provided by Univ. of Tennessee, --
95* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
96*
97* .. Scalar Arguments ..
98 INTEGER N
99 DOUBLE PRECISION RESID
100* ..
101* .. Array Arguments ..
102 DOUBLE PRECISION D( * ), DF( * )
103 COMPLEX*16 E( * ), EF( * ), WORK( * )
104* ..
105*
106* =====================================================================
107*
108* .. Parameters ..
109 DOUBLE PRECISION ONE, ZERO
110 parameter( one = 1.0d+0, zero = 0.0d+0 )
111* ..
112* .. Local Scalars ..
113 INTEGER I
114 DOUBLE PRECISION ANORM, EPS
115 COMPLEX*16 DE
116* ..
117* .. External Functions ..
118 DOUBLE PRECISION DLAMCH
119 EXTERNAL dlamch
120* ..
121* .. Intrinsic Functions ..
122 INTRINSIC abs, dble, dconjg, max
123* ..
124* .. Executable Statements ..
125*
126* Quick return if possible
127*
128 IF( n.LE.0 ) THEN
129 resid = zero
130 RETURN
131 END IF
132*
133 eps = dlamch( 'Epsilon' )
134*
135* Construct the difference L*D*L' - A.
136*
137 work( 1 ) = df( 1 ) - d( 1 )
138 DO 10 i = 1, n - 1
139 de = df( i )*ef( i )
140 work( n+i ) = de - e( i )
141 work( 1+i ) = de*dconjg( ef( i ) ) + df( i+1 ) - d( i+1 )
142 10 CONTINUE
143*
144* Compute the 1-norms of the tridiagonal matrices A and WORK.
145*
146 IF( n.EQ.1 ) THEN
147 anorm = d( 1 )
148 resid = abs( work( 1 ) )
149 ELSE
150 anorm = max( d( 1 )+abs( e( 1 ) ), d( n )+abs( e( n-1 ) ) )
151 resid = max( abs( work( 1 ) )+abs( work( n+1 ) ),
152 $ abs( work( n ) )+abs( work( 2*n-1 ) ) )
153 DO 20 i = 2, n - 1
154 anorm = max( anorm, d( i )+abs( e( i ) )+abs( e( i-1 ) ) )
155 resid = max( resid, abs( work( i ) )+abs( work( n+i-1 ) )+
156 $ abs( work( n+i ) ) )
157 20 CONTINUE
158 END IF
159*
160* Compute norm(L*D*L' - A) / (n * norm(A) * EPS)
161*
162 IF( anorm.LE.zero ) THEN
163 IF( resid.NE.zero )
164 $ resid = one / eps
165 ELSE
166 resid = ( ( resid / dble( n ) ) / anorm ) / eps
167 END IF
168*
169 RETURN
170*
171* End of ZPTT01
172*
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
Here is the caller graph for this function: