Use a dope vector to access arbitrary axial slices of a multidimensional array?
问题 I'm building a suite of functions to work with a multidimensional-array data structure and I want to be able to define arbitrary slices of the arrays so I can implement a generalized inner product of two arbitrary matrices (aka Tensors or n-d arrays ). An APL paper I read (I honestly can't find which -- I've read so many) defines the matrix product on left-matrix X with dimensions A;B;C;D;E;F and right-matrix Y with dimensions G;H;I;J;K where F==G as Z <- X +.× Y Z[A;B;C;D;E;H;I;J;K] <- +/ X