Skip to content

Commit

Permalink
Use coefficient_type in polynomial antidifferentiaton tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrhansk committed Apr 10, 2024
1 parent c06ec32 commit b76a367
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,19 @@
@polyvar x y

p = (x^2 + 4 * y^3)
(_, _, T) = typeof(p).parameters
@test T == Int
@test MP.coefficient_type(p) == Int

pi = DynamicPolynomials.antidifferentiate(p, y)
@test pi == (x^2 * y + y^4)

pi = DynamicPolynomials.antidifferentiate(p, x)
(_, _, T) = typeof(pi).parameters
@test T == Rational{Int}
@test MP.coefficient_type(pi) == Rational{Int}

p = (1.0 * x^2 + 2.0 * y^2)
(_, _, T) = typeof(p).parameters
@test T == Float64
@test MP.coefficient_type(p) == Float64

pi = DynamicPolynomials.antidifferentiate(p, x)
(_, _, T) = typeof(pi).parameters
@test T == Float64
@test MP.coefficient_type(pi) == Float64

p = 2 * y
pi = DynamicPolynomials.antidifferentiate(p, y)
Expand Down

0 comments on commit b76a367

Please sign in to comment.