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

Fix StandardAssociateUnit for polynomial rings to return a polynomial, not an element of the coefficient ring #3611

Merged
merged 1 commit into from
Sep 9, 2019

Conversation

fingolfin
Copy link
Member

By definition in the documentation, the returned unit must be an element of the ring.

The drawback of this is that it makes StandardAssociateUnit a bit less efficient: converting the unit into a polynomial introduces overhead in terms of memory and runtime. And for typical applications of this (e.g. implementing row reductions in a matrix), it doesn't matter, as all we really need is that for inputs a and b we get a "unit" u such that a * u = b and a = b * u^-1 hold.

So an alternative to this PR would be to adjust the documentation, and also checkStandardAssociate.

Thoughts, anybody?

@fingolfin fingolfin added kind: bug Issues describing general bugs, and PRs fixing them topic: library kind: discussion discussions, questions, requests for comments, and so on gapsingular2019 Issues and PRs that arose at https://opendreamkit.org/meetings/2019-04-02-GAPSingularMeeting labels Aug 20, 2019
@DominikBernhardt DominikBernhardt added the release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes label Aug 21, 2019
By definition in the documentation, the returned unit must be an
element of the ring.
@codecov
Copy link

codecov bot commented Aug 21, 2019

Codecov Report

Merging #3611 into master will decrease coverage by 12.36%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           master    #3611       +/-   ##
===========================================
- Coverage   84.64%   72.27%   -12.37%     
===========================================
  Files         698      635       -63     
  Lines      345549   308790    -36759     
===========================================
- Hits       292482   223174    -69308     
- Misses      53067    85616    +32549
Impacted Files Coverage Δ
lib/ratfunul.gi 83.36% <100%> (-2.4%) ⬇️
lib/ringpoly.gi 71.59% <100%> (-5.57%) ⬇️
lib/teachm2.g 15.38% <0%> (-84.62%) ⬇️
lib/ctblauto.gi 5.98% <0%> (-83.67%) ⬇️
lib/helpt2t.gi 0.23% <0%> (-83.14%) ⬇️
lib/proto.gi 1.03% <0%> (-82.48%) ⬇️
src/compiler.c 8% <0%> (-80.68%) ⬇️
lib/ctbllatt.gi 0.81% <0%> (-79.99%) ⬇️
src/trans.h 7.69% <0%> (-78.03%) ⬇️
lib/algliess.gi 0.99% <0%> (-74.54%) ⬇️
... and 383 more

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 84.405% when pulling 14b7293 on fingolfin:mh/zmodnz-polynomial into 659250f on gap-system:master.

@wilfwilson
Copy link
Member

So an alternative to this PR would be to adjust the documentation...

What would the documentation say in the case? Something like

...returns a unit in some ring whose elements can be multiplied with those of R with the property that..."?

I think it would also need an explanation for why it was this way, otherwise it would seem a bit weird.

To be honest I don't really mind, I've never used this function directly and don't think I would do anytime soon. From my mathematical point of view, I think I prefer the behaviour and documentation as this PR makes things.

I understand the inefficiency side of things. Could this be perhaps accommodated with another function with a different name?

@fingolfin fingolfin merged commit 511e9ad into gap-system:master Sep 9, 2019
@fingolfin
Copy link
Member Author

I suggest we backport this to 4.11, simply because several other fixes for StandardAssociateUnit are already in there. However, if people prefer to defer this to 4.12, I don't mind either.

@fingolfin fingolfin deleted the mh/zmodnz-polynomial branch September 9, 2019 22:09
@hulpke
Copy link
Contributor

hulpke commented Sep 9, 2019

Yes, please backport.

@fingolfin
Copy link
Member Author

Backported in commit a3d9c0a

@fingolfin fingolfin changed the title Fix StandardAssociateUnit for polynomial rings Fix StandardAssociateUnit for polynomial rings to return a polynomial, not an element of the coefficient ring Nov 28, 2019
@fingolfin fingolfin added release notes: added PRs introducing changes that have since been mentioned in the release notes and removed release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Dec 5, 2019
@olexandr-konovalov olexandr-konovalov added this to the GAP 4.11.0 milestone Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-4.11-DONE gapsingular2019 Issues and PRs that arose at https://opendreamkit.org/meetings/2019-04-02-GAPSingularMeeting kind: bug Issues describing general bugs, and PRs fixing them kind: discussion discussions, questions, requests for comments, and so on release notes: added PRs introducing changes that have since been mentioned in the release notes topic: library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants