00001 SUBROUTINE DLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
00002 $ BETA, WX, WY, S, DIF )
00003
00004
00005
00006
00007
00008
00009 INTEGER LDA, LDX, LDY, N, TYPE
00010 DOUBLE PRECISION ALPHA, BETA, WX, WY
00011
00012
00013 DOUBLE PRECISION A( LDA, * ), B( LDA, * ), DIF( * ), S( * ),
00014 $ X( LDX, * ), Y( LDY, * )
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
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 DOUBLE PRECISION ZERO, ONE, TWO, THREE
00110 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0, TWO = 2.0D+0,
00111 $ THREE = 3.0D+0 )
00112
00113
00114 INTEGER I, INFO, J
00115
00116
00117 DOUBLE PRECISION WORK( 100 ), Z( 12, 12 )
00118
00119
00120 INTRINSIC DBLE, SQRT
00121
00122
00123 EXTERNAL DGESVD, DLACPY, DLAKF2
00124
00125
00126
00127
00128
00129
00130 DO 20 I = 1, N
00131 DO 10 J = 1, N
00132
00133 IF( I.EQ.J ) THEN
00134 A( I, I ) = DBLE( I ) + ALPHA
00135 B( I, I ) = ONE
00136 ELSE
00137 A( I, J ) = ZERO
00138 B( I, J ) = ZERO
00139 END IF
00140
00141 10 CONTINUE
00142 20 CONTINUE
00143
00144
00145
00146 CALL DLACPY( 'F', N, N, B, LDA, Y, LDY )
00147 Y( 3, 1 ) = -WY
00148 Y( 4, 1 ) = WY
00149 Y( 5, 1 ) = -WY
00150 Y( 3, 2 ) = -WY
00151 Y( 4, 2 ) = WY
00152 Y( 5, 2 ) = -WY
00153
00154 CALL DLACPY( 'F', N, N, B, LDA, X, LDX )
00155 X( 1, 3 ) = -WX
00156 X( 1, 4 ) = -WX
00157 X( 1, 5 ) = WX
00158 X( 2, 3 ) = WX
00159 X( 2, 4 ) = -WX
00160 X( 2, 5 ) = -WX
00161
00162
00163
00164 B( 1, 3 ) = WX + WY
00165 B( 2, 3 ) = -WX + WY
00166 B( 1, 4 ) = WX - WY
00167 B( 2, 4 ) = WX - WY
00168 B( 1, 5 ) = -WX + WY
00169 B( 2, 5 ) = WX + WY
00170 IF( TYPE.EQ.1 ) THEN
00171 A( 1, 3 ) = WX*A( 1, 1 ) + WY*A( 3, 3 )
00172 A( 2, 3 ) = -WX*A( 2, 2 ) + WY*A( 3, 3 )
00173 A( 1, 4 ) = WX*A( 1, 1 ) - WY*A( 4, 4 )
00174 A( 2, 4 ) = WX*A( 2, 2 ) - WY*A( 4, 4 )
00175 A( 1, 5 ) = -WX*A( 1, 1 ) + WY*A( 5, 5 )
00176 A( 2, 5 ) = WX*A( 2, 2 ) + WY*A( 5, 5 )
00177 ELSE IF( TYPE.EQ.2 ) THEN
00178 A( 1, 3 ) = TWO*WX + WY
00179 A( 2, 3 ) = WY
00180 A( 1, 4 ) = -WY*( TWO+ALPHA+BETA )
00181 A( 2, 4 ) = TWO*WX - WY*( TWO+ALPHA+BETA )
00182 A( 1, 5 ) = -TWO*WX + WY*( ALPHA-BETA )
00183 A( 2, 5 ) = WY*( ALPHA-BETA )
00184 A( 1, 1 ) = ONE
00185 A( 1, 2 ) = -ONE
00186 A( 2, 1 ) = ONE
00187 A( 2, 2 ) = A( 1, 1 )
00188 A( 3, 3 ) = ONE
00189 A( 4, 4 ) = ONE + ALPHA
00190 A( 4, 5 ) = ONE + BETA
00191 A( 5, 4 ) = -A( 4, 5 )
00192 A( 5, 5 ) = A( 4, 4 )
00193 END IF
00194
00195
00196
00197 IF( TYPE.EQ.1 ) THEN
00198
00199 S( 1 ) = ONE / SQRT( ( ONE+THREE*WY*WY ) /
00200 $ ( ONE+A( 1, 1 )*A( 1, 1 ) ) )
00201 S( 2 ) = ONE / SQRT( ( ONE+THREE*WY*WY ) /
00202 $ ( ONE+A( 2, 2 )*A( 2, 2 ) ) )
00203 S( 3 ) = ONE / SQRT( ( ONE+TWO*WX*WX ) /
00204 $ ( ONE+A( 3, 3 )*A( 3, 3 ) ) )
00205 S( 4 ) = ONE / SQRT( ( ONE+TWO*WX*WX ) /
00206 $ ( ONE+A( 4, 4 )*A( 4, 4 ) ) )
00207 S( 5 ) = ONE / SQRT( ( ONE+TWO*WX*WX ) /
00208 $ ( ONE+A( 5, 5 )*A( 5, 5 ) ) )
00209
00210 CALL DLAKF2( 1, 4, A, LDA, A( 2, 2 ), B, B( 2, 2 ), Z, 12 )
00211 CALL DGESVD( 'N', 'N', 8, 8, Z, 12, WORK, WORK( 9 ), 1,
00212 $ WORK( 10 ), 1, WORK( 11 ), 40, INFO )
00213 DIF( 1 ) = WORK( 8 )
00214
00215 CALL DLAKF2( 4, 1, A, LDA, A( 5, 5 ), B, B( 5, 5 ), Z, 12 )
00216 CALL DGESVD( 'N', 'N', 8, 8, Z, 12, WORK, WORK( 9 ), 1,
00217 $ WORK( 10 ), 1, WORK( 11 ), 40, INFO )
00218 DIF( 5 ) = WORK( 8 )
00219
00220 ELSE IF( TYPE.EQ.2 ) THEN
00221
00222 S( 1 ) = ONE / SQRT( ONE / THREE+WY*WY )
00223 S( 2 ) = S( 1 )
00224 S( 3 ) = ONE / SQRT( ONE / TWO+WX*WX )
00225 S( 4 ) = ONE / SQRT( ( ONE+TWO*WX*WX ) /
00226 $ ( ONE+( ONE+ALPHA )*( ONE+ALPHA )+( ONE+BETA )*( ONE+
00227 $ BETA ) ) )
00228 S( 5 ) = S( 4 )
00229
00230 CALL DLAKF2( 2, 3, A, LDA, A( 3, 3 ), B, B( 3, 3 ), Z, 12 )
00231 CALL DGESVD( 'N', 'N', 12, 12, Z, 12, WORK, WORK( 13 ), 1,
00232 $ WORK( 14 ), 1, WORK( 15 ), 60, INFO )
00233 DIF( 1 ) = WORK( 12 )
00234
00235 CALL DLAKF2( 3, 2, A, LDA, A( 4, 4 ), B, B( 4, 4 ), Z, 12 )
00236 CALL DGESVD( 'N', 'N', 12, 12, Z, 12, WORK, WORK( 13 ), 1,
00237 $ WORK( 14 ), 1, WORK( 15 ), 60, INFO )
00238 DIF( 5 ) = WORK( 12 )
00239
00240 END IF
00241
00242 RETURN
00243
00244
00245
00246 END