00001 SUBROUTINE CLATM5( 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 COMPLEX 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 COMPLEX ONE, TWO, ZERO, HALF, TWENTY
00180 PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ),
00181 $ TWO = ( 2.0E+0, 0.0E+0 ),
00182 $ ZERO = ( 0.0E+0, 0.0E+0 ),
00183 $ HALF = ( 0.5E+0, 0.0E+0 ),
00184 $ TWENTY = ( 2.0E+1, 0.0E+0 ) )
00185
00186
00187 INTEGER I, J, K
00188 COMPLEX IMEPS, REEPS
00189
00190
00191 INTRINSIC CMPLX, MOD, SIN
00192
00193
00194 EXTERNAL CGEMM
00195
00196
00197
00198 IF( PRTYPE.EQ.1 ) THEN
00199 DO 20 I = 1, M
00200 DO 10 J = 1, M
00201 IF( I.EQ.J ) THEN
00202 A( I, J ) = ONE
00203 D( I, J ) = ONE
00204 ELSE IF( I.EQ.J-1 ) THEN
00205 A( I, J ) = -ONE
00206 D( I, J ) = ZERO
00207 ELSE
00208 A( I, J ) = ZERO
00209 D( I, J ) = ZERO
00210 END IF
00211 10 CONTINUE
00212 20 CONTINUE
00213
00214 DO 40 I = 1, N
00215 DO 30 J = 1, N
00216 IF( I.EQ.J ) THEN
00217 B( I, J ) = ONE - ALPHA
00218 E( I, J ) = ONE
00219 ELSE IF( I.EQ.J-1 ) THEN
00220 B( I, J ) = ONE
00221 E( I, J ) = ZERO
00222 ELSE
00223 B( I, J ) = ZERO
00224 E( I, J ) = ZERO
00225 END IF
00226 30 CONTINUE
00227 40 CONTINUE
00228
00229 DO 60 I = 1, M
00230 DO 50 J = 1, N
00231 R( I, J ) = ( HALF-SIN( CMPLX( I / J ) ) )*TWENTY
00232 L( I, J ) = R( I, J )
00233 50 CONTINUE
00234 60 CONTINUE
00235
00236 ELSE IF( PRTYPE.EQ.2 .OR. PRTYPE.EQ.3 ) THEN
00237 DO 80 I = 1, M
00238 DO 70 J = 1, M
00239 IF( I.LE.J ) THEN
00240 A( I, J ) = ( HALF-SIN( CMPLX( I ) ) )*TWO
00241 D( I, J ) = ( HALF-SIN( CMPLX( I*J ) ) )*TWO
00242 ELSE
00243 A( I, J ) = ZERO
00244 D( I, J ) = ZERO
00245 END IF
00246 70 CONTINUE
00247 80 CONTINUE
00248
00249 DO 100 I = 1, N
00250 DO 90 J = 1, N
00251 IF( I.LE.J ) THEN
00252 B( I, J ) = ( HALF-SIN( CMPLX( I+J ) ) )*TWO
00253 E( I, J ) = ( HALF-SIN( CMPLX( J ) ) )*TWO
00254 ELSE
00255 B( I, J ) = ZERO
00256 E( I, J ) = ZERO
00257 END IF
00258 90 CONTINUE
00259 100 CONTINUE
00260
00261 DO 120 I = 1, M
00262 DO 110 J = 1, N
00263 R( I, J ) = ( HALF-SIN( CMPLX( I*J ) ) )*TWENTY
00264 L( I, J ) = ( HALF-SIN( CMPLX( I+J ) ) )*TWENTY
00265 110 CONTINUE
00266 120 CONTINUE
00267
00268 IF( PRTYPE.EQ.3 ) THEN
00269 IF( QBLCKA.LE.1 )
00270 $ QBLCKA = 2
00271 DO 130 K = 1, M - 1, QBLCKA
00272 A( K+1, K+1 ) = A( K, K )
00273 A( K+1, K ) = -SIN( A( K, K+1 ) )
00274 130 CONTINUE
00275
00276 IF( QBLCKB.LE.1 )
00277 $ QBLCKB = 2
00278 DO 140 K = 1, N - 1, QBLCKB
00279 B( K+1, K+1 ) = B( K, K )
00280 B( K+1, K ) = -SIN( B( K, K+1 ) )
00281 140 CONTINUE
00282 END IF
00283
00284 ELSE IF( PRTYPE.EQ.4 ) THEN
00285 DO 160 I = 1, M
00286 DO 150 J = 1, M
00287 A( I, J ) = ( HALF-SIN( CMPLX( I*J ) ) )*TWENTY
00288 D( I, J ) = ( HALF-SIN( CMPLX( I+J ) ) )*TWO
00289 150 CONTINUE
00290 160 CONTINUE
00291
00292 DO 180 I = 1, N
00293 DO 170 J = 1, N
00294 B( I, J ) = ( HALF-SIN( CMPLX( I+J ) ) )*TWENTY
00295 E( I, J ) = ( HALF-SIN( CMPLX( I*J ) ) )*TWO
00296 170 CONTINUE
00297 180 CONTINUE
00298
00299 DO 200 I = 1, M
00300 DO 190 J = 1, N
00301 R( I, J ) = ( HALF-SIN( CMPLX( J / I ) ) )*TWENTY
00302 L( I, J ) = ( HALF-SIN( CMPLX( I*J ) ) )*TWO
00303 190 CONTINUE
00304 200 CONTINUE
00305
00306 ELSE IF( PRTYPE.GE.5 ) THEN
00307 REEPS = HALF*TWO*TWENTY / ALPHA
00308 IMEPS = ( HALF-TWO ) / ALPHA
00309 DO 220 I = 1, M
00310 DO 210 J = 1, N
00311 R( I, J ) = ( HALF-SIN( CMPLX( I*J ) ) )*ALPHA / TWENTY
00312 L( I, J ) = ( HALF-SIN( CMPLX( I+J ) ) )*ALPHA / TWENTY
00313 210 CONTINUE
00314 220 CONTINUE
00315
00316 DO 230 I = 1, M
00317 D( I, I ) = ONE
00318 230 CONTINUE
00319
00320 DO 240 I = 1, M
00321 IF( I.LE.4 ) THEN
00322 A( I, I ) = ONE
00323 IF( I.GT.2 )
00324 $ A( I, I ) = ONE + REEPS
00325 IF( MOD( I, 2 ).NE.0 .AND. I.LT.M ) THEN
00326 A( I, I+1 ) = IMEPS
00327 ELSE IF( I.GT.1 ) THEN
00328 A( I, I-1 ) = -IMEPS
00329 END IF
00330 ELSE IF( I.LE.8 ) THEN
00331 IF( I.LE.6 ) THEN
00332 A( I, I ) = REEPS
00333 ELSE
00334 A( I, I ) = -REEPS
00335 END IF
00336 IF( MOD( I, 2 ).NE.0 .AND. I.LT.M ) THEN
00337 A( I, I+1 ) = ONE
00338 ELSE IF( I.GT.1 ) THEN
00339 A( I, I-1 ) = -ONE
00340 END IF
00341 ELSE
00342 A( I, I ) = ONE
00343 IF( MOD( I, 2 ).NE.0 .AND. I.LT.M ) THEN
00344 A( I, I+1 ) = IMEPS*2
00345 ELSE IF( I.GT.1 ) THEN
00346 A( I, I-1 ) = -IMEPS*2
00347 END IF
00348 END IF
00349 240 CONTINUE
00350
00351 DO 250 I = 1, N
00352 E( I, I ) = ONE
00353 IF( I.LE.4 ) THEN
00354 B( I, I ) = -ONE
00355 IF( I.GT.2 )
00356 $ B( I, I ) = ONE - REEPS
00357 IF( MOD( I, 2 ).NE.0 .AND. I.LT.N ) THEN
00358 B( I, I+1 ) = IMEPS
00359 ELSE IF( I.GT.1 ) THEN
00360 B( I, I-1 ) = -IMEPS
00361 END IF
00362 ELSE IF( I.LE.8 ) THEN
00363 IF( I.LE.6 ) THEN
00364 B( I, I ) = REEPS
00365 ELSE
00366 B( I, I ) = -REEPS
00367 END IF
00368 IF( MOD( I, 2 ).NE.0 .AND. I.LT.N ) THEN
00369 B( I, I+1 ) = ONE + IMEPS
00370 ELSE IF( I.GT.1 ) THEN
00371 B( I, I-1 ) = -ONE - IMEPS
00372 END IF
00373 ELSE
00374 B( I, I ) = ONE - REEPS
00375 IF( MOD( I, 2 ).NE.0 .AND. I.LT.N ) THEN
00376 B( I, I+1 ) = IMEPS*2
00377 ELSE IF( I.GT.1 ) THEN
00378 B( I, I-1 ) = -IMEPS*2
00379 END IF
00380 END IF
00381 250 CONTINUE
00382 END IF
00383
00384
00385
00386 CALL CGEMM( 'N', 'N', M, N, M, ONE, A, LDA, R, LDR, ZERO, C, LDC )
00387 CALL CGEMM( 'N', 'N', M, N, N, -ONE, L, LDL, B, LDB, ONE, C, LDC )
00388 CALL CGEMM( 'N', 'N', M, N, M, ONE, D, LDD, R, LDR, ZERO, F, LDF )
00389 CALL CGEMM( 'N', 'N', M, N, N, -ONE, L, LDL, E, LDE, ONE, F, LDF )
00390
00391
00392
00393 END