Skip to content

Large refactoring #356

Description

@blegat

This repository as well as DynamicPolynomials have accumulated a lot of technical depth due to bad design decisions and it is time to get rid of it.
The bad design decisions were

  1. Try to support *(::MP.AbstractPolynomialLike, ::Any) this creates a lot of invalidation and promotion rules are a mess. We should only support *(::MP.AbstractPolynomialLike{T}, ::T) and have *(::MP.AbstractPolynomialLike, ::Number) that convert the number to T. Same for other operators like +, - etc..
  2. Implement +(p::MP.AbstractPolynomialLike, q::MP.AbstractPolynomialLike) where p and q have different variables. Not simply by first promoting them to the same set of variables and then use a simple implementation of the sum but instead to have some complicated implementation dealing with monomials over different variables. We should just directly promote with StarAlgebras.promote_bases now and only implement + over polynomials of the same algebra
  3. Having different implementation of polynomials, MP.Polynomial using a list of terms and DynamicPolynomials.Polynomial having a separate list of coefficients and list of monomials. We should just use StarAlgebras.AlgebraElement now.

So the plan is:

  1. Move MP.Term to StarAlgebras.Term, so MP.AbstractTermLike won't be an abstract type anymore but a union of AbstractMonomialLike and SA.Term
  2. Remove MP.Polynomial, and replace it by the implementation of polynomials done in MultivariateBases using StarAlgebras. Doing so, we can just merge MultivariateBases into MultivariatePolynomials, MP.AbstractPolynomialLike will then be a union of that StarAlgebras.AlgebraElement and AbstractTermLike.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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