Program f16ehfe
! F16EHF Example Program Text
! Mark 25 Release. NAG Copyright 2014.
! .. Use Statements ..
Use nag_library, Only: blas_dwaxpby, nag_wp
! .. Implicit None Statement ..
Implicit None
! .. Parameters ..
Integer, Parameter :: nin = 5, nout = 6
! .. Local Scalars ..
Real (Kind=nag_wp) :: alpha, beta
Integer :: incw, incx, incy, n, nw, nx, ny
! .. Local Arrays ..
Real (Kind=nag_wp), Allocatable :: w(:), x(:), y(:)
! .. Intrinsic Procedures ..
Intrinsic :: abs
! .. Executable Statements ..
Write (nout,*) 'F16EHF Example Program Results'
! Skip heading in data file
Read (nin,*)
Read (nin,*) n
Read (nin,*) incx, incy, incw
nw = 1 + (n-1)*abs(incw)
nx = 1 + (n-1)*abs(incx)
ny = 1 + (n-1)*abs(incy)
Allocate (w(nw),x(nx),y(ny))
Read (nin,*) alpha, beta
Read (nin,*) x(1:nx:abs(incx))
Read (nin,*) y(1:ny:abs(incy))
! Compute W = alpha*X + beta*Y
Call blas_dwaxpby(n,alpha,x,incx,beta,y,incy,w,incw)
Write (nout,*)
Write (nout,99999)
Write (nout,99998) w(1:nw:abs(incw))
99999 Format (1X,'Result of scaled vector addition is')
99998 Format (1X,'W =',5F9.4)
End Program f16ehfe