00001 SUBROUTINE SLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
00002 $ E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
00003 $ QBLCKB )
00004
00005
00006
00007
00008
00009
00010 INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
00011 $ PRTYPE, QBLCKA, QBLCKB
00012 REAL ALPHA
00013
00014
00015 REAL A( LDA, * ), B( LDB, * ), C( LDC, * ),
00016 $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
00017 $ L( LDL, * ), R( LDR, * )
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
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179 REAL ONE, ZERO, TWENTY, HALF, TWO
00180 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0, TWENTY = 2.0E+1,
00181 $ HALF = 0.5E+0, TWO = 2.0E+0 )
00182
00183
00184 INTEGER I, J, K
00185 REAL IMEPS, REEPS
00186
00187
00188 INTRINSIC MOD, REAL, SIN
00189
00190
00191 EXTERNAL SGEMM
00192
00193
00194
00195 IF( PRTYPE.EQ.1 ) THEN
00196 DO 20 I = 1, M
00197 DO 10 J = 1, M
00198 IF( I.EQ.J ) THEN
00199 A( I, J ) = ONE
00200 D( I, J ) = ONE
00201 ELSE IF( I.EQ.J-1 ) THEN
00202 A( I, J ) = -ONE
00203 D( I, J ) = ZERO
00204 ELSE
00205 A( I, J ) = ZERO
00206 D( I, J ) = ZERO
00207 END IF
00208 10 CONTINUE
00209 20 CONTINUE
00210
00211 DO 40 I = 1, N
00212 DO 30 J = 1, N
00213 IF( I.EQ.J ) THEN
00214 B( I, J ) = ONE - ALPHA
00215 E( I, J ) = ONE
00216 ELSE IF( I.EQ.J-1 ) THEN
00217 B( I, J ) = ONE
00218 E( I, J ) = ZERO
00219 ELSE
00220 B( I, J ) = ZERO
00221 E( I, J ) = ZERO
00222 END IF
00223 30 CONTINUE
00224 40 CONTINUE
00225
00226 DO 60 I = 1, M
00227 DO 50 J = 1, N
00228 R( I, J ) = ( HALF-SIN( REAL( I / J ) ) )*TWENTY
00229 L( I, J ) = R( I, J )
00230 50 CONTINUE
00231 60 CONTINUE
00232
00233 ELSE IF( PRTYPE.EQ.2 .OR. PRTYPE.EQ.3 ) THEN
00234 DO 80 I = 1, M
00235 DO 70 J = 1, M
00236 IF( I.LE.J ) THEN
00237 A( I, J ) = ( HALF-SIN( REAL( I ) ) )*TWO
00238 D( I, J ) = ( HALF-SIN( REAL( I*J ) ) )*TWO
00239 ELSE
00240 A( I, J ) = ZERO
00241 D( I, J ) = ZERO
00242 END IF
00243 70 CONTINUE
00244 80 CONTINUE
00245
00246 DO 100 I = 1, N
00247 DO 90 J = 1, N
00248 IF( I.LE.J ) THEN
00249 B( I, J ) = ( HALF-SIN( REAL( I+J ) ) )*TWO
00250 E( I, J ) = ( HALF-SIN( REAL( J ) ) )*TWO
00251 ELSE
00252 B( I, J ) = ZERO
00253 E( I, J ) = ZERO
00254 END IF
00255 90 CONTINUE
00256 100 CONTINUE
00257
00258 DO 120 I = 1, M
00259 DO 110 J = 1, N
00260 R( I, J ) = ( HALF-SIN( REAL( I*J ) ) )*TWENTY
00261 L( I, J ) = ( HALF-SIN( REAL( I+J ) ) )*TWENTY
00262 110 CONTINUE
00263 120 CONTINUE
00264
00265 IF( PRTYPE.EQ.3 ) THEN
00266 IF( QBLCKA.LE.1 )
00267 $ QBLCKA = 2
00268 DO 130 K = 1, M - 1, QBLCKA
00269 A( K+1, K+1 ) = A( K, K )
00270 A( K+1, K ) = -SIN( A( K, K+1 ) )
00271 130 CONTINUE
00272
00273 IF( QBLCKB.LE.1 )
00274 $ QBLCKB = 2
00275 DO 140 K = 1, N - 1, QBLCKB
00276 B( K+1, K+1 ) = B( K, K )
00277 B( K+1, K ) = -SIN( B( K, K+1 ) )
00278 140 CONTINUE
00279 END IF
00280
00281 ELSE IF( PRTYPE.EQ.4 ) THEN
00282 DO 160 I = 1, M
00283 DO 150 J = 1, M
00284 A( I, J ) = ( HALF-SIN( REAL( I*J ) ) )*TWENTY
00285 D( I, J ) = ( HALF-SIN( REAL( I+J ) ) )*TWO
00286 150 CONTINUE
00287 160 CONTINUE
00288
00289 DO 180 I = 1, N
00290 DO 170 J = 1, N
00291 B( I, J ) = ( HALF-SIN( REAL( I+J ) ) )*TWENTY
00292 E( I, J ) = ( HALF-SIN( REAL( I*J ) ) )*TWO
00293 170 CONTINUE
00294 180 CONTINUE
00295
00296 DO 200 I = 1, M
00297 DO 190 J = 1, N
00298 R( I, J ) = ( HALF-SIN( REAL( J / I ) ) )*TWENTY
00299 L( I, J ) = ( HALF-SIN( REAL( I*J ) ) )*TWO
00300 190 CONTINUE
00301 200 CONTINUE
00302
00303 ELSE IF( PRTYPE.GE.5 ) THEN
00304 REEPS = HALF*TWO*TWENTY / ALPHA
00305 IMEPS = ( HALF-TWO ) / ALPHA
00306 DO 220 I = 1, M
00307 DO 210 J = 1, N
00308 R( I, J ) = ( HALF-SIN( REAL( I*J ) ) )*ALPHA / TWENTY
00309 L( I, J ) = ( HALF-SIN( REAL( I+J ) ) )*ALPHA / TWENTY
00310 210 CONTINUE
00311 220 CONTINUE
00312
00313 DO 230 I = 1, M
00314 D( I, I ) = ONE
00315 230 CONTINUE
00316
00317 DO 240 I = 1, M
00318 IF( I.LE.4 ) THEN
00319 A( I, I ) = ONE
00320 IF( I.GT.2 )
00321 $ A( I, I ) = ONE + REEPS
00322 IF( MOD( I, 2 ).NE.0 .AND. I.LT.M ) THEN
00323 A( I, I+1 ) = IMEPS
00324 ELSE IF( I.GT.1 ) THEN
00325 A( I, I-1 ) = -IMEPS
00326 END IF
00327 ELSE IF( I.LE.8 ) THEN
00328 IF( I.LE.6 ) THEN
00329 A( I, I ) = REEPS
00330 ELSE
00331 A( I, I ) = -REEPS
00332 END IF
00333 IF( MOD( I, 2 ).NE.0 .AND. I.LT.M ) THEN
00334 A( I, I+1 ) = ONE
00335 ELSE IF( I.GT.1 ) THEN
00336 A( I, I-1 ) = -ONE
00337 END IF
00338 ELSE
00339 A( I, I ) = ONE
00340 IF( MOD( I, 2 ).NE.0 .AND. I.LT.M ) THEN
00341 A( I, I+1 ) = IMEPS*2
00342 ELSE IF( I.GT.1 ) THEN
00343 A( I, I-1 ) = -IMEPS*2
00344 END IF
00345 END IF
00346 240 CONTINUE
00347
00348 DO 250 I = 1, N
00349 E( I, I ) = ONE
00350 IF( I.LE.4 ) THEN
00351 B( I, I ) = -ONE
00352 IF( I.GT.2 )
00353 $ B( I, I ) = ONE - REEPS
00354 IF( MOD( I, 2 ).NE.0 .AND. I.LT.N ) THEN
00355 B( I, I+1 ) = IMEPS
00356 ELSE IF( I.GT.1 ) THEN
00357 B( I, I-1 ) = -IMEPS
00358 END IF
00359 ELSE IF( I.LE.8 ) THEN
00360 IF( I.LE.6 ) THEN
00361 B( I, I ) = REEPS
00362 ELSE
00363 B( I, I ) = -REEPS
00364 END IF
00365 IF( MOD( I, 2 ).NE.0 .AND. I.LT.N ) THEN
00366 B( I, I+1 ) = ONE + IMEPS
00367 ELSE IF( I.GT.1 ) THEN
00368 B( I, I-1 ) = -ONE - IMEPS
00369 END IF
00370 ELSE
00371 B( I, I ) = ONE - REEPS
00372 IF( MOD( I, 2 ).NE.0 .AND. I.LT.N ) THEN
00373 B( I, I+1 ) = IMEPS*2
00374 ELSE IF( I.GT.1 ) THEN
00375 B( I, I-1 ) = -IMEPS*2
00376 END IF
00377 END IF
00378 250 CONTINUE
00379 END IF
00380
00381
00382
00383 CALL SGEMM( 'N', 'N', M, N, M, ONE, A, LDA, R, LDR, ZERO, C, LDC )
00384 CALL SGEMM( 'N', 'N', M, N, N, -ONE, L, LDL, B, LDB, ONE, C, LDC )
00385 CALL SGEMM( 'N', 'N', M, N, M, ONE, D, LDD, R, LDR, ZERO, F, LDF )
00386 CALL SGEMM( 'N', 'N', M, N, N, -ONE, L, LDL, E, LDE, ONE, F, LDF )
00387
00388
00389
00390 END