comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: run-time function creation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: run-time function creation [message #83894 is a reply to message #83887] Wed, 10 April 2013 10:04 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Wednesday, April 10, 2013 10:33:31 AM UTC-4, Paul Mallas wrote:
> I know this is a bit off the wall, but I was wondering if there is a technique or method for doing run-time function creation.
>
>
>
> The reason I ask is I was looking at the IDL integration routines (e.g., qsimp) and this requires a singular argument function name as input. My problem is I have a function with several parameters I need to integrate, but don't have these parameters until I calculate them at run time. If I could somehow create the function dynamically, I could create a function that would satisfy the the qsimp requirement for a single argument function, but prior to run-time I can't.

Well, I have two answers for you.

The first answer is that you can use my QPINT1D which is a better integrator than the IDL-standard quadrature functions. Plus, it allows you to enter in a private variable (a structure) for other parameters.

If you really want run-time functions, then FILE_COMPILE will do that for you. You need to write out a scratch file with the function you want, and then FILE_COMPILE will do the tricky part of compiling it. (not so tricky, but getting the paths right is more work than you might think)

Craig

QPINT1D
http://cow.physics.wisc.edu/~craigm/idl/math.html#QPINT1D

FILE_COMPILE
http://cow.physics.wisc.edu/~craigm/idl/introspect.html#FILE _COMPILE
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: replacing "NAN" values using interpolation in IDL
Next Topic: CMIP5 model output

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 12:34:29 PDT 2025

Total time taken to generate the page: 0.24082 seconds