dot

dot multiplication for compaitable vectors.

dot
(
size_t N
size_t K
T
E
)
(
auto ref const(Vector!(N, T)) a
,
auto ref const(Vector!(K, E)) b
)
if (
(
N == K ||
K == 0
||
N == 0
)
&&
hasCompMltAndSum!(T, E)
)

Examples

auto a = vec3(1,2,3);
auto b = vecD(1,2,3);

assert( eq( dot(a,b), 1+4+9 ) );

Meta