Skip to content

Commit e0646e8

Browse files
committed
fix: assert sign in row-major views construction (whoops)
1 parent c595d26 commit e0646e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/nalgebra.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ where
1919
R: Dim,
2020
C: Dim,
2121
{
22-
assert!(slice.len() <= rows.value() * cols.value());
22+
assert!(slice.len() >= rows.value() * cols.value());
2323
Matrix::from_data(unsafe {
2424
ViewStorageMut::from_raw_parts(slice.as_mut_ptr(), (rows, cols), (cols, U1))
2525
})
@@ -30,7 +30,7 @@ where
3030
R: Dim,
3131
C: Dim,
3232
{
33-
assert!(slice.len() <= rows.value() * cols.value());
33+
assert!(slice.len() >= rows.value() * cols.value());
3434
Matrix::from_data(unsafe {
3535
ViewStorage::from_raw_parts(slice.as_ptr(), (rows, cols), (cols, U1))
3636
})

0 commit comments

Comments
 (0)