Calculates outer product
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=double), | intent(in), | dimension(:) | :: | a | ||
real(kind=double), | intent(in), | dimension(:) | :: | b |
function outerprod(a,b)
!+ Calculates outer product
real(double), dimension(:), intent(IN) :: a,b
real(double), dimension(size(a),size(b)) :: outerprod
outerprod = spread(a,dim=2,ncopies=size(b)) * &
spread(b,dim=1,ncopies=size(a))
end function outerprod