Subroutine: MATVEC_PRODUCT Purpose: 3-dimensional matrix - vector product Category: MATH File: irco.shl Author: Do Kester Use: call MATVEC_PRODUCT( RMAT, I double precision array(3,3) X, I double precision array(3,N) Y, O double precision array(3,N) N ) I integer N Number of X and Y vectors X an array with N 3-dimensional (column) vectors RMAT a 3 x 3 matrix Y an array with N (column) vectors, Y = RMAT times X Description: Mainly meant as a shorthand for Y(i,j) = RMAT(i,1) * X(1,j) + RMAT(i,2) * X(2,j) + RMAT(i,3) * X(3,j) Use it with N=1 for simple 3-dimensional vectors, with N=3 for 3 x 3 matrix multiplication, with arbitrary N for e.g. large volume coordinate transformations. It is allowed that X and Y are the same array. Peculiar things will happen if you use it for matrix multiplication, and RMAT and Y are the same array. Update: 880112 Timo Prusti & Peter Arendz : standarized 870518 Albrecht de Jonge documentation improved 850625 Albrecht de Jonge