1 SUBROUTINE pbdvecadd( ICONTXT, MODE, N, ALPHA, X, INCX, BETA, Y,
10 INTEGER ICONTXT, INCX, INCY, N
11 DOUBLE PRECISION ALPHA, BETA
14 DOUBLE PRECISION X( * ), Y( * )
76 DOUBLE PRECISION ZERO, ONE
77 parameter( zero = 0.0d+0, one = 1.0d+0)
87 EXTERNAL dscal, dcopy, daxpy
91 IF( n.LE.0 .OR. ( alpha.EQ.zero .AND. beta.EQ.one ) )
RETURN
93 IF( alpha.EQ.zero )
THEN
94 IF( beta.EQ.zero )
THEN
108 IF( lsame( mode,
'V' ) )
THEN
109 CALL dscal( n, beta, y, incy )
110 ELSE IF( incy.EQ.1 )
THEN
112 y( i ) = beta * y( i )
117 y( iy ) = beta * y( iy )
124 IF( alpha.EQ.one )
THEN
125 IF( beta.EQ.zero )
THEN
126 IF( lsame( mode,
'V' ) )
THEN
127 CALL dcopy( n, x, incx, y, incy )
128 ELSE IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
142 ELSE IF( beta.EQ.one )
THEN
143 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
145 y( i ) = x( i ) + y( i )
151 y( iy ) = x( ix ) + y( iy )
158 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
160 y( i ) = x( i ) + beta * y( i )
166 y( iy ) = x( ix ) + beta * y( iy )
174 IF( beta.EQ.zero )
THEN
175 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
177 y( i ) = alpha * x( i )
189 ELSE IF( beta.EQ.one )
THEN
190 IF( lsame( mode,
'V' ) )
THEN
191 CALL daxpy( n, alpha, x, incx, y, incy )
192 ELSE IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
194 y( i ) = alpha * x( i ) + y( i )
200 y( iy ) = alpha * x( ix ) + y( iy )
207 IF( incx.EQ.1 .AND. incy.EQ.1 )
THEN
209 y( i ) = alpha * x( i ) + beta * y( i )
215 y( iy ) = alpha * x( ix ) + beta * y( iy )