12 using std::istringstream;
25 static int write_sparse_flag=0;
26 static void trapper(
void)
96 while (fmc1.ireturn>=0)
151 output_stream <<
" inner maxg = " << std::scientific << setprecision(10) << fmc1.gmax;
153 if (
fabs(fmc1.gmax)>1.e+3)
157 if (
fabs(fmc1.gmax)>1.e-4)
168 while (fmc1.ireturn>=0)
196 output_stream <<
" Inner second time = " << std::scientific << setprecision(10) << fmc1.gmax;
198 output_stream <<
" Inner f = " << std::scientific << setprecision(10) << fb <<
endl;
233 int iprint_save=pfmin->
iprint;
234 pfmin->
iprint=inner_iprint;
236 pfmin->
iprint=iprint_save;
239 cout <<
" Inner f = " << std::scientific << setprecision(10) << f <<
endl;
252 ivector& maxder,
int nvariables)
254 if (num_der_blocks==0)
258 #if defined(USE_ADPVM)
271 int nd=nvariables/ndb;
272 int r= nvariables - nd * ndb;
277 maxder(1)=partition(1);
281 minder(i)=maxder(i-1)+1;
282 maxder(i)=minder(i)+partition(i)-1;
284 send_int_to_slaves(minder(2,ndb));
285 send_int_to_slaves(maxder(2,ndb));
292 minder(1)=get_int_from_master();
293 maxder(1)=get_int_from_master();
303 int nd=nvariables/num_der_blocks;
304 int r= nvariables - nd * num_der_blocks;
305 ivector partition(1,num_der_blocks);
310 maxder(1)=partition(1);
311 for (
int i=2;i<=num_der_blocks;i++)
313 minder(i)=maxder(i-1)+1;
314 maxder(i)=minder(i)+partition(i)-1;
332 separable_call_level(0),
333 triplet_information(0),
334 compressed_triplet_information(0),
335 nested_separable_calls_counter(1,10),
336 nested_tree_position(1,5),
337 local_dtemp(1,_xsize),
340 block_diagonal_flag(0),
347 sparse_count_adjoint(0),
350 vsparse_triplet_adjoint(0),
356 check_local_uadjoint(1,_usize),
357 check_local_uadjoint2(1,_usize),
358 check_local_xadjoint(1,_xsize),
359 check_local_xadjoint2(1,_xsize),
365 nested_shape.allocate(100,100,10);
366 nested_shape.initialize();
367 nested_tree_position.initialize();
368 nested_separable_calls_counter.initialize();
373 importance_sampling_components=0;
374 is_diagnostics_flag=0;
375 importance_sampling_values = 0;
376 importance_sampling_weights = 0;
377 no_function_component_flag=0;
381 in_gauss_hermite_phase=0;
382 multi_random_effects=0;
385 num_separable_calls=0;
386 separable_calls_counter=0;
387 importance_sampling_counter=0;
388 num_local_re_array=0;
389 num_local_fixed_array=0;
394 separable_function_difference=0;
396 block_diagonal_hessian=0;
397 block_diagonal_Dux=0;
398 block_diagonal_re_list=0;
399 block_diagonal_fe_list=0;
400 block_diagonal_vhessian=0;
401 block_diagonal_vhessianadjoint=0;
403 block_diagonal_vch=0;
404 have_users_hesstype=0;
405 pHess_non_quadprior_part=0;
418 cerr <<
"Usage -ndi option needs integer -- set to default 20000.\n";
425 cerr <<
"Usage -ndi option needs positive integer"
426 " -- set to defalt 20000" <<
endl;
459 cerr <<
"Usage -ilmn option needs integer -- set to default 10" <<
endl;
466 cerr <<
"Usage -ilmn option needs positive integer"
467 " -- set to defalt 10" <<
endl;
486 cerr <<
"Usage -ndb option needs non-negative integer -- ignored.\n";
491 if (_num_der_blocks<=0)
493 cerr <<
"Usage -ndb option needs positive integer -- ignored" <<
endl;
497 num_der_blocks=_num_der_blocks;
506 cerr <<
"Usage -isf option needs non-negative integer -- ignored.\n";
511 if (_nfunnelblocks<=0)
513 cerr <<
"Usage -isf option needs positive integer -- ignored" <<
endl;
517 nfunnelblocks=_nfunnelblocks;
539 nvariables=xsize+usize;
546 if (nvariables/num_der_blocks<xsize)
548 cerr <<
" Error -- the number of der blocks (-ndb) can not be larger than "
549 << nvariables/xsize <<
endl;
561 for (
int i=1;i<=num_der_blocks;i++)
563 if (minder(i)<1 || maxder(i) > nvariables || maxder(i) < minder(i))
565 cerr <<
" minder or maxder value out of bounds in"
566 "laplace_approximation_calculator constructor "
567 <<
endl <<
" values are minder = " << minder
568 <<
" maxder = " << maxder <<
endl;
578 cerr <<
"Usage -nr option needs non-negative integer -- ignored" <<
endl;
585 cerr <<
"Usage -nr option needs non-negative integer -- ignored.\n";
589 num_nr_iters=_num_nr_iters;
605 double _nr_crit=1.e-11;
611 cerr <<
"Usage -nrcrit option needs number -- ignored" <<
endl;
620 cerr <<
"Usage -nrcrit option needs positive number -- ignored.\n";
633 cerr <<
"Usage -gh option needs positive integer -- ignored" <<
endl;
640 cerr <<
"Usage -gh option needs positive integer -- ignored" <<
endl;
644 use_gauss_hermite=_inner_gh;
652 double _inner_crit=0.0;;
655 cerr <<
"Usage -icrit option needs number -- ignored" <<
endl;
664 cerr <<
"Usage -icrit option needs positive number -- ignored" <<
endl;
670 inner_crit=_inner_crit;
673 fmc1.crit=inner_crit;
682 cerr <<
"Usage -iprint option needs non-negative integer -- ignored.\n";
687 if (_inner_iprint<=0)
689 cerr <<
"Usage -iip option needs non-negative integer -- ignored.\n";
693 inner_iprint=_inner_iprint;
697 fmc1.iprint=inner_iprint;
704 cerr <<
"Usage -maxfn option needs non-negative integer -- ignored.\n";
711 cerr <<
"Usage -iip option needs non-negative integer -- ignored.\n";
715 inner_maxfn=_inner_maxfn;
719 fmc1.maxfn=inner_maxfn;
724 num_importance_samples=0;
729 cerr <<
"Usage -is option needs positive integer -- ignored" <<
endl;
736 cerr <<
"Usage -is option needs non-negative integer -- ignored.\n";
740 num_importance_samples=tht;
747 cerr <<
"Usage -is option needs non-negative integer -- ignored.\n";
762 cerr <<
"Usage -isb option needs positive integer -- ignored" <<
endl;
769 cerr <<
"Usage -isb option needs non-negative integer -- ignored.\n";
773 num_importance_samples=2*tht;
780 cerr <<
"Usage -isb option needs non-negative integer -- ignored.\n";
794 if (num_importance_samples)
798 is_diagnostics_flag=1;
800 if (importance_sampling_values)
802 delete importance_sampling_values;
803 importance_sampling_values=0;
805 importance_sampling_values =
806 new dvector(1,num_importance_samples);
808 if (importance_sampling_weights)
810 delete importance_sampling_weights;
811 importance_sampling_weights=0;
813 importance_sampling_weights =
814 new dvector(1,num_importance_samples);
817 if (
allocated(epsilon)) epsilon.deallocate();
821 if (num_importance_samples%2)
822 num_importance_samples+=1;
824 epsilon.allocate(1,num_importance_samples,1,usize);
827 int n2=num_importance_samples/2;
828 epsilon.sub(1,n2).fill_randn(rng);
831 dmatrix os(1,num_importance_samples,1,usize);
833 for (
int i=1;i<=num_importance_samples;i++)
835 for (
int j=1;j<=usize;j++)
837 if (os(i,j)<0.05) epsilon(i,j)*=3.0;
841 for (
int i=1;i<=n2;i++)
843 epsilon(i+n2)=-epsilon(i);
848 epsilon.fill_randn(rng);
851 dmatrix os(1,num_importance_samples,1,usize);
853 for (
int i=1;i<=num_importance_samples;i++)
855 for (
int j=1;j<=usize;j++)
857 if (os(i,j)<0.05) epsilon(i,j)*=3.0;
868 cerr <<
"Usage -epsmult option needs number -- ignored" <<
endl;
875 if (eps_mult<=0.0 || eps_mult>1.0)
877 cerr <<
"Usage -epsmult option needs positive number between 0 and 1 "
878 "-- ignored" <<
endl;
882 for (
int i=1;i<=num_importance_samples;i++)
884 epsilon(i)*=eps_mult;
894 cerr <<
"Usage -ht option needs positive integer -- ignored" <<
endl;
895 set_default_hessian_type();
902 cerr <<
"Usage -ht option needs non-negative integer -- ignored.\n";
903 set_default_hessian_type();
907 have_users_hesstype=1;
915 cerr <<
"Usage -ht option needs non-negative bandwidth"
916 " -- ignored" <<
endl;
927 set_default_hessian_type();
932 assert(maxder(1) >= minder(1));
934 nvar = (
unsigned int)(maxder(1) - minder(1) + 1);
941 grad.allocate(1,usize);
942 Hess.allocate(1,usize,1,usize);
943 Hessadjoint.allocate(1,usize,1,usize);
944 Dux.allocate(1,usize,1,xsize);
952 grad.allocate(1,usize);
953 Dux.allocate(1,usize,1,xsize);
960 step.allocate(1,usize);
963 2000000U,100000U,
adstring(
"f1b2list1"));
976 if (sparse_hessian_flag==0)
984 y.allocate(1,nvariables);
988 unsigned int nsave=nvar;
996 y.allocate(1,nvariables);
1003 cout <<
"this can't happen" <<
endl;
1009 assert(nvariables >= 0);
1012 (
unsigned int)nvariables;
1029 separable_call_level(1),
1030 triplet_information(0),
1031 compressed_triplet_information(0),
1032 nested_separable_calls_counter(1,10),
1033 nested_tree_position(1,5),
1042 sparse_count_adjoint(0),
1045 vsparse_triplet_adjoint(0),
1047 sparse_symbolic2(0),
1051 check_local_uadjoint(1,_usize),
1052 check_local_uadjoint2(1,_usize),
1053 check_local_xadjoint(1,_xsize),
1054 check_local_xadjoint2(1,_xsize),
1101 cerr <<
" minder or maxder value out of bounds in"
1102 "laplace_approximation_calculator constructor "
1119 2000000U,100000U,
adstring(
"f1b2list1"));
1297 dvector laplace_approximation_calculator::operator()
1302 #if defined(USE_ADPVM)
1305 return test_trust_region_method(_x,_f,pfmin);
1312 return default_calculations_parallel_master(_x,_f,pfmin);
1317 default_calculations_parallel_slave(_x,_f,pfmin);
1322 cerr <<
"illegal value for mode " <<
endl;
1327 #endif //# if defined(USE_ADPVM)
1336 int check_der_flag=0;
1343 if (check_der_flag==1)
1345 g = default_calculations_check_derivatives(_x,pfmin,_f);
1349 g = default_calculations(_x,_f,pfmin);
1356 g = block_diagonal_calculations(_x,_f,pfmin);
1363 if (laplace_approximation_calculator::variance_components_vector)
1365 g = banded_calculations_lme(_x,_f,pfmin);
1369 g = banded_calculations(_x,_f,pfmin);
1375 cerr <<
"illegal value for hesstype " <<
endl;
1401 int xsize=lpc->
xsize;
1402 int usize=lpc->
usize;
1404 for (
int ip=1;ip<=num_der_blocks;ip++)
1410 (*re_objective_function_value::pobjfun)=0;
1428 (*re_objective_function_value::pobjfun)+=pen;
1429 (*re_objective_function_value::pobjfun)+=zz;
1436 int mind=y(1).minder;
1437 int jmin=
max(mind,xsize+1);
1438 int jmax=
min(y(1).maxder,xsize+usize);
1439 for (i=1;i<=usize;i++)
1440 for (j=jmin;j<=jmax;j++){
1442 Hess(i,j-xsize)=y(i+xsize).u_bar[j-mind];
1445 jmax=
min(y(1).maxder,xsize);
1446 for (i=1;i<=usize;i++)
1447 for (j=jmin;j<=jmax;j++)
1448 Dux(i,j)=y(i+xsize).u_bar[j-1];
1450 if (ip<num_der_blocks)
1451 f1b2gradlist->
reset();
1457 cout<<
"--------------------------------------------------------------------"<<
endl;
1458 cout <<
"param:" <<
endl;
1459 for (i=1;i<=usize;i++)cout << y(i+xsize)<<
" ";
1461 cout<<
"--------------------------------------------------------------------"<<
endl;
1462 cout <<
"Hess:" <<
endl;
1463 cout << Hess <<
endl;
1464 cout<<
"--------------------------------------------------------------------"<<
endl;
1484 #if !defined(OPT_LIB) && (__cplusplus >= 201103L)
1485 const int xs = [](
unsigned int size)->
int
1487 assert(size <= INT_MAX);
1488 return static_cast<int>(size);
1490 const int us = [](
unsigned int size)->
int
1492 assert(size <= INT_MAX);
1493 return static_cast<int>(size);
1496 const int xs =
static_cast<int>(x.
size());
1497 const int us =
static_cast<int>(u0.
size());
1522 nvar = xs + us + us * us;
1527 nvar = xs + us + sz;
1552 int mmin=Hess.indexmin();
1553 int mmax=Hess.indexmax();
1554 Hess_save.
allocate(mmin,mmax,mmin,mmax);
1556 int & vxs = (
int&)(xs);
1580 for (i=smin;i<=smax;i++)
1606 vHess(i,j)=vy(ii++)/(d(i+xs)*d(j+xs));
1608 vHess(i,j)=vy(ii++)/d(i+xs);
1616 vHess(i,j)=vy(ii++)/d(j+xs);
1618 vHess(i,j)=vy(ii++);
1631 vHess(i,j)=vy(ii++);
1642 if (vsparse_triplet==0)
1647 for (i=mmin;i<=mmax;i++)
1649 (*vsparse_triplet)(1,i)=lst(1,i);
1650 (*vsparse_triplet)(2,i)=lst(2,i);
1657 (*vsparse_triplet).allocate(mmin,mmax,us,us);
1658 for (i=mmin;i<=mmax;i++)
1660 (*vsparse_triplet)(1,i)=lst(1,i);
1661 (*vsparse_triplet)(2,i)=lst(2,i);
1668 if (vsparse_triplet_adjoint==0)
1673 for (i=mmin;i<=mmax;i++)
1675 (*vsparse_triplet_adjoint)(1,i)=lst(1,i);
1676 (*vsparse_triplet_adjoint)(2,i)=lst(2,i);
1681 if (!
allocated(*vsparse_triplet_adjoint))
1683 (*vsparse_triplet_adjoint).allocate(mmin,mmax,us,us);
1684 for (i=mmin;i<=mmax;i++)
1686 (*vsparse_triplet_adjoint)(1,i)=lst(1,i);
1687 (*vsparse_triplet_adjoint)(2,i)=lst(2,i);
1691 vsparse_triplet->
get_x()=vy(ii,ii+mmax-mmin).
shift(1);
1733 ld=0.5*
ln_det(vHess,sgn);
1737 ld=0.5*
ln_det(-vHess,sgn);
1750 ofstream ofs(
"hessian.diag");
1751 ofs << vHess <<
endl;
1754 ofs <<
"Matrix not positive definite in Ln_det_choleski"
1756 cerr <<
"Matrix not positive definite in Ln_det_choleski\n"
1757 <<
"see file hessian.diag for details"
1768 if (write_sparse_flag)
1788 cerr <<
"need to fix this" <<
endl;
1800 cout <<
" ln_det = " << ld <<
" ";
1809 cout << ss(1,1) <<
" " << ss(1,eig.
indexmax()) <<
" " ;
1810 int nnn=(int)ss(2,1);
1819 cout <<
" t " << setprecision(3) << ss2(1)(1,5) <<
" --- "
1820 << t(nnn)*cHess*t(nnn) <<
endl;
1821 cout <<
" " << setprecision(3) << ss2(2)(1,5) << endl;
1832 f-=us*0.5*
log(2.0*
PI);
1844 xadjoint(i)=g(ii++);
1846 uadjoint(i)=g(ii++);
1856 Hessadjoint(i,j)=g(ii++);
1866 for (i=smin;i<=smax;i++)
1868 (*vsparse_triplet_adjoint)(i)=g(ii);
1938 (*re_objective_function_value::pobjfun)=0;
1944 (*re_objective_function_value::pobjfun)+=pen;
1945 (*re_objective_function_value::pobjfun)+=zz;
1951 int mind=y(1).minder;
1952 int jmin=
max(mind,xs+1);
1953 int jmax=
min(y(1).maxder,xs+us);
1958 for (j=jmin;j<=jmax;j++)
1959 Hess(i,j-xs)=y(i+xs).u_bar[j-mind];
1960 for (j=jmin;j<=jmax;j++)
2051 std::streamsize save = output_stream.precision();
2052 output_stream << std::fixed << setprecision(10) <<
" f = " << vf
2053 <<
" max g = " << std::scientific << maxg <<
endl;
2054 output_stream.precision(save);
2090 output_stream << std::fixed << setprecision(10) <<
" f = " << vf
2091 <<
" max g = " << std::scientific << maxg <<
endl;
2127 output_stream << std::fixed << setprecision(10) <<
" f = " << vf
2128 <<
" max g = " << std::scientific << maxg <<
endl;
2188 xadjoint=g(1,xsize);
2189 uadjoint=g(xsize+1,xsize+us).
shift(1);
2241 df1b2variable::adpool_counter=0;
2251 int use_gauss_hermite,
int num_separable_calls ,
const ivector& itmp) :
2252 x(1,use_gauss_hermite),
w(1,use_gauss_hermite), mi(0)
2257 for (i=2;i<=num_separable_calls;i++)
2259 if (itmp(i)!=itmp(i-1))
2261 cerr <<
" At present for the adaptive gauss_hermite must have the same"
2263 <<
" number of random effects in each separable function call"
2268 for (i=1;i<=num_separable_calls;i++)
2283 gauss_hermite_values.deallocate();
2286 gauss_hermite_values.allocate(1,num_separable_calls,1,use_gauss_hermite);
2291 gauss_hermite_values.allocate(1,num_separable_calls,1,indx);
2402 if (clean_level==0) clean_level=ll+1;
2420 if (clean_level==0) clean_level=ll+1;
2438 if (clean_level==0) clean_level=ll+1;
2456 if (clean_level==0) clean_level=ll+1;
2471 cerr <<
"illegal value in " <<
2472 "laplace_approximation_calculator::build_up_nested_shape"
2478 for (
int i=clean_level;i<=mmax;i++)
2530 s<< *(m.get_ptr1()) <<
endl <<
endl;
2533 s<< *(m.get_ptr2()) <<
endl <<
endl;
2536 s<< *(m.get_ptr3()) <<
endl <<
endl;
2539 s<< *(m.get_ptr4()) <<
endl <<
endl;
2555 for (
int i=imin;i<=imax;i++)
2557 if ( (*
ptr1)(i)==0)
break;
2569 (*tmp)=(*ptr1)(1,mmax1);
2585 for (
int i=imin;i<=imax;i++)
2587 int jmin=(*ptr2)(i).indexmin();
2588 int jmax=(*ptr2)(i).indexmax();
2590 for (
int j=jmin;j<=jmax;j++)
2592 if ((*
ptr2)(i,j)==0)
break;
2598 (*tmp)(i)=(*
ptr2)(i)(1,mmax2);
2607 cerr <<
"warning not dealitn with prt3" <<
endl;
2778 mmax=nsc.get_ptr1()->indexmax();
2795 ptr2=
new i3_array(1,mmax,1,*nsc.get_ptr1(),1,*nsc.get_ptr2());
2804 ptr3=
new i4_array(1,mmax,1,*nsc.get_ptr1(),1,*nsc.get_ptr2(),
2847 while (fmc1.ireturn>=0)
2866 if (saddlepointflag)
2902 output_stream <<
" inner maxg = " << std::scientific << setprecision(10) << fmc1.gmax;
2904 if (
fabs(fmc1.gmax)>1.e+3)
2908 if (
fabs(fmc1.gmax)>1.e-4)
2919 while (fmc1.ireturn>=0)
2947 output_stream <<
" Inner second time = " << std::scientific << setprecision(10) << fmc1.gmax;
2949 output_stream <<
" Inner f = " << std::scientific << setprecision(10) << fb <<
endl;
static int straight_through_flag
Description not yet available.
void cleanup_laplace_stuff(laplace_approximation_calculator *)
Description not yet available.
laplace_approximation_calculator * lapprox
static dvar_vector * variance_components_vector
static void reset(const init_df1b2vector &, const df1b2variable &)
Description not yet available.
dcompressed_triplet * sparse_triplet2
static adpvm_manager * pvm_manager
virtual void AD_uf_inner()
static void set_yes_derivatives(void)
df1b2_gradlist * f1b2gradlist
void set_dependent_variable(const df1b2variable &_x)
Description not yet available.
static adpool * adpool_vector[]
static void set_no_derivatives(void)
Description not yet available.
void set_partition_sizes(int &num_der_blocks, ivector &minder, ivector &maxder, int nvariables)
Description not yet available.
Description not yet available.
static void set_NO_DERIVATIVES(void)
Disable accumulation of derivative information.
dcompressed_triplet * sparse_triplet
Description not yet available.
dvar_vector & shift(int min)
Description not yet available.
static void set_active_random_effects(void)
void allocate(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void deallocate()
Deallocate dmatrix memory.
dmatrix * pHess_non_quadprior_part
double get_fx_fu(function_minimizer *pfmin)
Description not yet available.
imatrix * block_diagonal_re_list
void begin_separable_call_stuff(void)
Description not yet available.
i3_array * get_ptr3(void)
Description not yet available.
dmatrix trans(const dmatrix &m1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvector eigenvalues(const banded_symmetric_dmatrix &_SS)
Description not yet available.
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.
d3_array * Hess_components
static int inner_opt_flag
dvar_matrix * importance_sampling_components
imatrix * block_diagonal_fe_list
static void set_minder(int n)
static int separable_flag
static unsigned int nvar_vector[]
static void set_blocksize(void)
Description not yet available.
void allocate(int ncl, int ncu)
Allocate memory for a dvector.
void fill_seqadd(double, double)
Fills dvector elements with values starting from base and incremented by offset.
static int sparse_hessian_flag
static re_objective_function_value * pobjfun
hs_symbolic * sparse_symbolic2
void build_up_nested_shape(void)
Description not yet available.
df1_two_variable fabs(const df1_two_variable &x)
gauss_hermite_stuff(laplace_approximation_calculator *lapprox, int use_gauss_hermite, int num_separable_calls, const ivector &itmp)
Description not yet available.
void allocate(int)
Description not yet available.
double calculate_laplace_approximation(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.
static int where_are_we_flag
Description not yet available.
d3_array * block_diagonal_Dux
static dvariable reset(const dvar_vector &x)
dvector * importance_sampling_weights
void trim(void)
Description not yet available.
laplace_approximation_calculator(int _xsize, int _usize, int _minder, int _maxder, function_minimizer *pfmin)
Description not yet available.
void initialize(void)
Description not yet available.
d3_array * block_diagonal_ch
dvector * importance_sampling_values
Description not yet available.
void gradcalc(int nvar, const dvector &g)
int atoi(adstring &s)
Returns a integer converted from input s.
void deallocate(void)
Description not yet available.
ivector sgn(const dvector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
~laplace_approximation_calculator()
Destructor.
static int no_ln_det_choleski_flag
void set_u_dot(int i)
Description not yet available.
Description not yet available.
static int stddev_vscale(const dvar_vector &d, const dvar_vector &x)
static void set_maxder(int n)
dvariable ln_det_choleski_error(const dvar_matrix &, int &ierr)
Description not yet available.
banded_symmetric_dmatrix * bHess
dcompressed_triplet * vsparse_triplet_adjoint
ivector nested_separable_calls_counter
double evaluate_function(const dvector &x, function_minimizer *pfmin)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void check_for_need_to_reallocate(int ip)
Does Nothing.
void set_default_hessian_type(void)
Description not yet available.
int num_importance_samples
void limited_memory_quasi_newton(const independent_variables &, int)
static int print_hess_and_exit_flag
dvar3_array * block_diagonal_vch
Description not yet available.
dmatrix sort(const dmatrix &m, int column, int NSTACK)
Description not yet available.
dvector get_uhat_quasi_newton(const dvector &x, function_minimizer *pfmin)
Description not yet available.
prnstream & endl(prnstream &)
dmatrix eigenvectors(const banded_symmetric_dmatrix &_SS, const dvector &_e)
Description not yet available.
Description not yet available.
Array of integers(int) with indexes from index_min to indexmax.
dvar_vector & get_x(void)
void fill_randu(long int &n)
Fill matrix with random numbers.
void allocate(int lib, int ub)
void initialize(void)
Description not yet available.
int indexmax() const
Get maximum valid index.
void normalized_gauss_hermite(const dvector &_x, const dvector &_w)
Gauss-Hermite quadature.
static objective_function_value * pobjfun
Description not yet available.
static void xinit(const dvector &x)
Description not yet available.
hs_symbolic * sparse_symbolic
Description not yet available.
i3_array * triplet_information
void initialize(void)
Initialze all elements of dvector to zero.
dvector & shift(int min)
Shift valid range of subscripts.
void evaluate_function_gradient(double &f, const dvector &x, function_minimizer *pfmin, dvector &xadjoint, dvector &uadjoint)
Description not yet available.
d3_array * block_diagonal_vhessianadjoint
Description not yet available.
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.
int option_match(int argc, char *argv[], const char *string)
Checks if the program has been invoked with a particular command line argument ("string").
std::ostream & get_output_stream()
void get_newton_raphson_info(int xs, int us, const init_df1b2vector _y, dmatrix &Hess, dvector &grad, df1b2_gradlist *f1b2gradlist, function_minimizer *pfmin)
Description not yet available.
static void set_nvar(unsigned int n)
void initialize(void)
Description not yet available.
dvar3_array * block_diagonal_vhessian
ivector * num_local_fixed_array
void allocate(const nested_calls_shape &nsc)
Description not yet available.
static void allocate(const unsigned int _n)
Description not yet available.
ostream & operator<<(const ostream &_s, preshowpoint p)
Description not yet available.
double CHECK_HESSIAN_PENALTY
static int have_bounded_random_effects
Description not yet available.
Class definition of matrix with derivitive information .
virtual void AD_uf_outer()
ivector nested_tree_position
~nested_calls_shape()
Description not yet available.
ivector * get_ptr1(void)
Description not yet available.
Description not yet available.
double ln_det_choleski(const banded_symmetric_dmatrix &MM, int &ierr)
i4_array * get_ptr4(void)
Description not yet available.
double evaluate_function_quiet(const dvector &x, function_minimizer *pfmin)
Description not yet available.
static int saddlepointflag
dvar_compressed_triplet * vsparse_triplet
banded_symmetric_dmatrix * bHessadjoint
d3_array * block_diagonal_hessian
Description not yet available.
static int test_trust_flag
Description not yet available.
static void increment_adpool_counter(void)
Description not yet available.
static void set_YES_DERIVATIVES(void)
Enable accumulation of derivative information.
void allocate(int nrl, int nrh, int ncl, int nch)
Allocates AD variable matrix with dimensions nrl to nrh by ncl to nch.
virtual void user_function()
void initialize(int sl, int sh, int nrl, const ivector &nrh, int ncl, const ivector &nch)
void get_second_ders(int xs, int us, const init_df1b2vector y, dmatrix &Hess, dmatrix &Dux, df1b2_gradlist *f1b2gradlist, function_minimizer *pfmin)
static void get_cHessian_contribution(dmatrix, int)
Description not yet available.
static lmatrix * pointer_table
void random_effects_userfunction(double f, const dvector &x, const dvector &g)
void initialize()
Initializes elements of i4_array to zero.
dvector value(const df1_one_vector &v)
Description not yet available.
dvector get_uhat_lm_newton2(const dvector &x, function_minimizer *pfmin)
Description not yet available.
void end_separable_call_stuff(void)
Description not yet available.
static int adpool_counter
dvector get_uhat_lm_newton(const dvector &x, function_minimizer *pfmin)
Description not yet available.
void initialize(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static int get_num_quadratic_prior(void)
static double fun_without_pen
static double fun_without_pen
nested_calls_shape nested_shape
double evaluate_function_no_derivatives(const dvector &x, function_minimizer *pfmin)
Description not yet available.
void allocate(const ad_integer &ncl, const index_type &ncu)
Allocate vector of integers with dimension [_ncl to _nch].
void reset(void)
Description not yet available.
static int alternative_user_function_flag
Fundamental data type for reverse mode automatic differentiation.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void df1b2_gradcalc1(void)
Description not yet available.
static int print_importance_sampling_weights_flag
static void set_inactive_only_random_effects(void)
imatrix * get_ptr2(void)
Description not yet available.
dvector * separable_function_difference
d3_array pow(const d3_array &m, int e)
Description not yet available.
static int separable_calculation_type
static void get_M_calculations(void)
Description not yet available.