//----------------------
// a slice of slices is a really dumb representation for a matrix
// but we do not require performance where this is used, so whatever
a slice of slices is a really dumb representation for a matrix
but we do not require performance where this is used, so whatever
a slice of slices is a really dumb representation for a matrix but we do not require performance where this is used so whatever
fn dot_vec_mat_dumb(vec: &[f64], mat: &[&[f64]]) -> Vec<f64>
{
    assert_eq!(mat.len(), vec.len());
    assert_ne!(mat.len(), 0, "cannot determine width of matrix with no rows");
    let init = v(vec![0.0; mat[0].len()]);
    let V(out) = izip!(mat, vec)
        .fold(init, |acc, (&row, &alpha)| acc + alpha * v(row));
    out
}
fn dot_vec_mat_dumb ( vec : & [ f64 ] , mat : & [ & [ f64 ] ] ) -> Vec < f64 > { assert_eq ! ( mat len ( ) vec len ( ) ) ; assert_ne ! ( mat len ( ) 0 " " ) ; let init = v ( vec ! [ 0.0 mat [ 0 ] len ( ) ] ) ; let V ( out ) = izip ! ( mat vec ) . fold ( init , | acc , ( & row , & alpha ) | acc + alpha * v ( row ) ) ; out }
a slice of slices is a really dumb representation for a matrix
but we do not require performance where this is used, so whatever
a slice of slices is a really dumb representation for a matrix but we do not require performance where this is used so whatever
vec
&[f64]
mat
&[&[f64]]