ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f1b2lapqd.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
11 # include <admodel.h>
12 # include <df1b2fun.h>
13 # include <adrndeff.h>
14 #include <cassert>
15 
16 //dvariable AD_uf_inner(const dvector& x,const dvar_vector& u);
17 void get_second_ders(int xs,int us,const init_df1b2vector y,dmatrix& Hess,
19 double calculate_laplace_approximation(const dvector& x,const dvector& u0,
20  const dmatrix& Hess,const dvector& _xadjoint,const dvector& _uadjoint,
21  const dmatrix& _Hessadjoint,function_minimizer * pmin);
22 
28  (const dvector& x,function_minimizer * pfmin)
29 {
30  dvector g(1,usize);
31  independent_variables u(1,usize);
32  fmc1.itn=0;
33  fmc1.crit=1.e-9;
34  fmc1.ifn=0;
35  fmc1.ireturn=0;
36  initial_params::xinit(u); // get the initial values into the
37  u.initialize();
38 
39  ofstream ofs("catageqd.ppp");
40  if (ofs.good())
41  {
42  for (int i=0;i<initial_params::num_initial_params;i++)
43  {
44  initial_params::varsptr[i]->save_value(ofs);
45  }
46  }
47  ofs.close();
48 
49  int ret = system(" catageqd -nox -nohess -crit 1.e-10 -ainp catageqd.ppp ");
50  assert(ret == 0);
51 
52  uistream ifs("uval.dat");
53 
54  ifs >> u;
55 
56  ifs.close();
57 
58  return u;
59 }
60 
61 /*
62 For no laplace
63 dvector laplace_approximation_calculator::get_uhat_quasi_newton_qd
64  (const dvector& x,function_minimizer * pfmin)
65 {
66  dvector u(1,1)
67  return u;
68 }
69 */
df1b2_gradlist * f1b2gradlist
Definition: df1b2glo.cpp:49
Description not yet available.
#define x
Vector of double precision numbers.
Definition: dvector.h:50
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.
Definition: df1b2lap.cpp:1476
Description not yet available.
Definition: df1b2fun.h:745
Description not yet available.
Definition: fvar.hpp:1937
Description not yet available.
static void xinit(const dvector &x)
Definition: model.cpp:226
Description not yet available.
Definition: fvar.hpp:2819
void initialize(void)
Initialze all elements of dvector to zero.
Definition: dvect5.cpp:10
static int num_initial_params
Definition: admodel.h:836
Description not yet available.
Definition: df1b2fun.h:373
dvector get_uhat_quasi_newton_qd(const dvector &x, function_minimizer *pfmin)
Description not yet available.
Definition: f1b2lapqd.cpp:28
Description not yet available.
Description not yet available.
Definition: admodel.h:1850
Description not yet available.
Definition: fvar.hpp:3516
void get_second_ders(int xs, int us, const init_df1b2vector y, dmatrix &Hess, dmatrix &Dux, df1b2_gradlist *f1b2gradlist, function_minimizer *pfmin)
static adlist_ptr varsptr
Definition: admodel.h:838