Implements the outer product of two vectors, c(i, j) = a(i) * b(j)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | a(:) |
First vector |
||
| real(kind=wp), | intent(in) | :: | b(:) |
Second vector |
Outer product matrix
pure function outerprod(a, b) result(c) !> First vector real(wp), intent(in) :: a(:) !> Second vector real(wp), intent(in) :: b(:) !> Outer product matrix real(wp) :: c(size(a), size(b)) integer :: i, j do j = 1, size(b) do i = 1, size(a) c(i, j) = a(i) * b(j) end do end do end function outerprod