pub trait Dot: StorageElement d = ∑ᵢ aᵢ × bᵢ
Range: unbounded. Fails with Error::ShapeMismatch if lengths differ, or
Error::KernelFailed carrying the kernel's status.
Implemented for: f64, f32, f16, bf16, i8, u8, e4m3, e5m2, e2m3, e3m2,
i4x2, u4x2, u1x8.
On u1x8 this is the binary inner product — the number of positions where both bits are set —
which is the intersection count that Tanimoto similarity divides by the union. Use
crate::Jaccard when you want that ratio.
Examples
use numkong::Dot;
let first = vec![1.0_f32, 2.0, 3.0];
let second = vec![4.0_f32, 5.0, 6.0];
let result = f32::dot(&first, &second).unwrap();
assert!((result - 32.0).abs() < 1e-5);