Multidimensional Matrix Mathematics implementation