root / src / lapack / double / dlasq5.f @ 3
Historique | Voir | Annoter | Télécharger (5,46 ko)
| 1 | 1 | pfleura2 | SUBROUTINE DLASQ5( I0, N0, Z, PP, TAU, DMIN, DMIN1, DMIN2, DN, |
|---|---|---|---|
| 2 | 1 | pfleura2 | $ DNM1, DNM2, IEEE ) |
| 3 | 1 | pfleura2 | * |
| 4 | 1 | pfleura2 | * -- LAPACK routine (version 3.2) -- |
| 5 | 1 | pfleura2 | * |
| 6 | 1 | pfleura2 | * -- Contributed by Osni Marques of the Lawrence Berkeley National -- |
| 7 | 1 | pfleura2 | * -- Laboratory and Beresford Parlett of the Univ. of California at -- |
| 8 | 1 | pfleura2 | * -- Berkeley -- |
| 9 | 1 | pfleura2 | * -- November 2008 -- |
| 10 | 1 | pfleura2 | * |
| 11 | 1 | pfleura2 | * -- LAPACK is a software package provided by Univ. of Tennessee, -- |
| 12 | 1 | pfleura2 | * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
| 13 | 1 | pfleura2 | * |
| 14 | 1 | pfleura2 | * .. Scalar Arguments .. |
| 15 | 1 | pfleura2 | LOGICAL IEEE |
| 16 | 1 | pfleura2 | INTEGER I0, N0, PP |
| 17 | 1 | pfleura2 | DOUBLE PRECISION DMIN, DMIN1, DMIN2, DN, DNM1, DNM2, TAU |
| 18 | 1 | pfleura2 | * .. |
| 19 | 1 | pfleura2 | * .. Array Arguments .. |
| 20 | 1 | pfleura2 | DOUBLE PRECISION Z( * ) |
| 21 | 1 | pfleura2 | * .. |
| 22 | 1 | pfleura2 | * |
| 23 | 1 | pfleura2 | * Purpose |
| 24 | 1 | pfleura2 | * ======= |
| 25 | 1 | pfleura2 | * |
| 26 | 1 | pfleura2 | * DLASQ5 computes one dqds transform in ping-pong form, one |
| 27 | 1 | pfleura2 | * version for IEEE machines another for non IEEE machines. |
| 28 | 1 | pfleura2 | * |
| 29 | 1 | pfleura2 | * Arguments |
| 30 | 1 | pfleura2 | * ========= |
| 31 | 1 | pfleura2 | * |
| 32 | 1 | pfleura2 | * I0 (input) INTEGER |
| 33 | 1 | pfleura2 | * First index. |
| 34 | 1 | pfleura2 | * |
| 35 | 1 | pfleura2 | * N0 (input) INTEGER |
| 36 | 1 | pfleura2 | * Last index. |
| 37 | 1 | pfleura2 | * |
| 38 | 1 | pfleura2 | * Z (input) DOUBLE PRECISION array, dimension ( 4*N ) |
| 39 | 1 | pfleura2 | * Z holds the qd array. EMIN is stored in Z(4*N0) to avoid |
| 40 | 1 | pfleura2 | * an extra argument. |
| 41 | 1 | pfleura2 | * |
| 42 | 1 | pfleura2 | * PP (input) INTEGER |
| 43 | 1 | pfleura2 | * PP=0 for ping, PP=1 for pong. |
| 44 | 1 | pfleura2 | * |
| 45 | 1 | pfleura2 | * TAU (input) DOUBLE PRECISION |
| 46 | 1 | pfleura2 | * This is the shift. |
| 47 | 1 | pfleura2 | * |
| 48 | 1 | pfleura2 | * DMIN (output) DOUBLE PRECISION |
| 49 | 1 | pfleura2 | * Minimum value of d. |
| 50 | 1 | pfleura2 | * |
| 51 | 1 | pfleura2 | * DMIN1 (output) DOUBLE PRECISION |
| 52 | 1 | pfleura2 | * Minimum value of d, excluding D( N0 ). |
| 53 | 1 | pfleura2 | * |
| 54 | 1 | pfleura2 | * DMIN2 (output) DOUBLE PRECISION |
| 55 | 1 | pfleura2 | * Minimum value of d, excluding D( N0 ) and D( N0-1 ). |
| 56 | 1 | pfleura2 | * |
| 57 | 1 | pfleura2 | * DN (output) DOUBLE PRECISION |
| 58 | 1 | pfleura2 | * d(N0), the last value of d. |
| 59 | 1 | pfleura2 | * |
| 60 | 1 | pfleura2 | * DNM1 (output) DOUBLE PRECISION |
| 61 | 1 | pfleura2 | * d(N0-1). |
| 62 | 1 | pfleura2 | * |
| 63 | 1 | pfleura2 | * DNM2 (output) DOUBLE PRECISION |
| 64 | 1 | pfleura2 | * d(N0-2). |
| 65 | 1 | pfleura2 | * |
| 66 | 1 | pfleura2 | * IEEE (input) LOGICAL |
| 67 | 1 | pfleura2 | * Flag for IEEE or non IEEE arithmetic. |
| 68 | 1 | pfleura2 | * |
| 69 | 1 | pfleura2 | * ===================================================================== |
| 70 | 1 | pfleura2 | * |
| 71 | 1 | pfleura2 | * .. Parameter .. |
| 72 | 1 | pfleura2 | DOUBLE PRECISION ZERO |
| 73 | 1 | pfleura2 | PARAMETER ( ZERO = 0.0D0 ) |
| 74 | 1 | pfleura2 | * .. |
| 75 | 1 | pfleura2 | * .. Local Scalars .. |
| 76 | 1 | pfleura2 | INTEGER J4, J4P2 |
| 77 | 1 | pfleura2 | DOUBLE PRECISION D, EMIN, TEMP |
| 78 | 1 | pfleura2 | * .. |
| 79 | 1 | pfleura2 | * .. Intrinsic Functions .. |
| 80 | 1 | pfleura2 | INTRINSIC MIN |
| 81 | 1 | pfleura2 | * .. |
| 82 | 1 | pfleura2 | * .. Executable Statements .. |
| 83 | 1 | pfleura2 | * |
| 84 | 1 | pfleura2 | IF( ( N0-I0-1 ).LE.0 ) |
| 85 | 1 | pfleura2 | $ RETURN |
| 86 | 1 | pfleura2 | * |
| 87 | 1 | pfleura2 | J4 = 4*I0 + PP - 3 |
| 88 | 1 | pfleura2 | EMIN = Z( J4+4 ) |
| 89 | 1 | pfleura2 | D = Z( J4 ) - TAU |
| 90 | 1 | pfleura2 | DMIN = D |
| 91 | 1 | pfleura2 | DMIN1 = -Z( J4 ) |
| 92 | 1 | pfleura2 | * |
| 93 | 1 | pfleura2 | IF( IEEE ) THEN |
| 94 | 1 | pfleura2 | * |
| 95 | 1 | pfleura2 | * Code for IEEE arithmetic. |
| 96 | 1 | pfleura2 | * |
| 97 | 1 | pfleura2 | IF( PP.EQ.0 ) THEN |
| 98 | 1 | pfleura2 | DO 10 J4 = 4*I0, 4*( N0-3 ), 4 |
| 99 | 1 | pfleura2 | Z( J4-2 ) = D + Z( J4-1 ) |
| 100 | 1 | pfleura2 | TEMP = Z( J4+1 ) / Z( J4-2 ) |
| 101 | 1 | pfleura2 | D = D*TEMP - TAU |
| 102 | 1 | pfleura2 | DMIN = MIN( DMIN, D ) |
| 103 | 1 | pfleura2 | Z( J4 ) = Z( J4-1 )*TEMP |
| 104 | 1 | pfleura2 | EMIN = MIN( Z( J4 ), EMIN ) |
| 105 | 1 | pfleura2 | 10 CONTINUE |
| 106 | 1 | pfleura2 | ELSE |
| 107 | 1 | pfleura2 | DO 20 J4 = 4*I0, 4*( N0-3 ), 4 |
| 108 | 1 | pfleura2 | Z( J4-3 ) = D + Z( J4 ) |
| 109 | 1 | pfleura2 | TEMP = Z( J4+2 ) / Z( J4-3 ) |
| 110 | 1 | pfleura2 | D = D*TEMP - TAU |
| 111 | 1 | pfleura2 | DMIN = MIN( DMIN, D ) |
| 112 | 1 | pfleura2 | Z( J4-1 ) = Z( J4 )*TEMP |
| 113 | 1 | pfleura2 | EMIN = MIN( Z( J4-1 ), EMIN ) |
| 114 | 1 | pfleura2 | 20 CONTINUE |
| 115 | 1 | pfleura2 | END IF |
| 116 | 1 | pfleura2 | * |
| 117 | 1 | pfleura2 | * Unroll last two steps. |
| 118 | 1 | pfleura2 | * |
| 119 | 1 | pfleura2 | DNM2 = D |
| 120 | 1 | pfleura2 | DMIN2 = DMIN |
| 121 | 1 | pfleura2 | J4 = 4*( N0-2 ) - PP |
| 122 | 1 | pfleura2 | J4P2 = J4 + 2*PP - 1 |
| 123 | 1 | pfleura2 | Z( J4-2 ) = DNM2 + Z( J4P2 ) |
| 124 | 1 | pfleura2 | Z( J4 ) = Z( J4P2+2 )*( Z( J4P2 ) / Z( J4-2 ) ) |
| 125 | 1 | pfleura2 | DNM1 = Z( J4P2+2 )*( DNM2 / Z( J4-2 ) ) - TAU |
| 126 | 1 | pfleura2 | DMIN = MIN( DMIN, DNM1 ) |
| 127 | 1 | pfleura2 | * |
| 128 | 1 | pfleura2 | DMIN1 = DMIN |
| 129 | 1 | pfleura2 | J4 = J4 + 4 |
| 130 | 1 | pfleura2 | J4P2 = J4 + 2*PP - 1 |
| 131 | 1 | pfleura2 | Z( J4-2 ) = DNM1 + Z( J4P2 ) |
| 132 | 1 | pfleura2 | Z( J4 ) = Z( J4P2+2 )*( Z( J4P2 ) / Z( J4-2 ) ) |
| 133 | 1 | pfleura2 | DN = Z( J4P2+2 )*( DNM1 / Z( J4-2 ) ) - TAU |
| 134 | 1 | pfleura2 | DMIN = MIN( DMIN, DN ) |
| 135 | 1 | pfleura2 | * |
| 136 | 1 | pfleura2 | ELSE |
| 137 | 1 | pfleura2 | * |
| 138 | 1 | pfleura2 | * Code for non IEEE arithmetic. |
| 139 | 1 | pfleura2 | * |
| 140 | 1 | pfleura2 | IF( PP.EQ.0 ) THEN |
| 141 | 1 | pfleura2 | DO 30 J4 = 4*I0, 4*( N0-3 ), 4 |
| 142 | 1 | pfleura2 | Z( J4-2 ) = D + Z( J4-1 ) |
| 143 | 1 | pfleura2 | IF( D.LT.ZERO ) THEN |
| 144 | 1 | pfleura2 | RETURN |
| 145 | 1 | pfleura2 | ELSE |
| 146 | 1 | pfleura2 | Z( J4 ) = Z( J4+1 )*( Z( J4-1 ) / Z( J4-2 ) ) |
| 147 | 1 | pfleura2 | D = Z( J4+1 )*( D / Z( J4-2 ) ) - TAU |
| 148 | 1 | pfleura2 | END IF |
| 149 | 1 | pfleura2 | DMIN = MIN( DMIN, D ) |
| 150 | 1 | pfleura2 | EMIN = MIN( EMIN, Z( J4 ) ) |
| 151 | 1 | pfleura2 | 30 CONTINUE |
| 152 | 1 | pfleura2 | ELSE |
| 153 | 1 | pfleura2 | DO 40 J4 = 4*I0, 4*( N0-3 ), 4 |
| 154 | 1 | pfleura2 | Z( J4-3 ) = D + Z( J4 ) |
| 155 | 1 | pfleura2 | IF( D.LT.ZERO ) THEN |
| 156 | 1 | pfleura2 | RETURN |
| 157 | 1 | pfleura2 | ELSE |
| 158 | 1 | pfleura2 | Z( J4-1 ) = Z( J4+2 )*( Z( J4 ) / Z( J4-3 ) ) |
| 159 | 1 | pfleura2 | D = Z( J4+2 )*( D / Z( J4-3 ) ) - TAU |
| 160 | 1 | pfleura2 | END IF |
| 161 | 1 | pfleura2 | DMIN = MIN( DMIN, D ) |
| 162 | 1 | pfleura2 | EMIN = MIN( EMIN, Z( J4-1 ) ) |
| 163 | 1 | pfleura2 | 40 CONTINUE |
| 164 | 1 | pfleura2 | END IF |
| 165 | 1 | pfleura2 | * |
| 166 | 1 | pfleura2 | * Unroll last two steps. |
| 167 | 1 | pfleura2 | * |
| 168 | 1 | pfleura2 | DNM2 = D |
| 169 | 1 | pfleura2 | DMIN2 = DMIN |
| 170 | 1 | pfleura2 | J4 = 4*( N0-2 ) - PP |
| 171 | 1 | pfleura2 | J4P2 = J4 + 2*PP - 1 |
| 172 | 1 | pfleura2 | Z( J4-2 ) = DNM2 + Z( J4P2 ) |
| 173 | 1 | pfleura2 | IF( DNM2.LT.ZERO ) THEN |
| 174 | 1 | pfleura2 | RETURN |
| 175 | 1 | pfleura2 | ELSE |
| 176 | 1 | pfleura2 | Z( J4 ) = Z( J4P2+2 )*( Z( J4P2 ) / Z( J4-2 ) ) |
| 177 | 1 | pfleura2 | DNM1 = Z( J4P2+2 )*( DNM2 / Z( J4-2 ) ) - TAU |
| 178 | 1 | pfleura2 | END IF |
| 179 | 1 | pfleura2 | DMIN = MIN( DMIN, DNM1 ) |
| 180 | 1 | pfleura2 | * |
| 181 | 1 | pfleura2 | DMIN1 = DMIN |
| 182 | 1 | pfleura2 | J4 = J4 + 4 |
| 183 | 1 | pfleura2 | J4P2 = J4 + 2*PP - 1 |
| 184 | 1 | pfleura2 | Z( J4-2 ) = DNM1 + Z( J4P2 ) |
| 185 | 1 | pfleura2 | IF( DNM1.LT.ZERO ) THEN |
| 186 | 1 | pfleura2 | RETURN |
| 187 | 1 | pfleura2 | ELSE |
| 188 | 1 | pfleura2 | Z( J4 ) = Z( J4P2+2 )*( Z( J4P2 ) / Z( J4-2 ) ) |
| 189 | 1 | pfleura2 | DN = Z( J4P2+2 )*( DNM1 / Z( J4-2 ) ) - TAU |
| 190 | 1 | pfleura2 | END IF |
| 191 | 1 | pfleura2 | DMIN = MIN( DMIN, DN ) |
| 192 | 1 | pfleura2 | * |
| 193 | 1 | pfleura2 | END IF |
| 194 | 1 | pfleura2 | * |
| 195 | 1 | pfleura2 | Z( J4+2 ) = DN |
| 196 | 1 | pfleura2 | Z( 4*N0-PP ) = EMIN |
| 197 | 1 | pfleura2 | RETURN |
| 198 | 1 | pfleura2 | * |
| 199 | 1 | pfleura2 | * End of DLASQ5 |
| 200 | 1 | pfleura2 | * |
| 201 | 1 | pfleura2 | END |