I am a very new Julia user (coming from Matlab), so forgive me if I ask a very dumb question.
I currently have a julia code, which works (it runs fine) though it provides different results if I execute it as a function or if I run every of the function lines interactively.
My script is mostly about linear algebra and uses Arrays and Dicts.
As I have some trouble making use of the Juno debugger, I did not find another way to debug my code, which is quite a shame.
I spent the last three hours on this and I still have no clue why these results differ.
I suspect I don't understand some very basic working process of julia related to variable allocation but I'm flying blind here.
Does anyone have a explaination for this behavior ?
I can't provide the code here but here is the base structure of the code. Basically the M
matrix returned by childfunction
is wrong. a
is a scalar a dict
is a dictionary.
function motherfunction(...)
M = childfunction(a,dict)
end
function childfunction(...)
...
M = *some linear algebra*
return M
end
question from:
https://stackoverflow.com/questions/66068423/julia-not-returning-the-same-value-when-executing-a-function-or-every-of-its-lin 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…