Commit 05fcca8
peng.li24
fix(linalg.inv): zero output on failure to prevent silent data corruption
When blas_ops::inv returns false (LAPACK unavailable or singular),
the output buffer previously held the unmodified copy of A — which
callers could mistake for a valid inverse. Now zeros the output
on failure so the caller sees unambiguous garbage rather than the
original matrix disguised as the inverse.
Callers MUST check the return value. The pybind11 wrapper already
throws std::runtime_error on failure.1 parent 64f66ad commit 05fcca8
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
| |||
0 commit comments