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

Home » Public Forums » archive » Re: Passing function to function called by qromb etc.?
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: Passing function to function called by qromb etc.? [message #21225] Wed, 16 August 2000 00:00
landsman is currently offline  landsman
Messages: 93
Registered: August 1991
Member
In article <399ad505$1@cs.colorado.edu>,
jwilson@shifty.cs.colorado.edu (John Wilson) wrote:
> I would like to numerically integrate f(x) * x in IDL. This is coming
> up within another function which takes the function f as one of its
> parameters. What I would like to do is define a function xfx which
> computes f(x) * x for a given x and call qromb with the function
> xfx with a parameter of the function f. However, I cannot figure out
> how to do this.
>
> I thought of
> function xfx,x,func=f
> return, call_function(func,x) * x
> end
>
> foo=qromb(xfx,a,b,func='bar')
>
> but that does not work. What I really need is a capability like the
> bind argument facility of the STL.
>

How about this ugly solution?

function xfx,x
common func
return,call_function(func,x)*x
end

common func
func = 'bar'
foo = qromb(xfx,a,b)

A while back in the "Top Ten IDL Requests" thread, I made a wish that
the IDL implementations of Numerical Recipes routines that call
user-supplied functions (QROMB, LMFIT) would allow vector calls to the
user functions. I should have also added that the user should have the
ability to pass keywords directly to the user-supplied function.

I haven't tried it but both these capabilities are available in Mati
Meron's procedure ROMBERG at ftp://cars3.uchicago.edu/midl/romberg.pro

I have similar capabilities for QSIMP and QTRAP at
http://idlastro.gsfc.nasa.gov/ftp/pro/math/

Wayne Landsman landsman@mpb.gsfc.nasa.gov


Sent via Deja.com http://www.deja.com/
Before you buy.
[Message index]
 
Read Message
Previous Topic: Another Long Day Compliments of Object Graphics
Next Topic: David: for your book ?

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

Current Time: Sat Oct 11 10:50:49 PDT 2025

Total time taken to generate the page: 0.88193 seconds