Classes for univariate polynomial (elements) need refactoring. Some reasons are:
- Some classes are missing, such as for instance a generic class for polynomials over finite fields (only specialized class for some given implementation are provided).
- We need more abstract classes. To date, many classes directly inherit from the generic class
Polynomial
since (for instance) the classPolynomial_generic_dense
is concrete and thus fixes some data structure. Polynomials based on (say) Flint cannot use this data structure. - Based on the above, it seems useful for a polynomial class to support multiple inheritance. For instance, a class for sparse polynomials over
ZZ
should inherit both from a class for sparse polynomials, and a class forZZ
. This is impossible with Cython (which does not support multiple inheritance). - A consequence is also that many classes are directly in the class
Polynomial
with long spaghetti code made of tons ofif ...: ... else: ...
constructions