How does the APL-style inner product operator (higher-order function), which accepts two function arguments and two arrays, generalize to more than two dimensions? I see that the result array has a number of dimensions equal to the sum of the dimensions of the arrays minus 2, and that the size of the last dimension of the first array m must equal the size of the first dimension of the second array n.
I'll assume without loss of generality that the functions are addition and multiplication. In one dimension, then, the corresponding elements of the vectors are multiplied and these products are added to produce the vector dot product (a scalar).
By the same token, in two dimensions the [m, n] element of the result matrix is the dot product of the mth column of the first matrix and the nth row of the second matrix.
But when I get to this point in descriptions of the inner product function, they usually say "with the obvious generalization to more dimensions" or else simply don't mention higher dimensions at all. That isn't very helpful. Can anyone explain how it is computed?