matrix: from_rows

This commit is contained in:
Quaternions 2024-09-12 12:16:44 -07:00
parent 10e56fb0b9
commit ec82745c6d

View File

@ -12,6 +12,13 @@ macro_rules! impl_matrix {
self.array self.array
} }
#[inline] #[inline]
pub fn from_rows(rows:[Vector<X,T>;Y])->Self
{
Matrix::new(
rows.map(|row|row.array),
)
}
#[inline]
pub fn map<F,U>(self,f:F)->Matrix<X,Y,U> pub fn map<F,U>(self,f:F)->Matrix<X,Y,U>
where where
F:Fn(T)->U F:Fn(T)->U