outer_product Function

public pure function outer_product(a, b) result(c)

Computes the outer product of the two vectors.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: a
real(kind=wp), intent(in), dimension(:) :: b

Return Value real(kind=wp), dimension(size(a),size(b))


Source Code

    pure function outer_product(a,b) result(c)

    implicit none

    real(wp),dimension(:),intent(in)    :: a
    real(wp),dimension(:),intent(in)    :: b
    real(wp),dimension(size(a),size(b)) :: c

    integer :: i

    do i=1,size(b)
        c(:,i) = a*b(i)
    end do

    end function outer_product