Julia not returning the same value when executing a function or every of its lines

138 Views Asked by At

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.

  • calling function
function motherfunction(...)
    M = childfunction(a,dict)
end
  • child function
function childfunction(...)
...
    M = *some linear algebra*
return M
end
0

There are 0 best solutions below