pub fn is_matrix(m: &[f64], nrows: usize) -> Result<usize, String>
Checks whether a 1D array is a valid matrix representation given the number of rows.