[scilab-Users] recursion using fsolve

bernard.hugueney at scilab.org bernard.hugueney at scilab.org
Wed Jun 30 09:11:31 CEST 2010


Hello,

On Wed, 30 Jun 2010 08:21:14 +0200, Michaël Baudin
<michael.baudin at scilab.org> wrote:
> In principle, rewriting the code in C would not change the issue :
> assuming that the common blocks are replaced by static variables,
> this would lead to the same effect.
> (Fortran is not that bad...)
> 
> Best regards,
> 
> Michael Baudin

I assume the point of a rewrite (!= translation) in another language would
be to use 
the tools provided by the new language (but lacking in the former
implementation language).

Namely, you'd want to replace static global state in common blocks by
using a stack 
(either 'the' stack by explicit arguments propagated along the call stack
or by
a custom global stack of states[0]), to enable nested calls.

Not to start a language war :) , but if Fortran77 lacks derived types,
passing the state as arguments
 of primitive types becomes impractical, and lacking dynamic allocation
rules out a custom stack

=> common blocks
=> not reentrant (don't even think about multithreading).

My .2€

Best regards

B.

[0] In the later case, you'd want to use thread local storage for the
'global' stack to also
enable multi-threading.




More information about the users mailing list