[SciPy-dev] double exponential integrator
Fri Mar 20 04:46:42 CDT 2009
Thu, 19 Mar 2009 13:55:58 -0400, Thouis (Ray) Jones wrote:
> I'm soliciting feedback on an implementation of integration using the
> double exponential transform. I've tentatively placed it in
> scipy.integrate as de_integrate.
+1 for including this in Scipy 0.8.0.
Some quick comments (I'll try to find time for better comments later):
- Vectorization: you are using a list comprehension in
doubleexp.py:contribution_at_level and elsewhere
These statements could be vectorized -- I believe you can also require
that the integrand function `f` can evaluate many points at the same
time and return an array. Could be an useful speedup.
- Is generating the _abscissas_raw and _weights_raw costly?
I see that you use `mpmath` to prepare these. Does the generation
fail in double precision?
If not, it might be better to generate them when the integration
function is first used. (Also, it might be nice to put also the
generator functions in the same doubleexp.py; these are not long files.)
- Function name `de_integrate`: Perhaps it should be `quad_de` or
something similar, since it's a quadrature, and the "basic" quadrature
in scipy.integrate is called `quad`.
- I'm not sure about if a `full_output` switch is good API.
Several Scipy functions do currently use something like that,
but perhaps it would be better not to introduce more...
> It's available at this url and branch:
> http://broad.mit.edu/~thouis/scipy.git DEintegrator
> (assuming I've set up my git repository correctly, which is quite
> possibly not the case.)
The repository works OK.
More information about the Scipy-dev