Skip to content

Commit 7151b96

Browse files
committed
Fix for removing MatrixLayout::as_shape
1 parent 15cddfd commit 7151b96

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ndarray-linalg/src/convert.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,17 @@ pub fn into_matrix<A, S>(l: MatrixLayout, a: Vec<A>) -> Result<ArrayBase<S, Ix2>
3535
where
3636
S: DataOwned<Elem = A>,
3737
{
38-
Ok(ArrayBase::from_shape_vec(l.as_shape(), a)?)
38+
let (row, col) = l.size();
39+
Ok(ArrayBase::from_shape_vec((row as usize, col as usize), a)?)
3940
}
4041

4142
fn uninitialized<A, S>(l: MatrixLayout) -> ArrayBase<S, Ix2>
4243
where
4344
A: Copy,
4445
S: DataOwned<Elem = A>,
4546
{
46-
unsafe { ArrayBase::uninitialized(l.as_shape()) }
47+
let (row, col) = l.size();
48+
unsafe { ArrayBase::uninitialized((row as usize, col as usize)) }
4749
}
4850

4951
pub fn replicate<A, Sv, So, D>(a: &ArrayBase<Sv, D>) -> ArrayBase<So, D>

0 commit comments

Comments
 (0)