Re: [f2py] Passing C or Fortran callback function to Fortran module
Pearu Peterson <[email protected]> Wed, 6 Nov 2013 10:13:32 +0200
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <CAPpwKcwYEGvnDK8Tqb30h8seAQHo=yp3Y-GccwOyxDB8pkFkmQ@mail.gmail.com> |
--===============7970751939769568858== Content-Type: multipart/alternative; boundary=089e010d852a98541204ea7db90e --089e010d852a98541204ea7db90e Content-Type: text/plain; charset=ISO-8859-1 Hi, You can use _cpointer feature of f2py generated extension functions. See e.g. http://comments.gmane.org/gmane.comp.python.f2py.user/1217 that has a small example. HTH, Pearu On Wed, Nov 6, 2013 at 1:19 AM, Pierre Chanial <[email protected]>wrote: > Hello, > > I would like to know if it is possible to pass a function from a C > extension or a Fortran module as a callback function to a f2py-wrapped > function without incurring argument checking / conversion overhead? > > Thank you, > Pierre > > _______________________________________________ > f2py-users mailing list > f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] > http://cens.ioc.ee/mailman/listinfo/f2py-users > > --089e010d852a98541204ea7db90e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hi,</div><div><br></div>You can use _cpointer feature= of f2py generated extension functions.<div>See e.g.</div><div><br></div><d= iv>=A0=A0<a href=3D"http://comments.gmane.org/gmane.comp.python.f2py.user/1= 217">http://comments.gmane.org/gmane.comp.python.f2py.user/1217</a></div> <div><br></div><div>that has a small example.</div><div><br></div><div>HTH,= </div><div>Pearu</div></div><div class=3D"gmail_extra"><br><br><div class= =3D"gmail_quote">On Wed, Nov 6, 2013 at 1:19 AM, Pierre Chanial <span dir= =3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank">= [email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hello,<br><br>I would like = to know if it is possible to pass a function from a C extension or a Fortra= n module as a callback function to a f2py-wrapped function without incurrin= g argument checking / conversion overhead?<br> <br>Thank you,<br>Pierre<br></div> <br>_______________________________________________<br> f2py-users mailing list<br> <a href=3D"mailto:f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]">f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]</a><br> <a href=3D"http://cens.ioc.ee/mailman/listinfo/f2py-users" target=3D"_blank= ">http://cens.ioc.ee/mailman/listinfo/f2py-users</a><br> <br></blockquote></div><br></div> --089e010d852a98541204ea7db90e-- --===============7970751939769568858== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ f2py-users mailing list f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] http://cens.ioc.ee/mailman/listinfo/f2py-users --===============7970751939769568858==--