diff --git a/linear_ops/src/macros/matrix.rs b/linear_ops/src/macros/matrix.rs index 184b2c9..c04e965 100644 --- a/linear_ops/src/macros/matrix.rs +++ b/linear_ops/src/macros/matrix.rs @@ -12,6 +12,13 @@ macro_rules! impl_matrix { self.array } #[inline] + pub fn from_rows(rows:[Vector;Y])->Self + { + Matrix::new( + rows.map(|row|row.array), + ) + } + #[inline] pub fn map(self,f:F)->Matrix where F:Fn(T)->U