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

Home » Public Forums » archive » Convert Function to Procedure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Convert Function to Procedure [message #93237] Tue, 17 May 2016 09:33 Go to previous message
dmfl0590 is currently offline  dmfl0590
Messages: 17
Registered: December 2015
Junior Member
Hi

I have the following function:

FUNCTION CREATE_NEW, Im1, Im2, B, step=step, itmax=itmax
Bnew = B
ffd_precompute,Im1,size(REFORM(B[0,*,*]), /dimensions)
ffd_grad_precompute, size(REFORM(B[0,*,*]), /dimensions)
for it=1L, itmax do begin
FIRST_FUN, Im1, Im2, Bnew, G=G
Bnew = SECOND_FUN(Im1, Im2, Bnew, G, conv=converged,step=step)
if converged then return, Bnew
endfor
return, Bnew
END

Then I changed this Function to Procedure like this:

PRO CREATE_NEW, Im1, Im2, B, step=step, itmax=itmax
Breg = B
ffd_precompute,Im1,size(REFORM(B[0,*,*]), /dimensions)
ffd_grad_precompute, size(REFORM(B[0,*,*]), /dimensions)
for it=1L, itmax do begin
FIRST_FUN, Im1, Im2, Bnew, G=G
Bnew = SECOND_FUN(Im1, Im2, Bnew, G, conv=converged,step=step)
if converged then begin
B=Bnew
return
endif
endfor
B=Bnew
END


I don't get the same results for some reason. I thought that I can put the output variables in the calling statement. The output variable in this case is the B. However, I don't get the output variable. Can anyone help with this?
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How to label a time axes on an image?
Next Topic: issues appending roi from IDLanROI to IDLanROIGroup

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

Current Time: Wed Oct 08 13:32:38 PDT 2025

Total time taken to generate the page: 0.00539 seconds