Real numbers
import mir.ndslice; import mir.math; auto a = mininitRcslice!double(3, 5); auto b = mininitRcslice!double(5, 4); a[] = [[-5, 1, 7, 7, -4], [-1, -5, 6, 3, -3], [-5, -2, -3, 6, 0]]; b[] = [[-5, -3, 3, 1], [ 4, 3, 6, 4], [-4, -2, -2, 2], [-1, 9, 4, 8], [ 9, 8, 3, -2]]; assert(mtimes!(double, double)(a, b) == [[-42, 35, -7, 77], [-69, -21, -42, 21], [ 23, 69, 3, 29]]);
Complex numbers
import mir.complex; import mir.ndslice; import mir.math; auto a = mininitRcslice!(Complex!double)(3, 5); auto b = mininitRcslice!(Complex!double)(5, 4); a[] = [[-5, 1, 7, 7, -4], [-1, -5, 6, 3, -3], [-5, -2, -3, 6, 0]]; b[] = [[-5, -3, 3, 1], [ 4, 3, 6, 4], [-4, -2, -2, 2], [-1, 9, 4, 8], [ 9, 8, 3, -2]]; assert(mtimes!((Complex!double), (Complex!double))(a, b) == [[-42, 35, -7, 77], [-69, -21, -42, 21], [ 23, 69, 3, 29]]);