-
Notifications
You must be signed in to change notification settings - Fork 70
Added new fn is_zero_det_probabilistic #2152
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
base: master
Are you sure you want to change the base?
Added new fn is_zero_det_probabilistic #2152
Conversation
|
This is currently restricted to |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2152 +/- ##
==========================================
+ Coverage 88.20% 88.31% +0.10%
==========================================
Files 99 100 +1
Lines 37079 37247 +168
==========================================
+ Hits 32707 32893 +186
+ Misses 4372 4354 -18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/flint/fmpq_mat.jl
Outdated
| catch IgnoreError | ||
| # The prime was bad, so we just ignore it | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The prime was bad, so we just ignore it" or your code triggers another error and it is not caught. This should test agains the real error and rethrow the error otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The prime was bad, so we just ignore it" or your code triggers another error and it is not caught. This should test against the real error and rethrow the error otherwise.
Modified the code; not sure what else it could throw (but maybe the coercion code will change in the future?) Really the documentation should also indicate which exceptions might be thrown...
|
There is a lot of code duplication. How much slower is it to just do |
Yes, there is duplication, but I don't know how to avoid that without risking a significant speed penalty in some cases, e.g. the current test uses a matrix 250x250 whose entries are |
|
Thanks for checking. I agree that the overhead of converting to |
Co-authored-by: Tommy Hofmann <[email protected]>
|
Converting to a non-draft PR. The extensions mentioned in comment 2 (near the start of this discussion) can be dealt with separately if there is call for them. |
| # we switch to larger 61-bit primes (which are faster amortized). | ||
|
|
||
| @doc raw""" | ||
| is_zero_det_probabilistic(M::QQMatrix; modulus_bitsize::Int = 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests whether "is_zero(det(M)) is probably true (if it returns true) and otherwise definitely false (if it returns false)
We have is_probable_prime so maybe this should be is_probably_zero_det (but sounds weird?).
Having it at end makes it easier to find, though.
Should this function be added to the documentation? It is currently being exported in this PR, which to me suggests it should be in the manual...
…bbott/Nemo.jl into JAA/NEW-is_zero_det_probabilistic
New heuristic function
is_zero_det_probabilistic; incl. doc & tests.