scalar xᵀ × y
import mir.series; auto x = series([0u, 3, 5, 9, 100], [1, 3, 4, 9, 10]); auto y = series([1u, 3, 4, 9], [1, 10, 100, 1000]); // x = [1, 0, 0, 3, 0, 4, 0, 0, 0, 9, ... ,10] // y = [0, 1, 0, 10, 0, 0, 0, 0, 0, 1000] assert(dot(x, y) == 9030); assert(dot!double(x, y) == 9030);
Dot product of two vectors