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

usolve misses solutions #1748

Closed
cshaa opened this issue Feb 22, 2020 · 3 comments · Fixed by #1916
Closed

usolve misses solutions #1748

cshaa opened this issue Feb 22, 2020 · 3 comments · Fixed by #1916

Comments

@cshaa
Copy link
Collaborator

cshaa commented Feb 22, 2020

The usolve function can only find solutions of non-degenerate matrices. On degenerate ones, it automatically sets the free parameters to zero, only returning one solution out of many. For null b it only returns null vectors as a result. Example:

M = [[-2,3,5],[0,-1,2],[0,0,0]]
b = [0,0,0]

math.usolve(M, b)
// returns [[0], [0], [0]]
// correct result [5.5, 2, 1]

(Also, the returned array is two-dimensional for some reason.)

EDIT: Related to #1168. Since all non-square matrices are degenerate.
EDIT: Also true for lsolve and lusolve.

@cshaa
Copy link
Collaborator Author

cshaa commented Mar 15, 2020

I couldn't find a general back-substituion algorithm for singular matrices, so I spent some time figuring it out. I wrote this paper explaining why I think my algorithm is correct. Hopefully, I'll make a PR soon.

@josdejong
Copy link
Owner

Thanks for sharing your work Michal!

@josdejong
Copy link
Owner

Published now in v7.3.0 🎉

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 a pull request may close this issue.

2 participants