ndarray_axpy Subroutine

public subroutine ndarray_axpy(this, a, x, flags)

Subroutine to compute y = a x + y where a is a scalar and x and y are arrays

Arguments

Type IntentOptional AttributesName
class(ndarray), intent(inout) :: this
real(kind=pfdp), intent(in) :: a
class(pf_encap_t), intent(in) :: x
integer, intent(in), optional :: flags

Contents

Source Code


Source Code

  subroutine ndarray_axpy(this, a, x, flags)
    class(ndarray),    intent(inout)           :: this
    class(pf_encap_t), intent(in   )           :: x
    real(pfdp),        intent(in   )           :: a
    integer,           intent(in   ), optional :: flags

    select type(x)
    type is (ndarray)
       this%flatarray = a * x%flatarray + this%flatarray
    class default
       stop "TYPE ERROR"
    end select
  end subroutine ndarray_axpy