ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
cmmddact.f
Go to the documentation of this file.
1  SUBROUTINE cmmddact( M, N, ALPHA, A, LDA, BETA, B, LDB )
2 *
3 * -- PBLAS auxiliary routine (version 2.0) --
4 * University of Tennessee, Knoxville, Oak Ridge National Laboratory,
5 * and University of California, Berkeley.
6 * April 1, 1998
7 *
8 * .. Scalar Arguments ..
9  INTEGER LDA, LDB, M, N
10  COMPLEX ALPHA, BETA
11 * ..
12 * .. Array Arguments ..
13  COMPLEX A( LDA, * ), B( LDB, * )
14 * ..
15 *
16 * Purpose
17 * =======
18 *
19 * CMMDDACT performs the following operation:
20 *
21 * A := alpha * A + beta * conjg( B' ),
22 *
23 * where alpha, beta are scalars; A is an m by n matrix and B is an n by
24 * m matrix.
25 *
26 * Arguments
27 * =========
28 *
29 * M (local input) INTEGER
30 * On entry, M specifies the number of rows of A and the number
31 * of columns of B. M must be at least zero.
32 *
33 * N (local input) INTEGER
34 * On entry, N specifies the number of rows of B and the number
35 * of columns of A. N must be at least zero.
36 *
37 * ALPHA (local input) COMPLEX
38 * On entry, ALPHA specifies the scalar alpha. When ALPHA is
39 * supplied as zero then the local entries of the array A need
40 * not be set on input.
41 *
42 * A (local input/local output) COMPLEX array
43 * On entry, A is an array of dimension ( LDA, N ). On exit, the
44 * leading n by m part of B has been conjugated and added to the
45 * leading m by n part of A.
46 *
47 * LDA (local input) INTEGER
48 * On entry, LDA specifies the leading dimension of the array A.
49 * LDA must be at least max( 1, M ).
50 *
51 * BETA (local input) COMPLEX
52 * On entry, BETA specifies the scalar beta. When BETA is sup-
53 * plied as zero then the local entries of the array B need not
54 * be set on input.
55 *
56 * B (local input) COMPLEX array
57 * On entry, B is an array of dimension ( LDB, M ).
58 *
59 * LDB (local input) INTEGER
60 * On entry, LDB specifies the leading dimension of the array B.
61 * LDB must be at least max( 1, N ).
62 *
63 * -- Written on April 1, 1998 by
64 * Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
65 *
66 * =====================================================================
67 *
68 * .. Parameters ..
69  COMPLEX ONE, ZERO
70  parameter( one = ( 1.0e+0, 0.0e+0 ),
71  $ zero = ( 0.0e+0, 0.0e+0 ) )
72 * ..
73 * .. Local Scalars ..
74  INTEGER I, J
75 * ..
76 * .. External Subroutines ..
77  EXTERNAL cscal
78 * ..
79 * .. Intrinsic Functions ..
80  INTRINSIC conjg
81 * ..
82 * .. Executable Statements ..
83 *
84  IF( m.GE.n ) THEN
85  IF( beta.EQ.one ) THEN
86  IF( alpha.EQ.zero ) THEN
87  DO 20 j = 1, n
88  DO 10 i = 1, m
89  a( i, j ) = conjg( b( j, i ) )
90  10 CONTINUE
91  20 CONTINUE
92  ELSE IF( alpha.NE.one ) THEN
93  DO 40 j = 1, n
94  DO 30 i = 1, m
95  a( i, j ) = conjg( b( j, i ) ) + alpha * a( i, j )
96  30 CONTINUE
97  40 CONTINUE
98  ELSE
99  DO 60 j = 1, n
100  DO 50 i = 1, m
101  a( i, j ) = conjg( b( j, i ) ) + a( i, j )
102  50 CONTINUE
103  60 CONTINUE
104  END IF
105  ELSE IF( beta.NE.zero ) THEN
106  IF( alpha.EQ.zero ) THEN
107  DO 80 j = 1, n
108  DO 70 i = 1, m
109  a( i, j ) = beta * conjg( b( j, i ) )
110  70 CONTINUE
111  80 CONTINUE
112  ELSE IF( alpha.NE.one ) THEN
113  DO 100 j = 1, n
114  DO 90 i = 1, m
115  a( i, j ) = beta * conjg( b( j, i ) ) +
116  $ alpha * a( i, j )
117  90 CONTINUE
118  100 CONTINUE
119  ELSE
120  DO 120 j = 1, n
121  DO 110 i = 1, m
122  a( i, j ) = beta * conjg( b( j, i ) ) + a( i, j )
123  110 CONTINUE
124  120 CONTINUE
125  END IF
126  ELSE
127  IF( alpha.EQ.zero ) THEN
128  DO 140 j = 1, n
129  DO 130 i = 1, m
130  a( i, j ) = zero
131  130 CONTINUE
132  140 CONTINUE
133  ELSE IF( alpha.NE.one ) THEN
134  DO 160 j = 1, n
135  CALL cscal( m, alpha, a( 1, j ), 1 )
136 * DO 150 I = 1, M
137 * A( I, J ) = ALPHA * A( I, J )
138 * 150 CONTINUE
139  160 CONTINUE
140  END IF
141  END IF
142  ELSE
143  IF( beta.EQ.one ) THEN
144  IF( alpha.EQ.zero ) THEN
145  DO 180 j = 1, m
146  DO 170 i = 1, n
147  a( j, i ) = conjg( b( i, j ) )
148  170 CONTINUE
149  180 CONTINUE
150  ELSE IF( alpha.NE.one ) THEN
151  DO 200 j = 1, m
152  DO 190 i = 1, n
153  a( j, i ) = conjg( b( i, j ) ) + alpha * a( j, i )
154  190 CONTINUE
155  200 CONTINUE
156  ELSE
157  DO 220 j = 1, m
158  DO 210 i = 1, n
159  a( j, i ) = conjg( b( i, j ) ) + a( j, i )
160  210 CONTINUE
161  220 CONTINUE
162  END IF
163  ELSE IF( beta.NE.zero ) THEN
164  IF( alpha.EQ.zero ) THEN
165  DO 240 j = 1, m
166  DO 230 i = 1, n
167  a( j, i ) = beta * conjg( b( i, j ) )
168  230 CONTINUE
169  240 CONTINUE
170  ELSE IF( alpha.NE.one ) THEN
171  DO 260 j = 1, m
172  DO 250 i = 1, n
173  a( j, i ) = beta * conjg( b( i, j ) ) +
174  $ alpha * a( j, i )
175  250 CONTINUE
176  260 CONTINUE
177  ELSE
178  DO 280 j = 1, m
179  DO 270 i = 1, n
180  a( j, i ) = beta * conjg( b( i, j ) ) + a( j, i )
181  270 CONTINUE
182  280 CONTINUE
183  END IF
184  ELSE
185  IF( alpha.EQ.zero ) THEN
186  DO 300 j = 1, n
187  DO 290 i = 1, m
188  a( i, j ) = zero
189  290 CONTINUE
190  300 CONTINUE
191  ELSE IF( alpha.NE.one ) THEN
192  DO 320 j = 1, n
193  CALL cscal( m, alpha, a( 1, j ), 1 )
194 * DO 310 I = 1, M
195 * A( I, J ) = ALPHA * A( I, J )
196 * 310 CONTINUE
197  320 CONTINUE
198  END IF
199  END IF
200  END IF
201 *
202  RETURN
203 *
204 * End of CMMDDACT
205 *
206  END
cmmddact
subroutine cmmddact(M, N, ALPHA, A, LDA, BETA, B, LDB)
Definition: cmmddact.f:2