Skip to content

Commit ef8482f

Browse files
committed
Fix Inverse/InverseInto for empty matrices
1 parent e48d127 commit ef8482f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lax/src/solve.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ macro_rules! impl_solve {
4242

4343
fn inv(l: MatrixLayout, a: &mut [Self], ipiv: &Pivot) -> Result<()> {
4444
let (n, _) = l.size();
45+
if n == 0 {
46+
// Do nothing for empty matrices.
47+
return Ok(());
48+
}
4549

4650
// calc work size
4751
let mut info = 0;

0 commit comments

Comments
 (0)