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

Issues with normalise for polynomials. #1651

Open
fingolfin opened this issue Apr 4, 2024 · 0 comments
Open

Issues with normalise for polynomials. #1651

fingolfin opened this issue Apr 4, 2024 · 0 comments

Comments

@fingolfin
Copy link
Member

This comes from a discussion on Nemocas/Nemo.jl#1652.

Most normalise methods in AA look like this

function normalise(a::Poly, n::Int)
   while n > 0 && iszero(a.coeffs[n])
      n -= 1
   end
   return n   # <- this is WRONG?!
end

However the documentation says normalise returns the length of the polynomial after normalisation, which is the degree PLUS ONE, which disagrees with what that code does.

In contrast, the normalise methods in Nemo seem to follow what the documentation does.

So: any code that has been using normalise probably is subtly broken: either it gives wrong results, or it is adapted to the wrong implementations of normalise. We need to figure out which it is and either adapt the documentation, or the implementations (probably both to some degree).

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

1 participant