Introduce `from_vec`, to complement `from_vec_generic`

This commit is contained in:
Jack Wrenn 2018-11-07 18:04:52 -05:00 committed by Sébastien Crozet
parent 68bdb427cf
commit d6fb07dad2
1 changed files with 7 additions and 0 deletions

View File

@ -596,6 +596,13 @@ macro_rules! impl_constructors(
) -> Self { ) -> Self {
Self::from_distribution_generic($($gargs, )* distribution, rng) Self::from_distribution_generic($($gargs, )* distribution, rng)
} }
/// Creates a matrix backed by a given vector.
#[inline]
#[cfg(feature = "std")]
pub fn from_vec($($args: usize,)* data: Vec<N>) -> Self {
Self::from_vec_generic($($gargs, )* data)
}
} }
impl<N: Scalar, $($DimIdent: $DimBound, )*> MatrixMN<N $(, $Dims)*> impl<N: Scalar, $($DimIdent: $DimBound, )*> MatrixMN<N $(, $Dims)*>