pub(crate) fn matrix_to_list<T>(buf: &mut String, name: &str, matrix: &Vec<Vec<T>>)
where
    T: std::fmt::Display,
{
    write!(buf, "{}=[", name).unwrap();
    for row in matrix.into_iter() {
        write!(buf, "[").unwrap();
        for val in row.into_iter() {
            write!(buf, "{},", val).unwrap();
        }
        write!(buf, "],").unwrap();
    }
    write!(buf, "]\n").unwrap();
}
/// Converts a matrix to a nested Python list
Converts a matrix to a nested Python list
Converts a matrix to a nested Python list
pub(crate) fn matrix_to_list<T>(buf: &mut String, name: &str, matrix: &Vec<Vec<T>>)
where
    T: std::fmt::Display,
{
    write!(buf, "{}=[", name).unwrap();
    for row in matrix.into_iter() {
        write!(buf, "[").unwrap();
        for val in row.into_iter() {
            write!(buf, "{},", val).unwrap();
        }
        write!(buf, "],").unwrap();
    }
    write!(buf, "]\n").unwrap();
}
pub ( crate ) fn matrix_to_list < T > ( buf : & mut String , name : & str , matrix : & Vec < Vec < T > > ) where T : std :: fmt :: Display , { write ! ( buf " " name ) . unwrap ( ) ; for row in matrix . into_iter ( ) { write ! ( buf " " ) . unwrap ( ) ; for val in row . into_iter ( ) { write ! ( buf " " val ) . unwrap ( ) ; } write ! ( buf " " ) . unwrap ( ) ; } write ! ( buf " \n " ) . unwrap ( ) ; }
Converts a matrix to a nested Python list
Converts a matrix to a nested Python list
buf
&mut String
name
&str
matrix
&Vec<Vec<T>>
buf
&mut String
name
&str
matrix
&Vec<Vec<T>>