jwmerrill / PowerSeries.jl

Truncated Power Series for Julia
MIT License
11 stars 7 forks source link

PowerSeries and Polynomial step on eachother's toes #2

Open jwmerrill opened 10 years ago

jwmerrill commented 10 years ago

In PowerSeries.jl, I intentionally stuck to the same notation as Polynomial.jl for integration, differentiation, and evaluation: polyint, polyder, and polyeval. This notation is in turn borrowed from matlab.

I currently don't import those methods from Polynomial because PowerSeries doesn't "depend" on Polynomial any more than Polynomial depends on PowerSeries, and I don't want to make Polynomial a requirement for this library.

This causes problems if you try to import both of them at the same time

julia> using Polynomial

julia> polyint(poly([1.0, 2.0]))
Poly(0.3333333333333333x^3 + -1.5x^2 + 2.0x^1)

julia> using PowerSeries
Warning: using PowerSeries.polyint in module Main conflicts with an existing identifier.

What's the right thing to do here?

I'm hoping the answer isn't "depend on Polynomial", because the packages are actually peers, and breaking one shouldn't break the other.

jiahao commented 10 years ago

What do you consider conceptually distinct between PowerSeries and Polynomial?

jwmerrill commented 10 years ago

PowerSeries always truncates to a fixed order.

At the time I opened this ticket, Polynomial.jl also had no docs and very little activity, which made me even more hesitant to depend on it. I've since contributed some docs for Polynomial.jl.