| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: global variables vs program arguments in Mata
Hi all,
I'm writing program in Mata where some initial values are defined at the
begining and then a subroutine recursively itterates on them.
Currently it looks something like:
void sub(a , b)
{
some operations with a and b
...
sub(a, b)
}
void main()
{
a=...
b=...
sub(a, b)
}
So, essentially all the parameters are "globals", and I define them as
arguments for the -sub-.
I was wondering if there was a "best" practice, in terms of efficiency, how
should this kind of parameters defined, as externals (and use findexternal,
createexternal functions inside the subroutine) or keep them as arguments?
is there any gain/loss in using matrix/scalar types for the argument or I
should use pointers as arguments?
Any thoughts would be helpful.
Thanks,
Zurab
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/