Nemocas / AbstractAlgebra.jl

Generic abstract algebra functionality in pure Julia (no C dependencies)
https://nemocas.github.io/AbstractAlgebra.jl/dev/index.html
Other
163 stars 63 forks source link

Can MPoly replace SparsePoly module #221

Open wbhart opened 5 years ago

wbhart commented 5 years ago

We currently have a module SparsePoly used exclusively for the gcd function in MPoly. However, there is no particular reason why we couldn't try using MPoly to represent sparse polynomials. One would construct an MPoly ring in a single variable, with coefficients in another MPoly ring.

One downside is that the MPoly interface implements heap algorithms for things like division, rather than schoolbook algorithms. This is not really needed for SparsePoly's in a single variable.

The advantage might be less code, and better test code. However, it's not trivial as the SparsePoly module needs to implement operations not available for general multivariates.

I don't think Jit compilation will be reduced, because instead of compiling a SparsePoly module, you are now compiling an MPoly module over another MPoly type, which is a different type than what you started with, so it still has to Jit compile.

rfourquet commented 4 years ago

Related to SparsePoly: they are not documented nor tested... should I open a separate issue?

wbhart commented 4 years ago

No, they are internal only and tested via gcd. They aren't documented or tested because they shouldn't be used by the user.