scalar x × y
import mir.series; auto x = [0u, 3, 5, 9, 10].series([1.0, 3, 4, 9, 13]); auto y = [0.0, 1.0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; // x: [1, 0, 0, 3, 0, 4, 0, 0, 0, 9, 13, 0, 0, 0] // y: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] auto r = 0 + 3 * 3 + 4 * 5 + 9 * 9 + 13 * 10; assert(dot(x, y) == r); assert(dot(x, y.sliced) == r); assert(dot(x, y.slicedField) == r);
Dot product of two vectors.