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
mat: Should Factorization routines check for the condition number? #750
Comments
It's not clear to me how this would work better than what we have. The factorisation routines that we have that can fail return a boolean indicating success. Those that cannot do not. If the routine fails it should not be used, and the condition number can be obtained from the Are you suggesting the success booleans be replaced with |
ping |
That was my thought. It's mostly about future-proofing. For example, if we switched to an algorithm that also finds the set of vectors that cause that condition number (I know some of them exist, but don't know the runtime details). Or with respect to a future errors package, it might be nice to implant more context. In the map/type assignment case, there's no extra information, it is or it isn't. In the factorization there's plausibly more information (most notably the condition number). An error type future-proofs against a lot of changes, a boolean doesn't, especially if the future is going to look like: ok := chol.Factorize(a) |
OK |
I mean, it's not clear the benefit is there, I was just explaining the thought. |
We need a decision one way or the other though. |
It sounds like you still lean toward the boolean version? |
Looking at the methods, it seems like the |
Yep. With that we can be free with API. Even though error contents should not be relied on, they are (we do in tests for example), so making error returns a thing makes that more constrictive. |
It may be that factorization routines should check the condition number and return an error. This would make the failure happen earlier. For example, when using
chol.Factorize()
, and thenSolveCholesky
.In most cases we cannot find the condition number before doing the factorization (since factorizing is how one frequently finds the condition number), but we can compute the condition number (like we already do) and return an ErrCond.
The text was updated successfully, but these errors were encountered: