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 #83882 is a reply to message #83868] Wed, 10 April 2013 12:57 Go to previous messageGo to previous message
PMan is currently offline  PMan
Messages: 61
Registered: January 2011
Member
On Wednesday, April 10, 2013 1:04:49 PM UTC-4, Craig Markwardt wrote:
> 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

Craig - I used your qpint1. Excellent! It was just what I needed and it worked great. I even have the imsl lib and qpint1 worked much better than the imsl_intfcn. imsl_intfcn is fast and gives the right answer, but gives tons of floating point warnings and - for some reason - it kills the workbench when I run it. qpint1 appears slightly faster and does not deleterious side effects. Thank you!
[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: Wed Oct 08 19:59:36 PDT 2025

Total time taken to generate the page: 0.00448 seconds