[SciPy-dev] Generic polynomials class (was Re: Volunteer for Scipy Project)

Charles R Harris charlesr.harris@gmail....
Tue Oct 6 13:11:43 CDT 2009


On Tue, Oct 6, 2009 at 11:48 AM, Pauli Virtanen <pav@iki.fi> wrote:

> ti, 2009-10-06 kello 10:24 -0600, Charles R Harris kirjoitti:
>
>
> [clip]
> > I would like to make the change, but I would like some sort of
> > consensus first. Of course, I will need to rewrite all the
> > code/documentation if it happens ;)
>
> One question to ask is what goes where.
>
> To me, functionality dealing with polynomials in different bases
> (including Chebyshev) sounds definitely like a part of Scipy, and not a
> part of a basic numerical array package that we might want to keep Numpy
> as. Personally, I'd rather leave poly1d alone, and effectively replace
> it by a proper polynomial handling package in Scipy, as it sounds like
> the amount of features is ballooning. Thoughts?
>
>
The features in chebyshev are pretty much the same as poly1d. You can look,
I posted the source on the numpy list. I want the class in numpy because
chebyshev support is pretty much essential to numerical work, right up there
with power series, and some of the existing/proposed functions in scipy
could make use of it. As Anne pointed out, the existing interface to the
scipy chebyshev functions is useless because the result is returned as a
polynomial.


> A second question is how much of this has to do with scipy.special.
> Quite often, one just needs values of orthogonal polynomials at certain
> points, and it could be useful to have separate fast ufuncs for
> computing these, rather than having to construct a bulky class instance
> first.
>

The class isn't bulky. The module is ~1400 lines, but most of that is
documentation. If you want millions of points using standard c types, then a
fast routine is essential. But if you just want to do ordinary work,
possibly with more obscure numeric types such as rationals or polynomials,
then the class is more convenient and easier to maintain.  But I don't
intend to duplicate all the orthogonal functions in special. What I was
proposing was an abstract base class that could be used to build standard
interfaces to the functions. Given just polynomials and chebyshev series it
wasn't worth the hassle, but if someone wants to go ahead and interface a
bunch more polynomial types it starts to look useful. That base class
probably belongs in scipy.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20091006/8fbf78ed/attachment.html 


More information about the Scipy-dev mailing list