pub(crate) fn vector_to_array<'a, T, U>(buf: &mut String, name: &str, vector: &'a T)
where
    T: AsVector<'a, U>,
    U: 'a + std::fmt::Display,
{
    write!(buf, "{}=np.array([", name).unwrap();
    let m = vector.vec_size();
    for i in 0..m {
        write!(buf, "{},", vector.vec_at(i)).unwrap();
    }
    write!(buf, "],dtype=float)\n").unwrap();
}
/// Converts vector to a 1D NumPy array
Converts vector to a 1D NumPy array
Converts vector to a 1D NumPy array
pub(crate) fn vector_to_array<'a, T, U>(buf: &mut String, name: &str, vector: &'a T)
where
    T: AsVector<'a, U>,
    U: 'a + std::fmt::Display,
{
    write!(buf, "{}=np.array([", name).unwrap();
    let m = vector.vec_size();
    for i in 0..m {
        write!(buf, "{},", vector.vec_at(i)).unwrap();
    }
    write!(buf, "],dtype=float)\n").unwrap();
}
pub ( crate ) fn vector_to_array < ' a , T , U > ( buf : & mut String , name : & str , vector : & ' a T ) where T : AsVector < ' a , U > , U : ' a + std :: fmt :: Display , { write ! ( buf " " name ) . unwrap ( ) ; let m = vector . vec_size ( ) ; for i in 0 .. m { write ! ( buf " " vector vec_at ( i ) ) . unwrap ( ) ; } write ! ( buf " \n " ) . unwrap ( ) ; }
Converts vector to a 1D NumPy array
Converts vector to a 1D NumPy array
buf
&mut String
name
&str
vector
&'a T
buf
&mut String
name
&str
vector
&'a T