32 int ad_comm::time_flag = 0;
33 adtimer* ad_comm::ptm =
nullptr;
34 adtimer* ad_comm::ptm1 =
nullptr;
45 cerr <<
"need to define this" <<
endl;
61 double& f = (
double&)_f;
77 if (ad_comm::time_flag)
88 if (ad_comm::time_flag)
95 (*ad_comm::global_logfile) <<
" Time pos 0 "
106 for (i=1;i<=
xsize;i++)
110 for (i=1;i<=
usize;i++)
139 for(
int ii=1;ii<=niters;ii++)
149 cout <<
"Checking derivatives " << ii <<
endl;
167 int print_hess_in_newton_raphson_flag=0;
168 if (print_hess_in_newton_raphson_flag)
173 (*ad_comm::global_logfile) << setprecision(4) <<
setscientific()
175 (*ad_comm::global_logfile) << setprecision(4) <<
setscientific()
182 #if defined(USE_ATLAS)
212 if (ad_comm::time_flag)
219 (*ad_comm::global_logfile) <<
" time_in solve " << ii <<
" "
237 double maxg_old=maxg;
250 for (i=1;i<=
usize;i++)
261 for (i=1;i<=
usize;i++)
268 if (ad_comm::time_flag)
275 (*ad_comm::global_logfile) <<
" Time in reset and evaluate function"
285 if (ad_comm::time_flag)
292 (*ad_comm::global_logfile) <<
" Time in dget second ders "
326 if (ad_comm::time_flag)
333 (*ad_comm::global_logfile) <<
"Time in calculate laplace approximation "
343 int mind=
y(1).minder;
346 for (i=1;i<=
usize;i++)
348 for (j=jmin;j<=jmax;j++)
359 *
y(j).get_u_tilde()=0;
372 (*re_objective_function_value::pobjfun)=0;
382 (*re_objective_function_value::pobjfun)+=pen;
383 (*re_objective_function_value::pobjfun)+=zz;
391 for (i=1;i<=
usize;i++)
393 for (j=jmin;j<=jmax;j++)
417 if (ad_comm::time_flag)
424 (*ad_comm::global_logfile) <<
" time for 3rd derivatives "
432 for (i=1;i<=
xsize;i++)
434 dtmp(i)=*
y(i).get_u_tilde();
439 assert(
nvar <= INT_MAX);
444 for (i=1;i<=
usize;i++)
451 for (i=1;i<=
xsize;i++)
455 for (i=1;i<=
usize;i++)
469 assert(
nvar <= INT_MAX);
483 for (i=1;i<=
usize;i++)
496 for (i=1;i<=
usize;i++)
505 for (i=1;i<=
xsize;i++)
526 #if defined(USE_ATLAS)
549 (*ad_comm::global_logfile) <<
" Time in second solve "
558 (*ad_comm::global_logfile) <<
" Total time in function evaluation "
static int straight_through_flag
void safe_deallocate()
Safely deallocates memory by reporting if shallow copies are still in scope.
void initialize(void)
Description not yet available.
static void reset(const init_df1b2vector &, const df1b2variable &)
Description not yet available.
virtual void AD_uf_inner()
double get_elapsed_time(void)
Returns the elapsed time in milliseconds from the timer object.
static void set_yes_derivatives(void)
df1b2_gradlist * f1b2gradlist
d3_array elem_prod(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements product of a(i, j, k) * b(i, j, k).
void set_dependent_variable(const df1b2variable &_x)
Description not yet available.
static void set_no_derivatives(void)
Description not yet available.
double calculate_importance_sample(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 void set_NO_DERIVATIVES(void)
Disable accumulation of derivative information.
Description not yet available.
static ofstream * global_logfile
void check_pool_size(void)
Description not yet available.
dvector atlas_solve_spd(const dmatrix &M, const dvector &x)
dvector default_calculations_check_derivatives(const dvector &_x, function_minimizer *pfmin, const double &f)
Description not yet available.
static void get_Lxu_contribution(dmatrix &)
dvector eigenvalues(const banded_symmetric_dmatrix &_SS)
Description not yet available.
dmatrix trans(const dmatrix &m1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
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.
static int separable_flag
static void get_cgradient_contribution(dvector, int)
Description not yet available.
static re_objective_function_value * pobjfun
d3_array elem_div(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements division of a(i, j, k) / b(i, j, k).
dvector evaluate_function_with_quadprior(const dvector &x, int usize, function_minimizer *pfmin)
Description not yet available.
static void get_cHessian_contribution_from_vHessian(dmatrix, int)
Description not yet available.
df1_two_variable fabs(const df1_two_variable &x)
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
void initialize(void)
Description not yet available.
Description not yet available.
static dvariable reset(const dvar_vector &x)
Description not yet available.
Description not yet available.
void set_u_dot(int i)
Description not yet available.
void initialize(void)
Description not yet available.
double evaluate_function(const dvector &x, function_minimizer *pfmin)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvector solve(const dmatrix &aa, const dvector &z)
Solve a linear system using LU decomposition.
prescientific setscientific(void)
Description not yet available.
int num_importance_samples
static laplace_approximation_calculator * lapprox
dmatrix sort(const dmatrix &m, int column, int NSTACK)
Description not yet available.
dmatrix atlas_solve_spd_trans(const dmatrix &M, const dmatrix &x)
prnstream & endl(prnstream &)
static void set_active_only_random_effects(void)
double calculate_importance_sample_funnel(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.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double get_elapsed_time_and_reset(void)
Returns elapsed time in milliseconds of timer object and then resets the timer to current time...
static objective_function_value * pobjfun
Description not yet available.
static void xinit(const dvector &x)
Description not yet available.
double norm2(const d3_array &a)
Return sum of squared elements in a.
Description not yet available.
double evaluate_function_quiet(const dvector &x, function_minimizer *pfmin)
Description not yet available.
static int set_index(void)
Description not yet available.
Description not yet available.
static void set_YES_DERIVATIVES(void)
Enable accumulation of derivative information.
virtual void user_function()
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.
void safe_allocate(int ncl, int ncu)
Description not yet available.
static int get_num_quadratic_prior(void)
dvector value(const df1_one_vector &v)
static int stddev_scale(const dvector &d, const dvector &x)
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
void reset(void)
Description not yet available.
static int first_hessian_flag
dmatrix choleski_decomp_positive(const dmatrix &MM, double bound)
Description not yet available.
void df1b2_gradcalc1(void)
Description not yet available.
static void set_inactive_only_random_effects(void)
void check_derivatives(const dvector &, function_minimizer *pfmin, double fval1)
Description not yet available.
static int separable_calculation_type
static int in_qp_calculations