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

delete some of the parent object (ring) printing code #1082

Closed
tthsqe12 opened this issue Jun 4, 2021 · 3 comments
Closed

delete some of the parent object (ring) printing code #1082

tthsqe12 opened this issue Jun 4, 2021 · 3 comments

Comments

@tthsqe12
Copy link
Contributor

tthsqe12 commented Jun 4, 2021

In connection with Nemocas/AbstractAlgebra.jl#887, it would be nice not to have, for example, the following pointless duplication

function show(io::IO, p::FmpzMPolyRing)
local max_vars = 5 # largest number of variables to print
n = nvars(p)
print(io, "Multivariate Polynomial Ring in ")
if n > max_vars
print(io, nvars(p))
print(io, " variables ")
end
for i = 1:min(n - 1, max_vars - 1)
print(io, string(p.S[i]), ", ")
end
if n > max_vars
print(io, "..., ")
end
print(io, string(p.S[n]))
print(io, " over ")
show(io, base_ring(p))
end

There is minimal required interface to get this working generically.

@wbhart
Copy link
Contributor

wbhart commented Jun 4, 2021

I'm afraid I have no idea what you mean, or how it is related to 887.

I will do MPoly last, but I am not putting any major effort into it at this time. I would like to make an abstract interface for MPolys, but it's not something I'm doing for that PR.

@tthsqe12
Copy link
Contributor Author

tthsqe12 commented Jun 7, 2021

What I mean is: once symbols and coefficient_ring are implemented, the printing can be implemented generically in terms of this required interface. There is no need for all of this code duplication.

@fingolfin
Copy link
Member

This one has been resolved quite some time ago in PR #1438

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

No branches or pull requests

3 participants