31 #if !defined(OPT_LIB) && (__cplusplus >= 201103L)
32 const int xs = [](
unsigned int size)->
int
34 assert(size <= INT_MAX);
35 return static_cast<int>(size);
37 const int us = [](
unsigned int size)->
int
39 assert(size <= INT_MAX);
40 return static_cast<int>(size);
43 const int xs =
static_cast<int>(x.
size());
44 const int us =
static_cast<int>(u0.
size());
50 int nvar = xs + us + hroom;
66 int & vxs = (
int&)(xs);
79 for (
int ic=1;ic<=nsc;ic++)
82 for (
int i=1;i<=lus;i++)
83 for (
int j=1;j<=lus;j++)
95 cerr <<
"can't do importance sampling with bounded random effects"
96 " at present" <<
endl;
101 for (
int ic=1;ic<=nsc;ic++)
106 for (
int i=1;i<=lus;i++)
108 for (
int j=1;j<=lus;j++)
110 block_diagonal_vhessian(ic,i,j)=vy(ii++);
113 block_diagonal_ch(ic)=
146 for (
int ic=1;ic<=nsc;ic++)
155 for (
int iu=1;iu<=lus;iu++)
157 xv(iu)= xx(mi()(iu));
159 tau(offset+1,offset+lus).
shift(1)=block_diagonal_ch(ic)*xv;
171 for (
int i=mmin;i<=mmax;i++)
175 for (
int j=cmin;j<=cmax;j++)
177 vy(ls(i,j))+=tau(ii++);
182 cerr <<
"error in interface" <<
endl;
187 for (
int i=mmin;i<=mmax;i++)
191 for (
int j=cmin;j<=cmax;j++)
193 vy(ls(i,j))-=tau(ii++);
211 for (
int ic=1;ic<=nsc;ic++)
213 if (
allocated(block_diagonal_vhessian(ic)))
215 ld+=
ln_det(block_diagonal_vhessian(ic),sgn);
222 for (
int ic=1;ic<=nsc;ic++)
224 if (
allocated(block_diagonal_vhessian(ic)))
240 vy(xs+1,xs+us).
shift(1)=u0;
247 for (
int i=1;i<=xs;i++)
249 for (
int i=1;i<=us;i++)
251 for (
int ic=1;ic<=nsc;ic++)
254 for (
int i=1;i<=lus;i++)
256 for (
int j=1;j<=lus;j++)
laplace_approximation_calculator * lapprox
Description not yet available.
static void set_NO_DERIVATIVES(void)
Disable accumulation of derivative information.
Description not yet available.
dvar_vector & shift(int min)
Description not yet available.
static void set_active_random_effects(void)
imatrix * block_diagonal_re_list
int allocated(const ivector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Vector of double precision numbers.
Description not yet available.
void initialize(void)
Description not yet available.
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static dvariable reset(const dvar_vector &x)
dvariable do_gauss_hermite_integration(void)
void gradcalc(int nvar, const dvector &g)
df1_one_matrix choleski_decomp(const df1_one_matrix &MM)
ivector sgn(const dvector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static int no_ln_det_choleski_flag
dvar3_array * block_diagonal_vch
prnstream & endl(prnstream &)
Description not yet available.
Array of integers(int) with indexes from index_min to indexmax.
int in_gauss_hermite_phase
static objective_function_value * pobjfun
Description not yet available.
static void xinit(const dvector &x)
double do_gauss_hermite_block_diagonal_multi(const dvector &x, const dvector &u0, const dmatrix &Hess, const dvector &_xadjoint, const dvector &_uadjoint, const dmatrix &_Hessadjoint, function_minimizer *pmin)
Description not yet available.
Description not yet available.
Description not yet available.
d3_array * block_diagonal_vhessianadjoint
ivector * num_local_re_array
double ln_det(const dmatrix &m1, int &sgn)
Compute log determinant of a constant matrix.
unsigned int size() const
Get number of elements in array.
dvar3_array * block_diagonal_vhessian
static int have_bounded_random_effects
virtual void AD_uf_outer()
double ln_det_choleski(const banded_symmetric_dmatrix &MM, int &ierr)
d3_array * block_diagonal_hessian
Description not yet available.
Description not yet available.
static void set_YES_DERIVATIVES(void)
Enable accumulation of derivative information.
static void get_cHessian_contribution(dmatrix, int)
Description not yet available.
void initialize(const dvector &ww)
Description not yet available.
dvector value(const df1_one_vector &v)
Description not yet available.
static int get_num_quadratic_prior(void)
double square(const double value)
Return square of value; constant object.
Fundamental data type for reverse mode automatic differentiation.
df1_one_variable inv(const df1_one_variable &x)
static void set_inactive_only_random_effects(void)