From d6fb07dad27f3851640f1a727468ca39322b91df Mon Sep 17 00:00:00 2001 From: Jack Wrenn Date: Wed, 7 Nov 2018 18:04:52 -0500 Subject: [PATCH] Introduce `from_vec`, to complement `from_vec_generic` --- src/base/construction.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/base/construction.rs b/src/base/construction.rs index 85469fff..64302a33 100644 --- a/src/base/construction.rs +++ b/src/base/construction.rs @@ -596,6 +596,13 @@ macro_rules! impl_constructors( ) -> Self { 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) -> Self { + Self::from_vec_generic($($gargs, )* data) + } } impl MatrixMN