[ADMB Users] f1b2gradlist

Derek Seiple dseiple84 at gmail.com
Thu Apr 21 13:54:26 PDT 2011


Dear Users,

I am a little confused by something. I am hoping someone can help me out.

The f1b2gradlist (used in the laplace approximation calculator) is
declared as a global pointer in d1b2glo.cpp like this:

df1b2_gradlist * f1b2gradlist = NULL;

and than the laplace_approximation_calculator creates an instance with

f1b2gradlist = new df1b2_gradlist(4000000U,200000U,8000000U,400000U,
   2000000U,100000U,adstring("f1b2list1"));

What is confusing is that f1b2gradlist gets passed as an argument in
several functions including get_second_ders (found in df1b2lap.cpp).

void get_second_ders(int xs,int us,const init_df1b2vector _y,dmatrix& Hess,
 dmatrix& Dux, df1b2_gradlist * f1b2gradlist,function_minimizer * pfmin,
 laplace_approximation_calculator * lpc)


I am confused as to why it gets passed if it is global? Wouldn't it
being global eliminate that need?

I'm looking at this from the angle of parallelization, so knowing when
it gets accessed and what accesses it is important.

Thanks in advance,
Derek



More information about the Users mailing list