Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@xiaoyeli
As I communicated to you via email on July 24th, the current version of sequential SuperLU has a bug where rank deficient rectangular matrices are not computed properly. This is an important application as the LU decomposition of a sparse matrix is required for the Null Space Method of solving the Karush–Kuhn–Tucker (KKT) matrix which arises in Quadratic Programming applications such as constrained numerical minimization (see attached reference paper).
https://www.numerical.rl.ac.uk/people/rees/pdf/RAL-TR-2014-016.pdf
After doing some more testing, the bug does not occur for all rank deficient rectangular matrices, nor is it limited to rectangular matrices. A minimum example of a matrix in which this problem arises is (given in (row, col, value) notation):
(0, 0, 1.0)
(1, 0, 1.0)
(2, 1, 1.0)
(2, 2, 1.0)
After factoring the above matrix using dgstrf, the row permutations are given as (0, -1, 2), which are invalid permutations.
This pull request provides a fix for this issue. I have verified that the proposed solution passes your cmake test suite. In addition, I have ran the attached 9 test cases using the Matlab interface (modification also required and provided in this pull request). Some of these work using the current master branch, while others demonstrate the bug. All 9 test cases pass with the proposed changes.
TestMatrices.zip
I have not checked whether this issue is present using single precision of complex versions of the factorization.
Regards,
Evan