pub fn dot_2d_1d<T>(x: &Vec2d<T>, y: &Vec<T>) -> Vec<T>
where
    T: Float,
{
    assert_eq!(x[0].len(), y.len());
    let mut dst: Vec<T> = Vec::new();
    for jj in 0..x.len() {
        dst.push(
            (0..x[0].len())
                .map(|ii| x[jj][ii] * y[ii])
                .collect::<Vec<T>>()
                .sum(),
        );
    }
    dst
}
/// inner product of 2D and 1D vectors
inner product of 2D and 1D vectors
inner product of 2D and 1D vectors
pub fn dot_2d_1d<T>(x: &Vec2d<T>, y: &Vec<T>) -> Vec<T>
where
    T: Float,
{
    assert_eq!(x[0].len(), y.len());
    let mut dst: Vec<T> = Vec::new();
    for jj in 0..x.len() {
        dst.push(
            (0..x[0].len())
                .map(|ii| x[jj][ii] * y[ii])
                .collect::<Vec<T>>()
                .sum(),
        );
    }
    dst
}
pub fn dot_2d_1d < T > ( x : & Vec2d < T > , y : & Vec < T > ) -> Vec < T > where T : Float , { assert_eq ! ( x [ 0 ] len ( ) y len ( ) ) ; let mut dst : Vec < T > = Vec :: new ( ) ; for jj in 0 .. x . len ( ) { dst . push ( ( 0 .. x [ 0 ] . len ( ) ) . map ( | ii | x [ jj ] [ ii ] * y [ ii ] ) . collect :: < Vec < T > > ( ) . sum ( ) , ) ; } dst }
inner product of 2D and 1D vectors
inner product of 2D and 1D vectors
x
&Vec2d<T>
y
&Vec<T>
x
&Vec2d<T>
y
&Vec<T>