1
- export isapproxzero
2
-
3
- export LexOrder, InverseLexOrder, Reverse, Graded
4
-
5
1
Base. iszero (v:: AbstractVariable ) = false
6
2
Base. iszero (m:: AbstractMonomial ) = false
7
3
Base. iszero (t:: AbstractTerm ) = iszero (coefficient (t))
16
12
17
13
# See https://github.com/blegat/MultivariatePolynomials.jl/issues/22
18
14
# 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
23
19
Base.:(== )(α:: Nothing , x:: RationalPoly ) = false
24
20
Base.:(== )(x:: RationalPoly , α:: Nothing ) = false
25
21
Base.:(== )(α:: Dict , x:: RationalPoly ) = false
@@ -33,7 +29,7 @@ function right_term_eq(p::AbstractPolynomial, t)
33
29
nterms (p) == 1 && leading_term (p) == t
34
30
end
35
31
end
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)
37
33
38
34
left_constant_eq (α, v:: AbstractVariable ) = false
39
35
right_constant_eq (v:: AbstractVariable , α) = false
@@ -46,8 +42,8 @@ function _term_constant_eq(t::AbstractTermLike, α)
46
42
end
47
43
left_constant_eq (α, t:: AbstractTermLike ) = _term_constant_eq (t, α)
48
44
right_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, α)
51
47
52
48
function Base.:(== )(mono:: AbstractMonomial , v:: AbstractVariable )
53
49
return isone (degree (mono)) && variable (mono) == v
117
113
118
114
Base.:(== )(p:: RationalPoly , q:: RationalPoly ) = p. num * q. den == q. num * p. den
119
115
# 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
122
118
Base.:(== )(α, q:: RationalPoly ) = α * q. den == q. num
123
119
Base.:(== )(q:: RationalPoly , α) = α == q
124
120
@@ -132,7 +128,7 @@ isapproxzero(m::AbstractMonomialLike; kwargs...) = false
132
128
function isapproxzero (t:: AbstractTermLike ; kwargs... )
133
129
return isapproxzero (coefficient (t); kwargs... )
134
130
end
135
- function isapproxzero (p:: APL ; kwargs... )
131
+ function isapproxzero (p:: _APL ; kwargs... )
136
132
return all (term -> isapproxzero (term; kwargs... ), terms (p))
137
133
end
138
134
isapproxzero (p:: RationalPoly ; kwargs... ) = isapproxzero (p. num; kwargs... )
@@ -159,10 +155,10 @@ end
159
155
function Base. isapprox (p:: RationalPoly , q:: RationalPoly ; kwargs... )
160
156
return isapprox (p. num * q. den, q. num * p. den; kwargs... )
161
157
end
162
- function Base. isapprox (p:: RationalPoly , q:: APL ; kwargs... )
158
+ function Base. isapprox (p:: RationalPoly , q:: _APL ; kwargs... )
163
159
return isapprox (p. num, q * p. den; kwargs... )
164
160
end
165
- function Base. isapprox (p:: APL , q:: RationalPoly ; kwargs... )
161
+ function Base. isapprox (p:: _APL , q:: RationalPoly ; kwargs... )
166
162
return isapprox (p * q. den, q. num; kwargs... )
167
163
end
168
164
function Base. isapprox (q:: RationalPoly{C} , α; kwargs... ) where {C}
0 commit comments