Skip to content

Commit 1e2e5ad

Browse files
committed
fixes
1 parent 9cb7026 commit 1e2e5ad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/polyform.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ We use this to hold polynomials in memory while doing `simplify_fractions`.
1212
"""
1313
struct PolyForm{T, M} <: Symbolic{T}
1414
p::MP.AbstractPolynomialLike
15-
pvar2sym::Bijection # @polyvar x --> @sym x etc.
16-
sym2term::Dict # Symbol("sin-$hash(sin(x+y))") --> sin(x+y) => sin(PolyForm(...))
15+
pvar2sym::Bijection{Any,Sym} # @polyvar x --> @sym x etc.
16+
sym2term::Dict{Sym,Any} # Symbol("sin-$hash(sin(x+y))") --> sin(x+y) => sin(PolyForm(...))
1717
metadata::M
1818
end
19-
(::PolyForm{T})(p, d1, d2, m) where {T} = PolyForm{T, typeof(m)}(p, d1, d2, m)
19+
(::Type{PolyForm{T}})(p, d1, d2, m=nothing) where {T} = PolyForm{T, typeof(m)}(p, d1, d2, m)
2020

2121
Base.hash(p::PolyForm, u::UInt64) = xor(hash(p.p, u), trunc(UInt, 0xbabacacababacaca))
2222
Base.isequal(x::PolyForm, y::PolyForm) = isequal(x.p, y.p)
@@ -58,7 +58,7 @@ end
5858

5959
# forward gcd
6060

61-
PF = :(PolyForm{promote_type(/, symtype(x), symtype(y))})
61+
PF = :(PolyForm{promote_symtype(/, symtype(x), symtype(y))})
6262
@eval begin
6363
Base.div(x::PolyForm, y::PolyForm) = $PF(div(x.p, y.p), mix_dicts(x, y)...)
6464
Base.div(x::Integer, y::PolyForm) = $PF(div(x, y.p), y.pvar2sym, y.sym2term)
@@ -114,7 +114,7 @@ function polyize(x, pvar2sym, sym2term, vtype, pow, Fs, recurse)
114114
end
115115
end
116116

117-
sym2term[sym] = x => y
117+
sym2term[sym] = (x => y)
118118

119119
return local_polyize(sym)
120120
end

0 commit comments

Comments
 (0)