work on polynomial_composition. Close #520#524
work on polynomial_composition. Close #520#524jverzani wants to merge 1 commit intoJuliaMath:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #524 +/- ##
==========================================
- Coverage 76.59% 75.18% -1.42%
==========================================
Files 35 34 -1
Lines 3739 3534 -205
==========================================
- Hits 2864 2657 -207
- Misses 875 877 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| end | ||
| function polynomial_composition(p::AbstractUnivariatePolynomial{B,T,X}, q::ImmutableDensePolynomial{B,S,Y,0}) where {B<:StandardBasis,T,S,X,Y} | ||
| P = ImmutableDensePolynomial{B,promote_type(T,S), Y,0} | ||
| zero(P) |
There was a problem hiding this comment.
A polynomial composed with zero is the polynomial's constant term, not always zero. For example, if we have f(x) = 1 and g(x) = 0, f∘g is 1, not 0.
There was a problem hiding this comment.
Apart from that, I don't think the promotion is necessary, that is, I think you could just ignore S, because the value of q is always zero, independently of S.
|
Could you also add fallback methods for Something like: polynomial_composition(p::Polynomial, r::ImmutablePolynomial) = p(Polynomial(r)) |
Start on some special cases for polynomial composition that improve inferrability.