1 SUBROUTINE pbcvecadd( ICONTXT, MODE, N, ALPHA, X, INCX, BETA, Y,
10 INTEGER ICONTXT, INCX, INCY, N
14 COMPLEX X( * ), Y( * )
77 parameter( zero = ( 0.0e+0, 0.0e+0 ) )
78 parameter( one = ( 1.0e+0, 0.0e+0 ) )
88 EXTERNAL cscal, ccopy, caxpy
95 IF( n.LE.0 .OR. ( alpha.EQ.zero .AND. beta.EQ.one ) )
RETURN
97 IF( alpha.EQ.zero )
THEN
98 IF( beta.EQ.zero )
THEN
112 IF( lsame( mode,
'V' ) )
THEN
113 CALL cscal( n, beta, y, incy )
114 ELSE IF( incy.EQ.1 )
THEN
116 y( i ) = beta * y( i )
121 y( iy ) = beta * y( iy )
127 ELSE IF( .NOT.lsame( mode,
'C' ) )
THEN
128 IF( alpha.EQ.one )
THEN
129 IF( beta.EQ.zero )
THEN
130 IF( lsame( mode,
'V' ) )
THEN
131 CALL ccopy( n, x, incx, y, incy )
132 ELSE IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
146 ELSE IF( beta.EQ.one )
THEN
147 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
149 y( i ) = x( i ) + y( i )
155 y( iy ) = x( ix ) + y( iy )
162 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
164 y( i ) = x( i ) + beta * y( i )
170 y( iy ) = x( ix ) + beta * y( iy )
178 IF( beta.EQ.zero )
THEN
179 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
181 y( i ) = alpha * x( i )
193 ELSE IF( beta.EQ.one )
THEN
194 IF( lsame( mode,
'V' ) )
THEN
195 CALL caxpy( n, alpha, x, incx, y, incy )
196 ELSE IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
198 y( i ) = alpha * x( i ) + y( i )
204 y( iy ) = alpha * x( ix ) + y( iy )
211 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
213 y( i ) = alpha * x( i ) + beta * y( i )
219 y( iy ) = alpha * x( ix ) + beta * y( iy )
228 IF( alpha.EQ.one )
THEN
229 IF( beta.EQ.zero )
THEN
230 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
232 y( i ) = conjg( x( i ) )
238 y( iy ) = conjg( x( ix ) )
244 ELSE IF( beta.EQ.one )
THEN
245 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
247 y( i ) = conjg( x( i ) ) + y( i )
253 y( iy ) = conjg( x( ix ) ) + y( iy )
260 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
262 y( i ) = conjg( x( i ) ) + beta * y( i )
268 y( iy ) = conjg( x( ix ) ) + beta * y( iy )
276 IF( beta.EQ.zero )
THEN
277 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
279 y( i ) = alpha * conjg( x( i ) )
285 y( iy ) = alpha * conjg( x( ix ) )
291 ELSE IF( beta.EQ.one )
THEN
292 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
294 y( i ) = alpha * conjg( x( i ) ) + y( i )
300 y( iy ) = alpha * conjg( x( ix ) ) + y( iy )
307 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
309 y( i ) = alpha * conjg( x( i ) ) + beta * y( i )
315 y( iy ) = alpha * conjg( x(ix) ) + beta * y( iy )