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

Charles R Harris charlesr.harris@gmail....
Thu Oct 8 11:29:00 CDT 2009


Hi Anne,

On Thu, Oct 8, 2009 at 9:37 AM, Anne Archibald <peridot.faceted@gmail.com>wrote:

> 2009/10/7 David Goldsmith <d.l.goldsmith@gmail.com>:
> > Thanks for doing that, Anne!
>
> There is now a rough prototype on github:
> http://github.com/aarchiba/scikits.polynomial
> It certainly needs more tests and features, but it does support both
> the power basis and the Lagrange basis (polynomials represented by
> values at Chebyshev points).
>
>
Just took a quick look, which is probably all I'll get to for a few days as
I'm going out of town tomorrow. Anyway, the Chebyshev points there are type
II, which should probably be distinguished from type I (and III & IV). I
also had the impression that the base class could have a few more functions
and NotImplemented bits. The Polynomial class is implemented as a wrapper,
it might even make sense to use multiple inheritance (horrors) to get
specific polynomial types, but anyway it caught my attention and that part
of the design might be worth spending some time thinking about. It also
might be worth distinguishing series as a separate base because series do
admit the division operators //, %, and divmod. Scalar
multiplication/division (__truedivision__) should also be built in. I've
also been using "from __future__ import division" up at the top to be py3k
ready. For a series basis I was thinking of using what I've got for
Chebyshev but with a bunch of the __foo__  functions raising the
NotImplementedError. I've also got a single function for importing the
coefficient arrays and doing the type conversions/checking. It's worth doing
that one way for all the implementations as it makes it easier to fix/extend
things.

I've attached the low->high version of the chebyshev.py file just for
further reference. The Chebyshev class is at the end.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20091008/17b0d3a8/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chebyshev.zip
Type: application/zip
Size: 11972 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-dev/attachments/20091008/17b0d3a8/attachment-0001.zip 


More information about the Scipy-dev mailing list