Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rank Deficient Matrices #117

Merged
merged 4 commits into from
Sep 9, 2023
Merged

Conversation

evan-dsa
Copy link
Contributor

@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

Bug fix applies to some rank deficient rectangular matrices where m > n, where m is the number of rows and n is the number of columns.
Updated mex to work with rank deficient rectangular matrices
sparsfun is not supported in Matlab R2022a.  Use of this function suggests replacing with spparms.
@xiaoyeli xiaoyeli merged commit 0a65e1c into xiaoyeli:master Sep 9, 2023
xiaoyeli added a commit that referenced this pull request Sep 11, 2023
…um_consts.h

Resolved issue #108: correct the macro order of MemType in superlu_enum_consts.h;
Merged PR #116: complex -> singlecomplex (consistent with doublecomplex);
Merged PR #117: fill the missing perm_r[] for rank deficient cases;
Resolved issue #119: missing BLAS names in slu_Cnames.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants