diff --git a/src/arithmetic.jl b/src/arithmetic.jl index 46e7134..96256ef 100644 --- a/src/arithmetic.jl +++ b/src/arithmetic.jl @@ -86,17 +86,17 @@ end function MP.substitute( s::MP.AbstractSubstitutionType, p::_AE, - args::MP.AbstractSubstitution..., + args::MP.Substitutions, ) - return MP.substitute(s, MP.polynomial(p), args...) + return MP.substitute(s, MP.polynomial(p), args) end function MP.subs(p::_AE, args::MP.AbstractSubstitution...) - return MP.substitute(MP.Subs(), p, args...) + return MP.substitute(MP.Subs(), p, args) end function (p::_AE)(args::MP.AbstractSubstitution...) - return MP.substitute(MP.Eval(), p, args...) + return MP.substitute(MP.Eval(), p, args) end function (p::_AE)(x::NTuple{N,<:Number}) where {N} @@ -109,6 +109,6 @@ end (p::_AE)(x::Number...) = (MP.polynomial(p))(x...) -function MP.differentiate(p::_AE, args...) - return MP.differentiate(MP.polynomial(p), args...) +function MP.differentiate(p::_AE, x) + return MP.differentiate(MP.polynomial(p), x) end diff --git a/test/runtests.jl b/test/runtests.jl index 52ccdb5..e411565 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -112,7 +112,9 @@ function api_test(B::Type{<:MB.AbstractMonomialIndexed}, degree) @test const_alg_el(ones(length(x))...) == const_mono @test const_alg_el(tuple(ones(length(x))...)) == const_mono @test subs(const_alg_el, x => ones(length(x))) == const_mono + @test const_alg_el(x[1] => x[2], x[2] => x[1]) == const_mono @test differentiate(const_alg_el, x) == differentiate(const_mono, x) + @test differentiate(const_alg_el, x, 2) == differentiate(const_mono, x, 2) end function univ_orthogonal_test(