1- export isapproxzero
2-
3- export LexOrder, InverseLexOrder, Reverse, Graded
4-
51Base. iszero (v:: AbstractVariable ) = false
62Base. iszero (m:: AbstractMonomial ) = false
73Base. iszero (t:: AbstractTerm ) = iszero (coefficient (t))
1612
1713# See https://github.com/blegat/MultivariatePolynomials.jl/issues/22
1814# avoids the call to be transfered to left_constant_eq
19- Base.:(== )(α:: Nothing , x:: APL ) = false
20- Base.:(== )(x:: APL , α:: Nothing ) = false
21- Base.:(== )(α:: Dict , x:: APL ) = false
22- Base.:(== )(x:: APL , α:: Dict ) = false
15+ Base.:(== )(α:: Nothing , x:: _APL ) = false
16+ Base.:(== )(x:: _APL , α:: Nothing ) = false
17+ Base.:(== )(α:: Dict , x:: _APL ) = false
18+ Base.:(== )(x:: _APL , α:: Dict ) = false
2319Base.:(== )(α:: Nothing , x:: RationalPoly ) = false
2420Base.:(== )(x:: RationalPoly , α:: Nothing ) = false
2521Base.:(== )(α:: Dict , x:: RationalPoly ) = false
@@ -33,7 +29,7 @@ function right_term_eq(p::AbstractPolynomial, t)
3329 nterms (p) == 1 && leading_term (p) == t
3430 end
3531end
36- right_term_eq (p:: APL , t) = right_term_eq (polynomial (p), t)
32+ right_term_eq (p:: _APL , t) = right_term_eq (polynomial (p), t)
3733
3834left_constant_eq (α, v:: AbstractVariable ) = false
3935right_constant_eq (v:: AbstractVariable , α) = false
@@ -46,8 +42,8 @@ function _term_constant_eq(t::AbstractTermLike, α)
4642end
4743left_constant_eq (α, t:: AbstractTermLike ) = _term_constant_eq (t, α)
4844right_constant_eq (t:: AbstractTermLike , α) = _term_constant_eq (t, α)
49- left_constant_eq (α, p:: APL ) = right_term_eq (p, α)
50- right_constant_eq (p:: APL , α) = right_term_eq (p, α)
45+ left_constant_eq (α, p:: _APL ) = right_term_eq (p, α)
46+ right_constant_eq (p:: _APL , α) = right_term_eq (p, α)
5147
5248function Base.:(== )(mono:: AbstractMonomial , v:: AbstractVariable )
5349 return isone (degree (mono)) && variable (mono) == v
117113
118114Base.:(== )(p:: RationalPoly , q:: RationalPoly ) = p. num * q. den == q. num * p. den
119115# Solve ambiguity with (::PolyType, ::Any)
120- Base.:(== )(p:: APL , q:: RationalPoly ) = p * q. den == q. num
121- Base.:(== )(q:: RationalPoly , p:: APL ) = p == q
116+ Base.:(== )(p:: _APL , q:: RationalPoly ) = p * q. den == q. num
117+ Base.:(== )(q:: RationalPoly , p:: _APL ) = p == q
122118Base.:(== )(α, q:: RationalPoly ) = α * q. den == q. num
123119Base.:(== )(q:: RationalPoly , α) = α == q
124120
@@ -132,7 +128,7 @@ isapproxzero(m::AbstractMonomialLike; kwargs...) = false
132128function isapproxzero (t:: AbstractTermLike ; kwargs... )
133129 return isapproxzero (coefficient (t); kwargs... )
134130end
135- function isapproxzero (p:: APL ; kwargs... )
131+ function isapproxzero (p:: _APL ; kwargs... )
136132 return all (term -> isapproxzero (term; kwargs... ), terms (p))
137133end
138134isapproxzero (p:: RationalPoly ; kwargs... ) = isapproxzero (p. num; kwargs... )
@@ -159,10 +155,10 @@ end
159155function Base. isapprox (p:: RationalPoly , q:: RationalPoly ; kwargs... )
160156 return isapprox (p. num * q. den, q. num * p. den; kwargs... )
161157end
162- function Base. isapprox (p:: RationalPoly , q:: APL ; kwargs... )
158+ function Base. isapprox (p:: RationalPoly , q:: _APL ; kwargs... )
163159 return isapprox (p. num, q * p. den; kwargs... )
164160end
165- function Base. isapprox (p:: APL , q:: RationalPoly ; kwargs... )
161+ function Base. isapprox (p:: _APL , q:: RationalPoly ; kwargs... )
166162 return isapprox (p * q. den, q. num; kwargs... )
167163end
168164function Base. isapprox (q:: RationalPoly{C} , α; kwargs... ) where {C}
0 commit comments