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

Add more setcoeff! methods and use them to deduplicate PolyRingElem constructors #1911

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lgoettgens
Copy link
Collaborator

Unfortunately this won't work as I try to access attributes/parents of elements in setcoeff! before they are set.
I see two ways to resolve this issue:

  1. All element constructors should get a parent. This will be a bigger change, in particular if we want to have this consistent for all poly types.
  2. setcoeff! gets an optional fourth argument, that is a UInt for nmod_poly-based types and a fmpz_mod_ctx_struct for fmpz_mod_poly-based types. If this fourth argument is not passed, we can reconstruct it (in many cases, but not inside of the constructors as parents are not available).

I would tend to 2 for now, and maybe remove this fourth argument again once 1 has made enough progress. What do you think @fingolfin ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant