Missing functionality: converting coefficients
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the proposed over_ring signature and the linked PolynomialApproximation.jl example. Determine whether Polynomials should expose a conversion interface for AbstractPolynomial subtypes, and clarify the expected behavior using the Float64 example; done means the interface and its scope are agreed.
Written by the indexing model from the issue text.
Description
I have some code where I define multiple AbstractPolynomial subtypes. In some cases I'd like to be able to turn a polynomial over one ring to a polynomial over another ring, by converting all its coefficients. It would seem appropriate for a function with that functionality to live in the Polynomials module. Something like this:
over_ring(::Type{New}, p::AbstractPolynomial{Old, x})::AbstractPolynomial{New, x} where {New <: Number, Old <: Number, x}
For example, for Polynomial a possible implementation would be this:
over_ring(::Type{New}, p::Polynomial{Old, x}) where {New <: Number, Old <: Number, x} =
Polynomial{New, x}(p)
Usage example:
julia> over_ring(Float64, Polynomial([3, 2, 1]))
Polynomial(3.0 + 2.0*x + 1.0*x^2)
I'd still need to define a method of this function for each subtype of AbstractPolynomial owned by me, but it would be much nicer and tidier if I could overload a Polynomials function.
Would an interface like this would fit well into Polynomials?
- Dominant language
- Julia
- Stars
- 321
- Forks
- 81
- Avg merge
- 10h 1m
- Merged PRs (30d)
- 5
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaMath/Polynomials.jl
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
JuliaMath/Polynomials.jl#647 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
JuliaMath/Polynomials.jl#641 ·
-
tagbot-manual
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
JuliaMath/Polynomials.jl#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
JuliaMath/Polynomials.jl#620 · 6 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
JuliaMath/Polynomials.jl#585 · 7 comments ·
All issues in JuliaMath/Polynomials.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
io
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaGPU/GPUArrays.jl#837 ·
Maintainers usually reply within 1 day