36 int num_fixed_effects=0;
43 ivector lfe_index(1,(
int)funnel_init_var::num_active_parameters);
45 for (
int i=1;i<=(int)funnel_init_var::num_active_parameters;i++)
49 lre_index(++num_local_re)=i;
53 lfe_index(++num_fixed_effects)=i;
64 local_fe_list.initialize();
67 int* plocal_re_listi = local_re_list.get_v() + 1;
68 int* plre_indexi = lre_index.
get_v() + 1;
69 for (
int i = 1;i <= num_local_re; ++i)
71 *plocal_re_listi = list(*plre_indexi, 1);
77 int* plocal_fe_listi = local_fe_list.get_v() + 1;
78 int* plfe_indexi = lfe_index.
get_v() + 1;
79 for (
int i=1;i<=num_fixed_effects;i++)
81 *plocal_fe_listi = list(*plfe_indexi, 1);
87 dvector* plocal_Hessi = &local_Hess(1);
88 plre_indexi = lre_index.
get_v() + 1;
89 for (
int i=1;i<=num_local_re;i++)
91 int lrei = *plre_indexi;
94 double* plocal_Hessij = plocal_Hessi->
get_v() + 1;
95 int* plre_indexj = lre_index.
get_v() + 1;
96 for (
int j=1;j<=num_local_re;j++)
98 int lrej = *plre_indexj;
101 *plocal_Hessij += locy(i2).u_bar[j2-1];
111 dvector* plocal_Duxi = &local_Dux(1);
112 plre_indexi = lre_index.
get_v() + 1;
113 for (
int i=1;i<=num_local_re;i++)
115 int i2=list(*plre_indexi, 2);
117 double* plocal_Duxij = plocal_Duxi->
get_v() + 1;
118 int* plfe_indexj = lfe_index.
get_v() + 1;
119 for (
int j=1;j<=num_fixed_effects;j++)
121 int j2=list(*plfe_indexj, 2);
122 *plocal_Duxij = locy(i2).u_bar[j2-1];
135 plocal_Hessi = &local_Hess(1);
136 plre_indexi = lre_index.
get_v() + 1;
137 for (
int i=1;i<=num_local_re;i++)
139 int lrei = *plre_indexi;
141 double* plocal_Hessij = plocal_Hessi->
get_v() + 1;
142 int* plre_indexj = lre_index.
get_v() + 1;
143 for (
int j=1;j<=num_local_re;j++)
145 int lrej = *plre_indexj;
166 funnel_init_var::num_active_parameters=0;
178 num_separable_calls++;
192 ivector lfe_index(1,(
int)funnel_init_var::num_active_parameters);
194 for (
int i=1;i<=(int)funnel_init_var::num_active_parameters;i++)
200 else if (list(i,1)>0)
215 for (
int i=1;i<=us;i++)
217 for (
int j=1;j<=us;j++)
219 int i2=list(lre_index(i),2);
220 int j2=list(lre_index(j),2);
221 local_Hess(i,j)+=locy(i2).u_bar[j2-1];
225 for (
int i=1;i<=us;i++)
227 for (
int j=1;j<=xs;j++)
229 int i2=list(lre_index(i),2);
230 int j2=list(lfe_index(j),2);
231 local_Dux(i,j)=locy(i2).u_bar[j2-1];
238 for (
int i=1;i<=us;i++)
240 for (
int j=1;j<=us;j++)
242 int i2=list(lre_index(i),2);
243 int j2=list(lre_index(j),2);
244 locy(i2).get_u_bar_tilde()[j2-1]=
245 (*block_diagonal_vhessianadjoint)(num_separable_calls)(i,j);
259 for (
int i=1;i<=xs;i++)
261 int i2=list(lfe_index(i),2);
262 xtmp(i)+=locy[i2].u_tilde[0];
263 local_xadjoint(i)+=locy[i2].u_tilde[0];
267 for (
int i=1;i<=us;i++)
269 int i2=list(lre_index(i),2);
270 utmp(i)+=locy[i2].u_tilde[0];
271 local_uadjoint(i)+=locy[i2].u_tilde[0];
274 local_xadjoint -=
solve(local_Hess,local_uadjoint)*local_Dux;
276 for (
int i=1;i<=xs;i++)
279 check_local_xadjoint2(list(ii,1))+=local_xadjoint(i);
289 funnel_init_var::num_active_parameters=0;
void initialize(void)
Description not yet available.
df1b2_gradlist * f1b2gradlist
void set_dependent_variable(const df1b2variable &_x)
Description not yet available.
static void set_no_derivatives(void)
Description not yet available.
Description not yet available.
Vector of double precision numbers.
static int num_inactive_vars
void do_separable_stuff_laplace_approximation_importance_sampling_adjoint(df1b2variable &)
Description not yet available.
void initialize(void)
Description not yet available.
Description not yet available.
void get_block_diagonal_hessian(df1b2variable &)
Description not yet available.
void initialize(void)
Description not yet available.
dvector solve(const dmatrix &aa, const dvector &z)
Solve a linear system using LU decomposition.
Array of integers(int) with indexes from index_min to indexmax.
static unsigned int num_active_parameters
Description not yet available.
Description not yet available.
void initialize(void)
Initialze all elements of dvector to zero.
void initialize(void)
Description not yet available.
Description not yet available.
static unsigned int num_vars
static init_df1b2vector * py
void initialize(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void reset(void)
Description not yet available.
int have_bounded_random_effects
void df1b2_gradcalc1(void)
Description not yet available.