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

Definition at line 112 of file dppt03.f.

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

Here is the call graph for this function:

Here is the caller graph for this function: