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

◆ dppt03()

subroutine dppt03 ( character  uplo,
integer  n,
double precision, dimension( * )  a,
double precision, dimension( * )  ainv,
double precision, dimension( ldwork, * )  work,
integer  ldwork,
double precision, dimension( * )  rwork,
double precision  rcond,
double precision  resid 
)

DPPT03

Purpose:
 DPPT03 computes the residual for a symmetric packed matrix times its
 inverse:
    norm( I - A*AINV ) / ( N * norm(A) * norm(AINV) * EPS ),
 where EPS is the machine epsilon.
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]A
          A is DOUBLE PRECISION array, dimension (N*(N+1)/2)
          The original symmetric matrix A, stored as a packed
          triangular matrix.
[in]AINV
          AINV is DOUBLE PRECISION array, dimension (N*(N+1)/2)
          The (symmetric) inverse of the matrix A, stored as a packed
          triangular matrix.
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (LDWORK,N)
[in]LDWORK
          LDWORK is INTEGER
          The leading dimension of the array WORK.  LDWORK >= max(1,N).
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (N)
[out]RCOND
          RCOND is DOUBLE PRECISION
          The reciprocal of the condition number of A, computed as
          ( 1/norm(A) ) / norm(AINV).
[out]RESID
          RESID is DOUBLE PRECISION
          norm(I - A*AINV) / ( N * norm(A) * norm(AINV) * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 108 of file dppt03.f.

110*
111* -- LAPACK test routine --
112* -- LAPACK is a software package provided by Univ. of Tennessee, --
113* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
114*
115* .. Scalar Arguments ..
116 CHARACTER UPLO
117 INTEGER LDWORK, N
118 DOUBLE PRECISION RCOND, RESID
119* ..
120* .. Array Arguments ..
121 DOUBLE PRECISION A( * ), AINV( * ), RWORK( * ),
122 $ WORK( LDWORK, * )
123* ..
124*
125* =====================================================================
126*
127* .. Parameters ..
128 DOUBLE PRECISION ZERO, ONE
129 parameter( zero = 0.0d+0, one = 1.0d+0 )
130* ..
131* .. Local Scalars ..
132 INTEGER I, J, JJ
133 DOUBLE PRECISION AINVNM, ANORM, EPS
134* ..
135* .. External Functions ..
136 LOGICAL LSAME
137 DOUBLE PRECISION DLAMCH, DLANGE, DLANSP
138 EXTERNAL lsame, dlamch, dlange, dlansp
139* ..
140* .. Intrinsic Functions ..
141 INTRINSIC dble
142* ..
143* .. External Subroutines ..
144 EXTERNAL dcopy, dspmv
145* ..
146* .. Executable Statements ..
147*
148* Quick exit if N = 0.
149*
150 IF( n.LE.0 ) THEN
151 rcond = one
152 resid = zero
153 RETURN
154 END IF
155*
156* Exit with RESID = 1/EPS if ANORM = 0 or AINVNM = 0.
157*
158 eps = dlamch( 'Epsilon' )
159 anorm = dlansp( '1', uplo, n, a, rwork )
160 ainvnm = dlansp( '1', uplo, n, ainv, rwork )
161 IF( anorm.LE.zero .OR. ainvnm.EQ.zero ) THEN
162 rcond = zero
163 resid = one / eps
164 RETURN
165 END IF
166 rcond = ( one / anorm ) / ainvnm
167*
168* UPLO = 'U':
169* Copy the leading N-1 x N-1 submatrix of AINV to WORK(1:N,2:N) and
170* expand it to a full matrix, then multiply by A one column at a
171* time, moving the result one column to the left.
172*
173 IF( lsame( uplo, 'U' ) ) THEN
174*
175* Copy AINV
176*
177 jj = 1
178 DO 10 j = 1, n - 1
179 CALL dcopy( j, ainv( jj ), 1, work( 1, j+1 ), 1 )
180 CALL dcopy( j-1, ainv( jj ), 1, work( j, 2 ), ldwork )
181 jj = jj + j
182 10 CONTINUE
183 jj = ( ( n-1 )*n ) / 2 + 1
184 CALL dcopy( n-1, ainv( jj ), 1, work( n, 2 ), ldwork )
185*
186* Multiply by A
187*
188 DO 20 j = 1, n - 1
189 CALL dspmv( 'Upper', n, -one, a, work( 1, j+1 ), 1, zero,
190 $ work( 1, j ), 1 )
191 20 CONTINUE
192 CALL dspmv( 'Upper', n, -one, a, ainv( jj ), 1, zero,
193 $ work( 1, n ), 1 )
194*
195* UPLO = 'L':
196* Copy the trailing N-1 x N-1 submatrix of AINV to WORK(1:N,1:N-1)
197* and multiply by A, moving each column to the right.
198*
199 ELSE
200*
201* Copy AINV
202*
203 CALL dcopy( n-1, ainv( 2 ), 1, work( 1, 1 ), ldwork )
204 jj = n + 1
205 DO 30 j = 2, n
206 CALL dcopy( n-j+1, ainv( jj ), 1, work( j, j-1 ), 1 )
207 CALL dcopy( n-j, ainv( jj+1 ), 1, work( j, j ), ldwork )
208 jj = jj + n - j + 1
209 30 CONTINUE
210*
211* Multiply by A
212*
213 DO 40 j = n, 2, -1
214 CALL dspmv( 'Lower', n, -one, a, work( 1, j-1 ), 1, zero,
215 $ work( 1, j ), 1 )
216 40 CONTINUE
217 CALL dspmv( 'Lower', n, -one, a, ainv( 1 ), 1, zero,
218 $ work( 1, 1 ), 1 )
219*
220 END IF
221*
222* Add the identity matrix to WORK .
223*
224 DO 50 i = 1, n
225 work( i, i ) = work( i, i ) + one
226 50 CONTINUE
227*
228* Compute norm(I - A*AINV) / (N * norm(A) * norm(AINV) * EPS)
229*
230 resid = dlange( '1', n, n, work, ldwork, rwork )
231*
232 resid = ( ( resid*rcond ) / eps ) / dble( n )
233*
234 RETURN
235*
236* End of DPPT03
237*
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
Definition dcopy.f:82
subroutine dspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
DSPMV
Definition dspmv.f:147
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
double precision function dlange(norm, m, n, a, lda, work)
DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition dlange.f:114
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,...
Definition dlansp.f:114
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: