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

Home » Public Forums » archive » pass parameters to a function when calling BROYDEN or NEWTON routines
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: pass parameters to a function when calling BROYDEN or NEWTON routines [message #85064 is a reply to message #85063] Fri, 28 June 2013 07:22 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Friday, June 28, 2013 4:12:16 PM UTC+2, tas....@gmail.com wrote:
> Hi there,
>
>
>
> following the example in the BROYDEN reference page in IDL, I first determine the non-linear system of equations by creating a function which then is called by the BROYDEN function. The problem I am facing here is that I would like to pass parameters in the first function while calling the BROYDEN function.
>
>
>
> For example:
>
>
>
> first determine the equations
>
> FUNCTION broydenfunc, X
>
> ...
>
> END
>
>
>
> then call the broyden function
>
> result = BROYDEN(X, 'broydenfunc')
>
>
>
> So my question again is how I can pass parameters to the BROYDENFUNC function when calling the main BROYDEN function? I would like to keep the BROYDENFUNC in a loop where different parameters are passed every time.
>
>
>
> Thanks in advance!
>
> T

With a common block?

FUNCTION broydenfunc, X
COMMON broydenfuncParams, p0, p1
...
END


and then call like this:
COMMON broydenfuncParams, p0, p1 ; this should be at the beginning
for i =0,9 do begin
p0=i
p1=i*2
result = BROYDEN(X, 'broydenfunc')
endfor

Hope it helps,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: endi and endif
Next Topic: EYE property in plot3d

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

Current Time: Fri Oct 10 15:08:49 PDT 2025

Total time taken to generate the page: 1.28213 seconds