[SciPy-user] Polynomial interpolation

Robert Kern robert.kern at gmail.com
Mon Apr 28 16:56:50 EDT 2008


On Mon, Apr 28, 2008 at 3:36 PM, Anne Archibald
<peridot.faceted at gmail.com> wrote:
> 2008/4/28 Robert Kern <robert.kern at gmail.com>:
>
> >  Well those certainly aren't useful. The only functions I would
>  >  consider adding would be "one-shot" functions, e.g.:
>  >
>  >   def krogh(xi, yi, x):
>  >       return KroghInterpolator(xi,yi)(x)
>
>  The problem here is that construction of the splines is an order
>  degree**2 process, so I want an interface that encourages users to
>  construct them once and for all. I think such an approach also
>  discourages people from just
>
>  y_interp = krogh(all_my_data_x, all_my_data_y, x_interp)
>
>  with hundreds of points, the results of which will be meaningless and horrible.

If they repeat that with many x_interp with constant all_my_data, yes.
However, there are a number of cases where they won't have many
x_interp.

I don't like it, either. I would have designed it precisely like you
already have and left it as a clean, orthogonal API. But since people
do request the alternative APIs, we need to at least consider them. My
objection to krogh_rep() and krogh_ev() is that they don't address
these people's concerns, either. Yes, they're functions instead of
methods, but all they are doing is methody things on opaque objects
with a different syntax. If people don't understand OO (and don't want
to understand OO and don't have an actual need for multiple
x_interps), these functions don't help them.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco



More information about the SciPy-User mailing list