Multiply a p-vector by an r-matrix.
Status: vector/matrix support routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(3,3) | :: | r | r-matrix |
|
real(kind=wp), | intent(in), | dimension(3) | :: | p | p-vector |
|
real(kind=wp), | intent(out), | dimension(3) | :: | rp | R * P |
subroutine RXP ( r, p, rp )
implicit none
real(wp),dimension(3,3),intent(in) :: r !! r-matrix
real(wp),dimension(3),intent(in) :: p !! p-vector
real(wp),dimension(3),intent(out) :: rp !! R * P
real(wp) :: w, wrp(3)
integer :: i, j
! Matrix R * vector P.
do j=1,3
w = 0.0_wp
do i=1,3
w = w + r(j,i)*p(i)
end do
wrp(j) = w
end do
! Return the result.
call CP ( wrp, rp )
end subroutine RXP