z_eq_sy_plus_x.F
c**********************************************************************
#include "author.inc"
c* $Id: z_eq_sy_plus_x.F,v 1.6 1995/07/30 17:49:45 turner Exp $
c*
c* Computes z = s*y + x.
c*
c* <PARAMETER LIST>
c*
c* Input:
c* n - number of elements
c* x - x-vector
c* y - y-vector
c*
c* Output:
c* z - z-vector
c* status - return status
c*
#include "copyright.inc"
c**********************************************************************
subroutine JT_z_eq_sy_plus_x (n, s, x, y, z, status)
implicit none
c
c ... Input:
integer n
real s, x(n), y(n)
c
c ... Output:
integer status
real z(n)
c
c ... Local:
#ifdef use_blas
real one
parameter (one=1.0d0)
c
call SCOPY (n, y, 1, z, 1) ! z = y
call SSCAL (n, s, z, 1) ! z = s*z
call SAXPY (n, one, x, 1, z, 1) ! z = z + x
#else
integer i
c
do i=1,n
z(i) = s*y(i) + x(i)
enddo
#endif
c
status = 0
return
end