-
Notifications
You must be signed in to change notification settings - Fork 64
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
Checking invertibility of matrices and solvability of linear equations #635
Comments
Yes, the linear algebra solving part needs some love. There will be a |
Agreed. I think isinvertible would be the canonical name. And as @thofma has suggested, can_solve seems to be the name of choice elsewhere for solve. If you want to implement something like this, feel free. Extra points if it is relatively fast with early termination in the case that it is not invertible/soluble. |
The methods are in principle at https://github.com/thofma/Hecke.jl/blob/master/src/Misc/Matrix.jl#L1759-L1787, but as you/we noticed they are probably transposing too much :) It is a bit messy to get all the combinations of left/right and w/o kernel right. In view of Nemocas/Nemo.jl#862, it should probably be |
Thanks for the quick replies, I will try to implement this in the next few days. (No promises though, because I don't know how much effort it may be.) |
The functions to invert a matrix or solve a system of linear equations such as
solve
,solve_left
, orinv
currently throw an unspecificErrorException
. For example:There doesn't appear to be a convenient way to check beforehand if a solution is exists.
In a user program, it is hard to catch the exception and figure out the source of the problem: Is it an unsolvable problem, a bug, a memory exception, ...?
For this reason, I believe it would be useful to have functions that can be called to tell if the problem is solvable (for example
isinvertible
orhasinv
); and/or functions that return a union type (for exampletry_solve
).The text was updated successfully, but these errors were encountered: