00001 SUBROUTINE SLAEXC( WANTQ, N, T, LDT, Q, LDQ, J1, N1, N2, WORK,
00002 $ INFO )
00003
00004
00005
00006
00007
00008
00009
00010 LOGICAL WANTQ
00011 INTEGER INFO, J1, LDQ, LDT, N, N1, N2
00012
00013
00014 REAL Q( LDQ, * ), T( LDT, * ), WORK( * )
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 REAL ZERO, ONE
00077 PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
00078 REAL TEN
00079 PARAMETER ( TEN = 1.0E+1 )
00080 INTEGER LDD, LDX
00081 PARAMETER ( LDD = 4, LDX = 2 )
00082
00083
00084 INTEGER IERR, J2, J3, J4, K, ND
00085 REAL CS, DNORM, EPS, SCALE, SMLNUM, SN, T11, T22,
00086 $ T33, TAU, TAU1, TAU2, TEMP, THRESH, WI1, WI2,
00087 $ WR1, WR2, XNORM
00088
00089
00090 REAL D( LDD, 4 ), U( 3 ), U1( 3 ), U2( 3 ),
00091 $ X( LDX, 2 )
00092
00093
00094 REAL SLAMCH, SLANGE
00095 EXTERNAL SLAMCH, SLANGE
00096
00097
00098 EXTERNAL SLACPY, SLANV2, SLARFG, SLARFX, SLARTG, SLASY2,
00099 $ SROT
00100
00101
00102 INTRINSIC ABS, MAX
00103
00104
00105
00106 INFO = 0
00107
00108
00109
00110 IF( N.EQ.0 .OR. N1.EQ.0 .OR. N2.EQ.0 )
00111 $ RETURN
00112 IF( J1+N1.GT.N )
00113 $ RETURN
00114
00115 J2 = J1 + 1
00116 J3 = J1 + 2
00117 J4 = J1 + 3
00118
00119 IF( N1.EQ.1 .AND. N2.EQ.1 ) THEN
00120
00121
00122
00123 T11 = T( J1, J1 )
00124 T22 = T( J2, J2 )
00125
00126
00127
00128 CALL SLARTG( T( J1, J2 ), T22-T11, CS, SN, TEMP )
00129
00130
00131
00132 IF( J3.LE.N )
00133 $ CALL SROT( N-J1-1, T( J1, J3 ), LDT, T( J2, J3 ), LDT, CS,
00134 $ SN )
00135 CALL SROT( J1-1, T( 1, J1 ), 1, T( 1, J2 ), 1, CS, SN )
00136
00137 T( J1, J1 ) = T22
00138 T( J2, J2 ) = T11
00139
00140 IF( WANTQ ) THEN
00141
00142
00143
00144 CALL SROT( N, Q( 1, J1 ), 1, Q( 1, J2 ), 1, CS, SN )
00145 END IF
00146
00147 ELSE
00148
00149
00150
00151
00152
00153
00154 ND = N1 + N2
00155 CALL SLACPY( 'Full', ND, ND, T( J1, J1 ), LDT, D, LDD )
00156 DNORM = SLANGE( 'Max', ND, ND, D, LDD, WORK )
00157
00158
00159
00160
00161 EPS = SLAMCH( 'P' )
00162 SMLNUM = SLAMCH( 'S' ) / EPS
00163 THRESH = MAX( TEN*EPS*DNORM, SMLNUM )
00164
00165
00166
00167 CALL SLASY2( .FALSE., .FALSE., -1, N1, N2, D, LDD,
00168 $ D( N1+1, N1+1 ), LDD, D( 1, N1+1 ), LDD, SCALE, X,
00169 $ LDX, XNORM, IERR )
00170
00171
00172
00173 K = N1 + N1 + N2 - 3
00174 GO TO ( 10, 20, 30 )K
00175
00176 10 CONTINUE
00177
00178
00179
00180
00181
00182 U( 1 ) = SCALE
00183 U( 2 ) = X( 1, 1 )
00184 U( 3 ) = X( 1, 2 )
00185 CALL SLARFG( 3, U( 3 ), U, 1, TAU )
00186 U( 3 ) = ONE
00187 T11 = T( J1, J1 )
00188
00189
00190
00191 CALL SLARFX( 'L', 3, 3, U, TAU, D, LDD, WORK )
00192 CALL SLARFX( 'R', 3, 3, U, TAU, D, LDD, WORK )
00193
00194
00195
00196 IF( MAX( ABS( D( 3, 1 ) ), ABS( D( 3, 2 ) ), ABS( D( 3,
00197 $ 3 )-T11 ) ).GT.THRESH )GO TO 50
00198
00199
00200
00201 CALL SLARFX( 'L', 3, N-J1+1, U, TAU, T( J1, J1 ), LDT, WORK )
00202 CALL SLARFX( 'R', J2, 3, U, TAU, T( 1, J1 ), LDT, WORK )
00203
00204 T( J3, J1 ) = ZERO
00205 T( J3, J2 ) = ZERO
00206 T( J3, J3 ) = T11
00207
00208 IF( WANTQ ) THEN
00209
00210
00211
00212 CALL SLARFX( 'R', N, 3, U, TAU, Q( 1, J1 ), LDQ, WORK )
00213 END IF
00214 GO TO 40
00215
00216 20 CONTINUE
00217
00218
00219
00220
00221
00222
00223
00224 U( 1 ) = -X( 1, 1 )
00225 U( 2 ) = -X( 2, 1 )
00226 U( 3 ) = SCALE
00227 CALL SLARFG( 3, U( 1 ), U( 2 ), 1, TAU )
00228 U( 1 ) = ONE
00229 T33 = T( J3, J3 )
00230
00231
00232
00233 CALL SLARFX( 'L', 3, 3, U, TAU, D, LDD, WORK )
00234 CALL SLARFX( 'R', 3, 3, U, TAU, D, LDD, WORK )
00235
00236
00237
00238 IF( MAX( ABS( D( 2, 1 ) ), ABS( D( 3, 1 ) ), ABS( D( 1,
00239 $ 1 )-T33 ) ).GT.THRESH )GO TO 50
00240
00241
00242
00243 CALL SLARFX( 'R', J3, 3, U, TAU, T( 1, J1 ), LDT, WORK )
00244 CALL SLARFX( 'L', 3, N-J1, U, TAU, T( J1, J2 ), LDT, WORK )
00245
00246 T( J1, J1 ) = T33
00247 T( J2, J1 ) = ZERO
00248 T( J3, J1 ) = ZERO
00249
00250 IF( WANTQ ) THEN
00251
00252
00253
00254 CALL SLARFX( 'R', N, 3, U, TAU, Q( 1, J1 ), LDQ, WORK )
00255 END IF
00256 GO TO 40
00257
00258 30 CONTINUE
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268 U1( 1 ) = -X( 1, 1 )
00269 U1( 2 ) = -X( 2, 1 )
00270 U1( 3 ) = SCALE
00271 CALL SLARFG( 3, U1( 1 ), U1( 2 ), 1, TAU1 )
00272 U1( 1 ) = ONE
00273
00274 TEMP = -TAU1*( X( 1, 2 )+U1( 2 )*X( 2, 2 ) )
00275 U2( 1 ) = -TEMP*U1( 2 ) - X( 2, 2 )
00276 U2( 2 ) = -TEMP*U1( 3 )
00277 U2( 3 ) = SCALE
00278 CALL SLARFG( 3, U2( 1 ), U2( 2 ), 1, TAU2 )
00279 U2( 1 ) = ONE
00280
00281
00282
00283 CALL SLARFX( 'L', 3, 4, U1, TAU1, D, LDD, WORK )
00284 CALL SLARFX( 'R', 4, 3, U1, TAU1, D, LDD, WORK )
00285 CALL SLARFX( 'L', 3, 4, U2, TAU2, D( 2, 1 ), LDD, WORK )
00286 CALL SLARFX( 'R', 4, 3, U2, TAU2, D( 1, 2 ), LDD, WORK )
00287
00288
00289
00290 IF( MAX( ABS( D( 3, 1 ) ), ABS( D( 3, 2 ) ), ABS( D( 4, 1 ) ),
00291 $ ABS( D( 4, 2 ) ) ).GT.THRESH )GO TO 50
00292
00293
00294
00295 CALL SLARFX( 'L', 3, N-J1+1, U1, TAU1, T( J1, J1 ), LDT, WORK )
00296 CALL SLARFX( 'R', J4, 3, U1, TAU1, T( 1, J1 ), LDT, WORK )
00297 CALL SLARFX( 'L', 3, N-J1+1, U2, TAU2, T( J2, J1 ), LDT, WORK )
00298 CALL SLARFX( 'R', J4, 3, U2, TAU2, T( 1, J2 ), LDT, WORK )
00299
00300 T( J3, J1 ) = ZERO
00301 T( J3, J2 ) = ZERO
00302 T( J4, J1 ) = ZERO
00303 T( J4, J2 ) = ZERO
00304
00305 IF( WANTQ ) THEN
00306
00307
00308
00309 CALL SLARFX( 'R', N, 3, U1, TAU1, Q( 1, J1 ), LDQ, WORK )
00310 CALL SLARFX( 'R', N, 3, U2, TAU2, Q( 1, J2 ), LDQ, WORK )
00311 END IF
00312
00313 40 CONTINUE
00314
00315 IF( N2.EQ.2 ) THEN
00316
00317
00318
00319 CALL SLANV2( T( J1, J1 ), T( J1, J2 ), T( J2, J1 ),
00320 $ T( J2, J2 ), WR1, WI1, WR2, WI2, CS, SN )
00321 CALL SROT( N-J1-1, T( J1, J1+2 ), LDT, T( J2, J1+2 ), LDT,
00322 $ CS, SN )
00323 CALL SROT( J1-1, T( 1, J1 ), 1, T( 1, J2 ), 1, CS, SN )
00324 IF( WANTQ )
00325 $ CALL SROT( N, Q( 1, J1 ), 1, Q( 1, J2 ), 1, CS, SN )
00326 END IF
00327
00328 IF( N1.EQ.2 ) THEN
00329
00330
00331
00332 J3 = J1 + N2
00333 J4 = J3 + 1
00334 CALL SLANV2( T( J3, J3 ), T( J3, J4 ), T( J4, J3 ),
00335 $ T( J4, J4 ), WR1, WI1, WR2, WI2, CS, SN )
00336 IF( J3+2.LE.N )
00337 $ CALL SROT( N-J3-1, T( J3, J3+2 ), LDT, T( J4, J3+2 ),
00338 $ LDT, CS, SN )
00339 CALL SROT( J3-1, T( 1, J3 ), 1, T( 1, J4 ), 1, CS, SN )
00340 IF( WANTQ )
00341 $ CALL SROT( N, Q( 1, J3 ), 1, Q( 1, J4 ), 1, CS, SN )
00342 END IF
00343
00344 END IF
00345 RETURN
00346
00347
00348
00349 50 INFO = 1
00350 RETURN
00351
00352
00353
00354 END