Subroutine to compute y = a x + y where a is a scalar and x and y are arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ndarray), | intent(inout) | :: | this | |||
real(kind=pfdp), | intent(in) | :: | a | |||
class(pf_encap_t), | intent(in) | :: | x | |||
integer, | intent(in), | optional | :: | flags |
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