Skip to content

Simplify input constraints for some polynomial multiplication functions #2680

@vneiger

Description

@vneiger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions