1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::{
    blas::Blas,
    dim::Dim1,
    matrix::{MatrixBase, ViewMatrix},
    num::Num,
};

pub fn dot<T, X, Y>(x: X, y: Y) -> T
where
    T: Num,
    X: ViewMatrix + MatrixBase<Dim = Dim1, Item = T>,
    Y: ViewMatrix + MatrixBase<Dim = Dim1, Item = T>,
{
    assert_eq!(x.shape(), y.shape());
    X::Blas::dot(
        x.shape()[0],
        x.as_ptr(),
        x.stride()[0],
        y.as_ptr(),
        y.stride()[0],
    )
}