Some functions (e.g. _nmod_poly_mullow, _fmpz_poly_mulhigh, ...) take as input to polynomials to be multiplied, and require than the first has length greater than or equal to the second. This can easily be overlooked because many other functions don't have this kind of requirement, leading to confusion or bugs (e.g., recently, #2679 ). Even when not overlooked, this requirement means that one has to add some logic to any piece of code using these functions as soon as it is not known a priori how the lengths compare.
Suggestion: remove this requirement, placing the logic / input swapping directly in these multiplication functions.
One thing to keep in mind, is to make sure that there is no meaningful context where this impacts performance.
Some functions (e.g.
_nmod_poly_mullow,_fmpz_poly_mulhigh, ...) take as input to polynomials to be multiplied, and require than the first has length greater than or equal to the second. This can easily be overlooked because many other functions don't have this kind of requirement, leading to confusion or bugs (e.g., recently, #2679 ). Even when not overlooked, this requirement means that one has to add some logic to any piece of code using these functions as soon as it is not known a priori how the lengths compare.Suggestion: remove this requirement, placing the logic / input swapping directly in these multiplication functions.
One thing to keep in mind, is to make sure that there is no meaningful context where this impacts performance.