d4_sgemv Subroutine

private pure subroutine d4_sgemv(amat, xvec, yvec, alpha, beta, trans)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: amat(:,:)
real(kind=sp), intent(in) :: xvec(:)
real(kind=sp), intent(inout) :: yvec(:)
real(kind=sp), intent(in), optional :: alpha
real(kind=sp), intent(in), optional :: beta
character(len=1), intent(in), optional :: trans

Source Code

pure subroutine d4_sgemv(amat, xvec, yvec, alpha, beta, trans)
   real(sp), intent(in) :: amat(:, :)
   real(sp), intent(in) :: xvec(:)
   real(sp), intent(inout) :: yvec(:)
   real(sp), intent(in), optional :: alpha
   real(sp), intent(in), optional :: beta
   character(len=1), intent(in), optional :: trans
   real(sp) :: a, b
   character(len=1) :: tra
   integer(ik) :: incx, incy, m, n, lda
   if (present(alpha)) then
      a = alpha
   else
      a = 1.0_sp
   end if
   if (present(beta)) then
      b = beta
   else
      b = 0
   end if
   if (present(trans)) then
      tra = trans
   else
      tra = 'n'
   end if
   incx = 1
   incy = 1
   lda = max(1, size(amat, 1))
   m = size(amat, 1)
   n = size(amat, 2)
   call blas_gemv(tra, m, n, a, amat, lda, xvec, incx, b, yvec, incy)
end subroutine d4_sgemv