JuliaAlgebra / MultivariatePolynomials.jl

Multivariate polynomials interface
https://juliaalgebra.github.io/MultivariatePolynomials.jl/stable/
Other
135 stars 27 forks source link

Antidifferentiation (primitive) #230

Closed bmxam closed 1 year ago

bmxam commented 1 year ago

With this PR, I propose to introduce a function to get the antiderivative of multivariate polynomial. Note that the word primitive, (more natural in my native language), is already used by the Julia language; hence the antiderivative name. An associated PR in TypedPolynomials is proposed.

I tried to copy what is currently done for differentiate. Except for RationalPoly, which are not always possible to antidifferentiate with polynoms. I provided some unit tests as well.

With this new function, it would then be easy to integrate a multivariate polynomial on (simple) geometries such as lines, quads, cubes etc.

Note : for personal reasons, I may be absent in the next few weeks. Don't hesitate to continue the PR process "without me".

bmxam commented 1 year ago

I see that the no-reg is failing because (as I understand it) it tries to apply antidifferentiate with DynamicPolynomials, which is not implemented. How can I fix this problem?

blegat commented 1 year ago

We need to add the definition of antidifferentiate first, release MultivariatePolynomials, then add it to DynamicPolynomials, then release DynamicPolynomials and then add the tests in MultivariatePolynomials

bmxam commented 1 year ago

We need to add the definition of antidifferentiate first, release MultivariatePolynomials, then add it to DynamicPolynomials, then release DynamicPolynomials and then add the tests in MultivariatePolynomials

Alright. I will propose a commit without any tests.

blegat commented 1 year ago

Note that the word primitive, (more natural in my native language), is already used by the Julia language; hence the antiderivative name. An associated PR in TypedPolynomials is proposed.

I am also french-speaking so primitive is more natural for me as well but let's follow wikipedia: https://en.wikipedia.org/wiki/Antiderivative which uses antidifferentiate

bmxam commented 1 year ago

We need to add the definition of antidifferentiate first, release MultivariatePolynomials, then add it to DynamicPolynomials, then release DynamicPolynomials and then add the tests in MultivariatePolynomials

Alright. I will propose a commit without any tests.

(done in c34bb38)

blegat commented 1 year ago

Could you add some tests ?

bmxam commented 1 year ago

We need to add the definition of antidifferentiate first, release MultivariatePolynomials, then add it to DynamicPolynomials, then release DynamicPolynomials and then add the tests in MultivariatePolynomials

Hi Benoît, as I understand the tests will be added later. Or there is something I didn't understand?

blegat commented 1 year ago

Indeed, sorry, I forgot that part, let's merge then