pub fn dot_simd<F>(a: &ArrayView1<'_, F>, b: &ArrayView1<'_, F>) -> Fwhere
F: Float + SimdUnifiedOps,Expand description
SIMD-accelerated dot product
Computes sum(a * b).
§Arguments
a- First vectorb- Second vector
§Returns
Dot product (scalar)
§Examples
use scirs2_core::ndarray::array;
use scirs2_core::ndarray_ext::elementwise::dot_simd;
let a = array![1.0_f64, 2.0, 3.0];
let b = array![4.0_f64, 5.0, 6.0];
let d = dot_simd::<f64>(&a.view(), &b.view());
// 1*4 + 2*5 + 3*6 = 4 + 10 + 18 = 32
assert!((d - 32.0).abs() < 1e-14);§Use Cases
- Projection calculations
- Cosine similarity numerator
- Attention scores
- Linear layer computation