[SciPy-Dev] Quadrature of a vector-valued function, implementation changing the quadpack package

Pauli Virtanen pav@iki...
Tue Jul 2 15:21:55 CDT 2013


Hi,

02.07.2013 23:14, Saullo Castro kirjoitti:
> I am implementing a vectorized version of:
>
> `dagse.f` --> `dagsev.f`
>
> and
>
> `dqk21.f` --> `dqk21v.f`
>
> Which handles the vectorized integration in "low level" inside the
> Fortran routines.
>
> I would like to discuss with the SciPy dev group if there is any
> interest to make this feature part of SciPy.

This feature has been requested several times by users, and would be 
appreciated.

> Also, I need some advice about how to wrap this with quadpack. Currently
> I am changing:
>
> `_quadpackmodule.c`
> `_quadpack.h`
>
> to make `dagsev.f` work similarly to `dagse.f`.

This may be the path of least resistance.

However, it should be noted that the _*.[ch] are rather old (pre-2001?) 
and not written in an optimal way --- it would be best to get rid of 
them if possible, or at least to not write more code in the same style.

Nowadays, one of the easier ways to wrap Fortran code is to use `f2py`, 
see the documentation here: http://cens.ioc.ee/projects/f2py2e/

There are a number of examples of f2py usage in the Scipy code base, 
look for *.pyf files. Several of them also have examples on how to deal 
with callback routines.

-- 
Pauli Virtanen



More information about the SciPy-Dev mailing list