81 vf=0.5*
ln_det(Hess_all,sgn);
94 cerr <<
"Error[" << __FILE__ <<
':' << __LINE__
95 <<
"]: Max size exceeded.\n";
112 return (*
pu)*((*pMinv)*(*pu));
131 int mmin=(*fpu)(fpu->
indexmin()).get_ind_index();
151 for (i=imin;i<=imax;i++)
152 for (j=imin;j<=imax;j++)
153 H(i,j)+=(*pMinv)(i,j);
156 for (i=imin;i<=imax;i++)
157 for (j=imin;j<=imax;j++)
158 H(i,j)+=2.0*(*pMinv)(i,j);
161 for (i=imin;i<=imax;i++)
162 for (j=imin;j<=imax;j++)
163 H(i,j)+=2.0*(*pMinv)(i,j);
166 cerr <<
"Illegal value in switch statement" <<
endl;
176 for (i=imin;i<=imax;i++)
177 for (j=imin;j<=imax;j++)
178 H(offset+i,offset+j)+=(*pMinv)(i,j);
181 for (i=imin;i<=imax;i++)
182 for (j=imin;j<=imax;j++)
183 H(offset+i,offset+j)+=2.0*(*pMinv)(i,j);
186 for (i=imin;i<=imax;i++)
187 for (j=imin;j<=imax;j++)
188 H(offset+i,offset+j)+=2.0*(*pMinv)(i,j);
191 cerr <<
"Illegal value in switch statement" <<
endl;
212 for (i=imin;i<=imax;i++)
213 for (j=imin;j<=imax;j++)
214 H(i,j)+=(*pMinv)(i,j);
217 for (i=imin;i<=imax;i++)
218 for (j=imin;j<=imax;j++)
219 H(i,j)+=2.0*(*pMinv)(i,j);
222 for (i=imin;i<=imax;i++)
223 for (j=imin;j<=imax;j++)
224 H(i,j)+=2.0*(*pMinv)(i,j);
227 cerr <<
"Illegal value in switch statement" <<
endl;
237 for (i=imin;i<=imax;i++)
238 for (j=imin;j<=imax;j++)
239 H(offset+i,offset+j)+=(*pMinv)(i,j);
242 for (i=imin;i<=imax;i++)
243 for (j=imin;j<=imax;j++)
244 H(offset+i,offset+j)+=2.0*(*pMinv)(i,j);
247 for (i=imin;i<=imax;i++)
248 for (j=imin;j<=imax;j++)
249 H(offset+i,offset+j)+=2.0*(*pMinv)(i,j);
252 cerr <<
"Illegal value in switch statement" <<
endl;
266 cerr <<
"This can't happen" <<
endl;
279 for (
int i=imin;i<=imax;i++)
280 for (
int j=imin;j<=imax;j++)
281 H(i,j)+=(*dfpMinv)(i,j);
284 for (
int i=imin;i<=imax;i++)
285 for (
int j=imin;j<=imax;j++)
286 H(i,j)+=2.0*(*dfpMinv)(i,j);
289 for (
int i=imin;i<=imax;i++)
290 for (
int j=imin;j<=imax;j++)
291 H(i,j)+=2.0*(*dfpMinv)(i,j);
294 cerr <<
"Illegal valueinswitch statement" <<
endl;
303 for (
int i=imin;i<=imax;i++)
304 for (
int j=imin;j<=imax;j++)
305 H(offset+i,offset+j)+=(*dfpMinv)(i,j);
308 for (
int i=imin;i<=imax;i++)
309 for (
int j=imin;j<=imax;j++)
310 H(offset+i,offset+j)+=2.0*(*dfpMinv)(i,j);
313 for (
int i=imin;i<=imax;i++)
314 for (
int j=imin;j<=imax;j++)
315 H(offset+i,offset+j)+=2.0*(*dfpMinv)(i,j);
318 cerr <<
"Illegal valueinswitch statement" <<
endl;
348 for (i=imin;i<=imax;i++)
349 for (j=imin;j<=imax;j++)
353 for (i=imin;i<=imax;i++)
354 for (j=imin;j<=imax;j++)
358 for (i=imin;i<=imax;i++)
359 for (j=imin;j<=imax;j++)
364 cerr <<
"Illegal valueinswitch statement" <<
endl;
374 for (i=imin;i<=imax;i++)
375 for (j=imin;j<=imax;j++)
379 for (i=imin;i<=imax;i++)
380 for (j=imin;j<=imax;j++)
384 for (i=imin;i<=imax;i++)
385 for (j=imin;j<=imax;j++)
389 cerr <<
"Illegal valueinswitch statement" <<
endl;
421 for (i=imin;i<=imax;i++)
425 for (i=imin;i<=imax;i++)
429 for (i=imin;i<=imax;i++)
433 cerr <<
"Illegal valueinswitch statement" <<
endl;
443 for (i=imin;i<=imax;i++)
447 for (i=imin;i<=imax;i++)
448 g(offset+i)+=2.0*tg(i);
451 for (i=imin;i<=imax;i++)
452 g(offset+i)+=2.0*tg(i);
455 cerr <<
"Illegal valueinswitch statement" <<
endl;
512 cerr <<
"You must put random effects vector before"
513 " quadtratic prior in the TPL file" <<
endl;
597 cerr <<
"ptr["<<i<<
"] = 0 in"
598 " quadratic_prior::get_cHessian_contribution" <<
endl;
603 cerr <<
"ptr["<<i<<
"]->pMinv = 0 in"
604 " quadratic_prior::get_cHessian_contribution" <<
endl;
609 cerr <<
"*ptr["<<i<<
"] is unallocated in"
610 " quadratic_prior::get_cHessian_contribution" <<
endl;
674 get_num_active_parameters();
701 *objective_function_value::pobjfun+=(*pu)*(
solve(_M,*
pu));
704 *objective_function_value::pobjfun+=(*pu) * ( _M * (*pu) );
707 cerr <<
"Illegal value for quadratic_prior::old_style_flag"
730 cerr <<
"Error allocating dmatrix" <<
endl;
739 cerr <<
"Error allocating dvar_matrix" <<
endl;
750 cerr <<
"Error allocating dmatrix" <<
endl;
764 cerr <<
"Error allocating dvar_matrix" <<
endl;
773 cerr <<
"Error allocating dmatrix" <<
endl;
780 cerr <<
"Illegal value for quadratic_prior::old_style_flag"
798 cerr <<
" can't get here " <<
endl;
802 cerr <<
" can't get here " <<
endl;
809 cerr <<
"Illegal value for quadratic_prior::old_style_flag"
827 cerr <<
" can't get here " <<
endl;
837 cerr <<
"Error allocating dmatrix" <<
endl;
843 cerr <<
"Illegal value for quadratic_prior::old_style_flag"
void get_cHessian_from_vHessian(dmatrix, int)
Description not yet available.
laplace_approximation_calculator * lapprox
void operator=(const dvar_matrix &M)
Description not yet available.
virtual void AD_uf_inner()
virtual void get_cM(void)=0
virtual void set_old_style_flag(void)
Description not yet available.
constant_quadratic_re_penalty(void)
Description not yet available.
void operator=(const dmatrix &M)
Description not yet available.
dvariable get_function(void)
Description not yet available.
~quadratic_prior(void)
Destructor.
int allocated(const ivector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Vector of double precision numbers.
Description not yet available.
unsigned int get_num_active_parameters(void)
static void get_cgradient_contribution(dvector, int)
Description not yet available.
normal_quadratic_prior(void)
Description not yet available.
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.
static const int max_num_quadratic_prior
static int where_are_we_flag
static dvariable reset(const dvar_vector &x)
dvar_matrix get_Hessian(void)
Description not yet available.
void allocate(const dvar_vector &_u, const char *s)
Description not yet available.
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.
dvar_vector get_gradient(void)
Description not yet available.
static dvariable get_quadratic_priors(void)
Description not yet available.
dvector solve(const dmatrix &aa, const dvector &z)
Solve a linear system using LU decomposition.
prnstream & endl(prnstream &)
Description not yet available.
void operator=(const dvar_matrix &)
Description not yet available.
Description not yet available.
virtual void set_old_style_flag(void)
Description not yet available.
static objective_function_value * pobjfun
Description not yet available.
static df1b2quadratic_prior * ptr[]
void operator=(const dvar_matrix &M)
Description not yet available.
double ln_det(const dmatrix &m1, int &sgn)
Compute log determinant of a constant matrix.
void get_cHessian(dmatrix, int)
Description not yet available.
static void get_vHessian_contribution(dvar_matrix, int)
Description not yet available.
static int num_quadratic_prior
quadratic_re_penalty(void)
Description not yet available.
void add_to_list(void)
Description not yet available.
static df1b2quadratic_prior * get_ptr(int i)
Class definition of matrix with derivitive information .
void get_cgradient(dvector, int)
Description not yet available.
Description not yet available.
void get_vHessian(dvar_matrix, int)
Description not yet available.
static quadratic_prior * ptr[]
Description not yet available.
static void get_cHessian_contribution(dmatrix, int)
Description not yet available.
dvector value(const df1_one_vector &v)
int get_offset(int xs)
Description not yet available.
quadratic_prior(void)
Default constructor.
static quadratic_prior * get_ptr(int i)
static int get_num_quadratic_prior(void)
Fundamental data type for reverse mode automatic differentiation.
df1_one_variable inv(const df1_one_variable &x)
virtual void set_old_style_flag(void)
Description not yet available.
static void get_M_calculations(void)
Description not yet available.
static int in_qp_calculations