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
Improvement_of_dup_zz_mignotte_bound(f, K) #19254
Conversation
So, this is our change in the `dup_zz_mignotte_bound(f, K)` method. Also, we have replace the old value in the test_factortools.py file. If it is asked, we can cite our test_file with the comparison of the bounds.
✅ Hi, I am the SymPy bot (v158). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like: This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.7. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
n = dup_degree(f) | ||
|
||
return K.sqrt(K(n + 1))*2**n*a*b | ||
""" |
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.
It appears to be a public function. So, Parameters
and Examples
sections can be added in the doc strings.
Can someone help with the travis-ci test? |
You can click on details to know about the failures! |
Managed to fix the basic errors of travis ci test. But now a bit more complex one occurred. Can anyone help with this? |
This is the test failure
As you can see, the answer is wrong (it should be |
correction on dmp_sqf_norm
Codecov Report
@@ Coverage Diff @@
## master #19254 +/- ##
=============================================
- Coverage 75.667% 75.622% -0.046%
=============================================
Files 651 651
Lines 169487 169466 -21
Branches 40021 40014 -7
=============================================
- Hits 128247 128154 -93
- Misses 35623 35707 +84
+ Partials 5617 5605 -12 |
sympy/polys/factortools.py
Outdated
from sympy import binomial | ||
|
||
d = dup_degree(f) | ||
delta = _ceil( d / 2 ) |
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.
In SymPy, no space is added after (
and before )
. So this could be _ceil(d/2)
.
sympy/polys/factortools.py
Outdated
eucl_norm = K.sqrt( sum( [cf**2 for cf in f] ) ) | ||
|
||
# biggest values of binomial coefficients (p. 538 of reference) | ||
t1 = binomial( delta - 1, _ceil( delta / 2 ) ) |
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.
I would consider defining something like delta2 = _ceil(delta/2)
in addition to delta
and using it on this and the next line.
sympy/polys/factortools.py
Outdated
t1 = binomial( delta - 1, _ceil( delta / 2 ) ) | ||
t2 = binomial( delta - 1, _ceil( delta / 2 ) - 1 ) | ||
|
||
lc = abs( dup_LC(f, K) ) # leading coefficient |
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.
In principle, this could probably have K.abs
instead of abs
.
t2 = binomial( delta - 1, _ceil( delta / 2 ) - 1 ) | ||
|
||
lc = abs( dup_LC(f, K) ) # leading coefficient | ||
|
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.
This, and the next two blank lines could be removed.
@@ -27,7 +27,7 @@ def test_dmp_trial_division(): | |||
|
|||
def test_dup_zz_mignotte_bound(): | |||
R, x = ring("x", ZZ) | |||
assert R.dup_zz_mignotte_bound(2*x**2 + 3*x + 4) == 32 | |||
assert R.dup_zz_mignotte_bound(2*x**2 + 3*x + 4) == 6 |
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.
Perhaps there could be a couple of more examples, preferable with comments on actual bounds for comparison.
I have some comments but otherwise this looks good. |
Two examples also has been imported. I have not imported more as i am not so experienced in sympy's typing rules and mechanics. Your feedback is welcomed
One more example highlighting the difference between the old and the new method.
Thanks, this is ready to go. |
So, this is our change in the
dup_zz_mignotte_bound(f, K)
method. Also, we have replace the old value in the test_factortools.py file. If it is asked, we can cite our test_file with the comparison of the bounds. As it was mentioned, we have not create a new method but just change the code in thedup_zz_mignotte_bound(f, K)
.Fixes #19253
References to other Issues or PRs
Brief description of what is fixed or changed
dup_zz_mignotte_bound(f, K)
implemented with Knuth-CohenOther comments
As it was mentioned in the issue,
dmp_zz_mignotte_bound(f, u, K)
should also be cared of.Release Notes
dup_zz_mignotte_bound(f, K)
by Knuth-Cohen bound