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

Pauli Virtanen pav at iki.fi
Tue Oct 6 14:29:50 EDT 2009


ti, 2009-10-06 kello 12:11 -0600, Charles R Harris kirjoitti:

[clip]
> 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.

This would also work if it was in Scipy, IMHO. But I guess that if we
have financial functions in Numpy, maybe there's room for more...

> As Anne pointed out, the existing interface to the scipy chebyshev
> functions is useless because the result is returned as a polynomial.

Yes, also our documentation warns that the current interface is useless.

>         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.

Yeah, Python overhead is the bulky thing, which is why we might want to
have fast routines in addition to the ones returning class instances.

A suitable base class or a more robust polynomial representation could
be useful for the class-based interface, and yes, is a good idea in
general.

Cheers,
Pauli







More information about the SciPy-Dev mailing list