Sanity check error on SwapRows (#156)

master
Michael Cook 2020-12-17 00:38:25 -08:00 committed by GitHub
parent 60143f4a15
commit c81ca04b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -218,7 +218,10 @@ func (m matrix) gaussianElimination() error {
if m[r][r] == 0 {
for rowBelow := r + 1; rowBelow < rows; rowBelow++ {
if m[rowBelow][r] != 0 {
m.SwapRows(r, rowBelow)
err := m.SwapRows(r, rowBelow)
if err != nil {
return err
}
break
}
}