d4_dgemv Subroutine

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

Arguments

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

Source Code

pure subroutine d4_dgemv(amat, xvec, yvec, alpha, beta, trans)
   real(dp), intent(in) :: amat(:, :)
   real(dp), intent(in) :: xvec(:)
   real(dp), intent(inout) :: yvec(:)
   real(dp), intent(in), optional :: alpha
   real(dp), intent(in), optional :: beta
   character(len=1), intent(in), optional :: trans
   real(dp) :: a, b
   character(len=1) :: tra
   integer(ik) :: incx, incy, m, n, lda
   if (present(alpha)) then
      a = alpha
   else
      a = 1.0_dp
   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_dgemv