1 REAL FUNCTION SSXT1( IJOB, D1, N1, D2, N2, ABSTOL,
2 $ ULP, UNFL )
3 *
4 * -- LAPACK test routine (version 3.1) --
5 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
6 * November 2006
7 *
8 * .. Scalar Arguments ..
9 INTEGER IJOB, N1, N2
10 REAL ABSTOL, ULP, UNFL
11 * ..
12 * .. Array Arguments ..
13 REAL D1( * ), D2( * )
14 * ..
15 *
16 * Purpose
17 * =======
18 *
19 * SSXT1 computes the difference between a set of eigenvalues.
20 * The result is returned as the function value.
21 *
22 * IJOB = 1: Computes max { min | D1(i)-D2(j) | }
23 * i j
24 *
25 * IJOB = 2: Computes max { min | D1(i)-D2(j) | /
26 * i j
27 * ( ABSTOL + |D1(i)|*ULP ) }
28 *
29 * Arguments
30 * =========
31 *
32 * ITYPE (input) INTEGER
33 * Specifies the type of tests to be performed. (See above.)
34 *
35 * D1 (input) REAL array, dimension (N1)
36 * The first array. D1 should be in increasing order, i.e.,
37 * D1(j) <= D1(j+1).
38 *
39 * N1 (input) INTEGER
40 * The length of D1.
41 *
42 * D2 (input) REAL array, dimension (N2)
43 * The second array. D2 should be in increasing order, i.e.,
44 * D2(j) <= D2(j+1).
45 *
46 * N2 (input) INTEGER
47 * The length of D2.
48 *
49 * ABSTOL (input) REAL
50 * The absolute tolerance, used as a measure of the error.
51 *
52 * ULP (input) REAL
53 * Machine precision.
54 *
55 * UNFL (input) REAL
56 * The smallest positive number whose reciprocal does not
57 * overflow.
58 *
59 * =====================================================================
60 *
61 * .. Parameters ..
62 REAL ZERO
63 PARAMETER ( ZERO = 0.0E0 )
64 * ..
65 * .. Local Scalars ..
66 INTEGER I, J
67 REAL TEMP1, TEMP2
68 * ..
69 * .. Intrinsic Functions ..
70 INTRINSIC ABS, MAX, MIN
71 * ..
72 * .. Executable Statements ..
73 *
74 TEMP1 = ZERO
75 *
76 J = 1
77 DO 20 I = 1, N1
78 10 CONTINUE
79 IF( D2( J ).LT.D1( I ) .AND. J.LT.N2 ) THEN
80 J = J + 1
81 GO TO 10
82 END IF
83 IF( J.EQ.1 ) THEN
84 TEMP2 = ABS( D2( J )-D1( I ) )
85 IF( IJOB.EQ.2 )
86 $ TEMP2 = TEMP2 / MAX( UNFL, ABSTOL+ULP*ABS( D1( I ) ) )
87 ELSE
88 TEMP2 = MIN( ABS( D2( J )-D1( I ) ),
89 $ ABS( D1( I )-D2( J-1 ) ) )
90 IF( IJOB.EQ.2 )
91 $ TEMP2 = TEMP2 / MAX( UNFL, ABSTOL+ULP*ABS( D1( I ) ) )
92 END IF
93 TEMP1 = MAX( TEMP1, TEMP2 )
94 20 CONTINUE
95 *
96 SSXT1 = TEMP1
97 RETURN
98 *
99 * End of SSXT1
100 *
101 END
2 $ ULP, UNFL )
3 *
4 * -- LAPACK test routine (version 3.1) --
5 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
6 * November 2006
7 *
8 * .. Scalar Arguments ..
9 INTEGER IJOB, N1, N2
10 REAL ABSTOL, ULP, UNFL
11 * ..
12 * .. Array Arguments ..
13 REAL D1( * ), D2( * )
14 * ..
15 *
16 * Purpose
17 * =======
18 *
19 * SSXT1 computes the difference between a set of eigenvalues.
20 * The result is returned as the function value.
21 *
22 * IJOB = 1: Computes max { min | D1(i)-D2(j) | }
23 * i j
24 *
25 * IJOB = 2: Computes max { min | D1(i)-D2(j) | /
26 * i j
27 * ( ABSTOL + |D1(i)|*ULP ) }
28 *
29 * Arguments
30 * =========
31 *
32 * ITYPE (input) INTEGER
33 * Specifies the type of tests to be performed. (See above.)
34 *
35 * D1 (input) REAL array, dimension (N1)
36 * The first array. D1 should be in increasing order, i.e.,
37 * D1(j) <= D1(j+1).
38 *
39 * N1 (input) INTEGER
40 * The length of D1.
41 *
42 * D2 (input) REAL array, dimension (N2)
43 * The second array. D2 should be in increasing order, i.e.,
44 * D2(j) <= D2(j+1).
45 *
46 * N2 (input) INTEGER
47 * The length of D2.
48 *
49 * ABSTOL (input) REAL
50 * The absolute tolerance, used as a measure of the error.
51 *
52 * ULP (input) REAL
53 * Machine precision.
54 *
55 * UNFL (input) REAL
56 * The smallest positive number whose reciprocal does not
57 * overflow.
58 *
59 * =====================================================================
60 *
61 * .. Parameters ..
62 REAL ZERO
63 PARAMETER ( ZERO = 0.0E0 )
64 * ..
65 * .. Local Scalars ..
66 INTEGER I, J
67 REAL TEMP1, TEMP2
68 * ..
69 * .. Intrinsic Functions ..
70 INTRINSIC ABS, MAX, MIN
71 * ..
72 * .. Executable Statements ..
73 *
74 TEMP1 = ZERO
75 *
76 J = 1
77 DO 20 I = 1, N1
78 10 CONTINUE
79 IF( D2( J ).LT.D1( I ) .AND. J.LT.N2 ) THEN
80 J = J + 1
81 GO TO 10
82 END IF
83 IF( J.EQ.1 ) THEN
84 TEMP2 = ABS( D2( J )-D1( I ) )
85 IF( IJOB.EQ.2 )
86 $ TEMP2 = TEMP2 / MAX( UNFL, ABSTOL+ULP*ABS( D1( I ) ) )
87 ELSE
88 TEMP2 = MIN( ABS( D2( J )-D1( I ) ),
89 $ ABS( D1( I )-D2( J-1 ) ) )
90 IF( IJOB.EQ.2 )
91 $ TEMP2 = TEMP2 / MAX( UNFL, ABSTOL+ULP*ABS( D1( I ) ) )
92 END IF
93 TEMP1 = MAX( TEMP1, TEMP2 )
94 20 CONTINUE
95 *
96 SSXT1 = TEMP1
97 RETURN
98 *
99 * End of SSXT1
100 *
101 END