[SciPy-Dev] Beginning work on robustly allowing function pointers in integrate - quad

Pauli Virtanen pav at iki.fi
Fri Oct 18 12:42:13 EDT 2013


Hi,

18.10.2013 19:07, Nathan Woods kirjoitti:
[clip]
> Brian and I have some ideas that will make this idea work in a robust way,
> at least using C++. Is there any reason to avoid dependence on C++? If so,
> there may still be a way to do it in C. I actually got pretty far trying to
> implement something like it in f90, but was stymied by the lack of a real
> function pointer, which C has.

I'm assuming you are speaking here about passing in function pointers
carrying extra arguments, without using global variables or modifying
QUADPACK code.

Please line out how you would do it in C++. Note that things such as
std::bind and taking addresses of member functions will not help here,
because they require passing in not only a function pointers but also
the binding object separately. This issue is outlined in the C++ FAQ ---
the situation with QUADPACK is analogous to event callbacks:

http://www.parashift.com/c++-faq/memfnptr-vs-fnptr.html

-- 
Pauli Virtanen




More information about the SciPy-Dev mailing list