15 #define ISZERO(d) ((d)==0.0)
18 const int underflow_flag)
34 cerr <<
"Error opening file admodel.hes" <<
endl;
43 cout <<
"the number of independent variables is wrong in admodel.hes"
54 cerr <<
"Error reading the hessian from file admodel.hes" <<
endl;
91 double tmp=(h(i,j)+h(j,i))/2.;
129 for (i=1;i<=nvar;i++)
132 for (
int j=1;j<=i;j++)
134 S(i,j)=tmp*p(j)+n(i)*n(j);
139 for (i=1;i<=nvar;i++)
141 for (
int j=1;j<i;j++)
158 cerr <<
"Error restricted Hessian is not positive definite" <<
endl;
194 double f =
value(vf);
218 cout << g*fg/(
norm(g)*
norm(fg)) << endl;
222 double new_value,
const double& _fprof,
const int underflow_flag,
223 double global_min,
const double& _penalties,
const double& _final_weight)
225 double& penalties=(
double&) _penalties;
226 double& fprof=(
double&) _fprof;
227 double& final_weight=(
double&) _final_weight;
230 int max_profile_phases=3;
233 while (profile_phase <= max_profile_phases)
267 double weight =
pow(120.0,profile_phase);
270 weight /= (sigma*sigma);
278 if (fmc.
itn>itnsave && diff <
pow(.1,iprof)*sigma)
289 vf+=weight*
square(new_value-tv);
306 penalties=weight*(new_value-tv)*(new_value-tv);
318 fprof=global_min+20.0;
static likeprof_params * likeprofptr[500]
double projected_hess_determinant(const dvector &g, const int underflow_flag, const dvector &xscale, const double &ln_det_proj_jac)
laplace_approximation_calculator * lapprox
int separable_calls_counter
static void set_NO_DERIVATIVES(void)
Disable accumulation of derivative information.
Description not yet available.
Vector of double precision numbers.
void prof_minimize(int iprof, double sigma, double new_value, const double &fprof, const int underflow_flag, double global_min, const double &penalties, const double &final_weight)
static dvariable reset(const dvar_vector &x)
void fmin(const double &f, const dvector &x, const dvector &g)
Function fmin contains Quasi-Newton function minimizer with inexact line search using Wolfe condition...
static adstring adprogram_name
double norm(const d3_array &a)
Return computed norm value of a.
virtual dvariable variable(void)=0
void gradcalc(int nvar, const dvector &g)
ivector sgn(const dvector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
prnstream & endl(prnstream &)
Description not yet available.
static dvector maximum_function_evaluations
static int max_number_phases
int indexmax() const
Get maximum valid index.
static objective_function_value * pobjfun
Description not yet available.
static void xinit(const dvector &x)
Functions and variables for function minimizer.
Description not yet available.
double ln_det(const dmatrix &m1, int &sgn)
Compute log determinant of a constant matrix.
void get_particular_grad(int iprof, int nvar, const dvector &fg, const dvector &g)
Description not yet available.
static void set_YES_DERIVATIVES(void)
Enable accumulation of derivative information.
Description not yet available.
dvector value(const df1_one_vector &v)
virtual void userfunction(void)=0
static unsigned int wd_flag
static dvector convergence_criteria
double square(const double value)
Return square of value; constant object.
Fundamental data type for reverse mode automatic differentiation.
df1b2variable div(const df1b2variable &x, const df1b2variable &y)
Description not yet available.
d3_array pow(const d3_array &m, int e)
Description not yet available.