1 SUBROUTINE dchkeq( THRESH, NOUT )
9 DOUBLE PRECISION thresh
29 DOUBLE PRECISION zero, one, ten
30 parameter( zero = 0.0d0, one = 1.0d+0, ten = 1.0d1 )
32 parameter( nsz = 5, nszb = 3*nsz-2 )
34 parameter( nszp = ( nsz*( nsz+1 ) ) / 2,
40 INTEGER i, info, j, kl, ku, m, n
41 DOUBLE PRECISION ccond, eps, norm, ratio, rcmax, rcmin, rcond
44 DOUBLE PRECISION a( nsz, nsz ), ab( nszb, nsz ), ap( nszp ),
45 $ c( nsz ), pow( npow ), r( nsz ), reslts( 5 ),
49 DOUBLE PRECISION dlamch
53 EXTERNAL dgbequ, dgeequ, dpbequ, dpoequ, dppequ
60 path( 1: 1 ) =
'Double precision'
68 pow( i ) = ten**( i-1 )
69 rpow( i ) = one / pow( i )
79 IF( i.LE.m .AND. j.LE.n )
THEN
80 a( i, j ) = pow( i+j+1 )*( -1 )**( i+j )
87 CALL dgeequ( m, n, a, nsz, r, c, rcond, ccond, norm, info )
92 IF( n.NE.0 .AND. m.NE.0 )
THEN
93 reslts( 1 ) =
max( reslts( 1 ),
94 $ abs( ( rcond-rpow( m ) ) / rpow( m ) ) )
95 reslts( 1 ) =
max( reslts( 1 ),
96 $ abs( ( ccond-rpow( n ) ) / rpow( n ) ) )
97 reslts( 1 ) =
max( reslts( 1 ),
98 $ abs( ( norm-pow( n+m+1 ) ) / pow( n+m+
101 reslts( 1 ) =
max( reslts( 1 ),
102 $ abs( ( r( i )-rpow( i+n+1 ) ) /
106 reslts( 1 ) =
max( reslts( 1 ),
107 $ abs( ( c( j )-pow( n-j+1 ) ) /
119 a(
max( nsz-1, 1 ), j ) = zero
121 CALL dgeequ( nsz, nsz, a, nsz, r, c, rcond, ccond, norm, info )
122 IF( info.NE.
max( nsz-1, 1 ) )
126 a(
max( nsz-1, 1 ), j ) = one
129 a( i,
max( nsz-1, 1 ) ) = zero
131 CALL dgeequ( nsz, nsz, a, nsz, r, c, rcond, ccond, norm, info )
132 IF( info.NE.nsz+
max( nsz-1, 1 ) )
134 reslts( 1 ) = reslts( 1 ) / eps
140 DO 230 kl = 0,
max( m-1, 0 )
141 DO 220 ku = 0,
max( n-1, 0 )
150 IF( i.LE.
min( m, j+kl ) .AND. i.GE.
151 $
max( 1, j-ku ) .AND. j.LE.n )
THEN
152 ab( ku+1+i-j, j ) = pow( i+j+1 )*
158 CALL dgbequ( m, n, kl, ku, ab, nszb, r, c, rcond,
159 $ ccond, norm, info )
162 IF( .NOT.( ( n+kl.LT.m .AND. info.EQ.n+kl+1 ) .OR.
163 $ ( m+ku.LT.n .AND. info.EQ.2*m+ku+1 ) ) )
THEN
167 IF( n.NE.0 .AND. m.NE.0 )
THEN
172 rcmin =
min( rcmin, r( i ) )
173 rcmax =
max( rcmax, r( i ) )
175 ratio = rcmin / rcmax
176 reslts( 2 ) =
max( reslts( 2 ),
177 $ abs( ( rcond-ratio ) / ratio ) )
182 rcmin =
min( rcmin, c( j ) )
183 rcmax =
max( rcmax, c( j ) )
185 ratio = rcmin / rcmax
186 reslts( 2 ) =
max( reslts( 2 ),
187 $ abs( ( ccond-ratio ) / ratio ) )
189 reslts( 2 ) =
max( reslts( 2 ),
190 $ abs( ( norm-pow( n+m+1 ) ) /
195 IF( i.LE.j+kl .AND. i.GE.j-ku )
THEN
196 ratio = abs( r( i )*pow( i+j+1 )*
198 rcmax =
max( rcmax, ratio )
201 reslts( 2 ) =
max( reslts( 2 ),
208 IF( i.LE.j+kl .AND. i.GE.j-ku )
THEN
209 ratio = abs( r( i )*pow( i+j+1 )*
211 rcmax =
max( rcmax, ratio )
214 reslts( 2 ) =
max( reslts( 2 ),
224 reslts( 2 ) = reslts( 2 ) / eps
232 IF( i.LE.n .AND. j.EQ.i )
THEN
233 a( i, j ) = pow( i+j+1 )*( -1 )**( i+j )
240 CALL dpoequ( n, a, nsz, r, rcond, norm, info )
246 reslts( 3 ) =
max( reslts( 3 ),
247 $ abs( ( rcond-rpow( n ) ) / rpow( n ) ) )
248 reslts( 3 ) =
max( reslts( 3 ),
249 $ abs( ( norm-pow( 2*n+1 ) ) / pow( 2*n+
252 reslts( 3 ) =
max( reslts( 3 ),
253 $ abs( ( r( i )-rpow( i+1 ) ) / rpow( i+
259 a(
max( nsz-1, 1 ),
max( nsz-1, 1 ) ) = -one
260 CALL dpoequ( nsz, a, nsz, r, rcond, norm, info )
261 IF( info.NE.
max( nsz-1, 1 ) )
263 reslts( 3 ) = reslts( 3 ) / eps
271 DO 300 i = 1, ( n*( n+1 ) ) / 2
275 ap( ( i*( i+1 ) ) / 2 ) = pow( 2*i+1 )
278 CALL dppequ(
'U', n, ap, r, rcond, norm, info )
284 reslts( 4 ) =
max( reslts( 4 ),
285 $ abs( ( rcond-rpow( n ) ) / rpow( n ) ) )
286 reslts( 4 ) =
max( reslts( 4 ),
287 $ abs( ( norm-pow( 2*n+1 ) ) / pow( 2*n+
290 reslts( 4 ) =
max( reslts( 4 ),
291 $ abs( ( r( i )-rpow( i+1 ) ) / rpow( i+
299 DO 330 i = 1, ( n*( n+1 ) ) / 2
304 ap( j ) = pow( 2*i+1 )
308 CALL dppequ(
'L', n, ap, r, rcond, norm, info )
314 reslts( 4 ) =
max( reslts( 4 ),
315 $ abs( ( rcond-rpow( n ) ) / rpow( n ) ) )
316 reslts( 4 ) =
max( reslts( 4 ),
317 $ abs( ( norm-pow( 2*n+1 ) ) / pow( 2*n+
320 reslts( 4 ) =
max( reslts( 4 ),
321 $ abs( ( r( i )-rpow( i+1 ) ) / rpow( i+
328 i = ( nsz*( nsz+1 ) ) / 2 - 2
330 CALL dppequ(
'L', nsz, ap, r, rcond, norm, info )
331 IF( info.NE.
max( nsz-1, 1 ) )
333 reslts( 4 ) = reslts( 4 ) / eps
338 DO 450 kl = 0,
max( n-1, 0 )
348 ab( kl+1, j ) = pow( 2*j+1 )
351 CALL dpbequ(
'U', n, kl, ab, nszb, r, rcond, norm, info )
357 reslts( 5 ) =
max( reslts( 5 ),
358 $ abs( ( rcond-rpow( n ) ) / rpow( n ) ) )
359 reslts( 5 ) =
max( reslts( 5 ),
360 $ abs( ( norm-pow( 2*n+1 ) ) / pow( 2*n+
363 reslts( 5 ) =
max( reslts( 5 ),
364 $ abs( ( r( i )-rpow( i+1 ) ) /
370 ab( kl+1,
max( n-1, 1 ) ) = -one
371 CALL dpbequ(
'U', n, kl, ab, nszb, r, rcond, norm, info )
372 IF( info.NE.
max( n-1, 1 ) )
384 ab( 1, j ) = pow( 2*j+1 )
387 CALL dpbequ(
'L', n, kl, ab, nszb, r, rcond, norm, info )
393 reslts( 5 ) =
max( reslts( 5 ),
394 $ abs( ( rcond-rpow( n ) ) / rpow( n ) ) )
395 reslts( 5 ) =
max( reslts( 5 ),
396 $ abs( ( norm-pow( 2*n+1 ) ) / pow( 2*n+
399 reslts( 5 ) =
max( reslts( 5 ),
400 $ abs( ( r( i )-rpow( i+1 ) ) /
406 ab( 1,
max( n-1, 1 ) ) = -one
407 CALL dpbequ(
'L', n, kl, ab, nszb, r, rcond, norm, info )
408 IF( info.NE.
max( n-1, 1 ) )
413 reslts( 5 ) = reslts( 5 ) / eps
414 ok = ( reslts( 1 ).LE.thresh ) .AND.
415 $ ( reslts( 2 ).LE.thresh ) .AND.
416 $ ( reslts( 3 ).LE.thresh ) .AND.
417 $ ( reslts( 4 ).LE.thresh ) .AND. ( reslts( 5 ).LE.thresh )
418 WRITE( nout, fmt = * )
420 WRITE( nout, fmt = 9999 )path
422 IF( reslts( 1 ).GT.thresh )
423 $
WRITE( nout, fmt = 9998 )reslts( 1 ), thresh
424 IF( reslts( 2 ).GT.thresh )
425 $
WRITE( nout, fmt = 9997 )reslts( 2 ), thresh
426 IF( reslts( 3 ).GT.thresh )
427 $
WRITE( nout, fmt = 9996 )reslts( 3 ), thresh
428 IF( reslts( 4 ).GT.thresh )
429 $
WRITE( nout, fmt = 9995 )reslts( 4 ), thresh
430 IF( reslts( 5 ).GT.thresh )
431 $
WRITE( nout, fmt = 9994 )reslts( 5 ), thresh
433 9999
format( 1x,
'All tests for ', a3,
434 $
' routines passed the threshold' )
435 9998
format(
' DGEEQU failed test with value ', d10.3,
' exceeding',
436 $
' threshold ', d10.3 )
437 9997
format(
' DGBEQU failed test with value ', d10.3,
' exceeding',
438 $
' threshold ', d10.3 )
439 9996
format(
' DPOEQU failed test with value ', d10.3,
' exceeding',
440 $
' threshold ', d10.3 )
441 9995
format(
' DPPEQU failed test with value ', d10.3,
' exceeding',
442 $
' threshold ', d10.3 )
443 9994
format(
' DPBEQU failed test with value ', d10.3,
' exceeding',
444 $
' threshold ', d10.3 )