LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
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 INTEGTER
          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.
Date
November 2011

Definition at line 94 of file zptt01.f.

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

Here is the caller graph for this function: