Revision 1109 trunk/src/df1b2separable/df1b2lap.cpp
df1b2lap.cpp (revision 1109)  

2  2 
* $Id$ 
3  3 
* 
4  4 
* Author: David Fournier 
5 
* Copyright (c) 20082012 Regents of the University of California


5 
* Copyright (c) 20082012 Regents of the University of California 

6  6 
*/ 
7  7 
/** 
8  8 
* \file 
...  ...  
35  35  
36  36 
double re_objective_function_value::fun_without_pen=0; 
37  37  
38 


39 
int laplace_approximation_calculator::antiflag=0; 

40 
int laplace_approximation_calculator::saddlepointflag=0; 

38 
int laplace_approximation_calculator::antiflag=0; 

39 
int laplace_approximation_calculator::saddlepointflag=0; 

41  40 
int laplace_approximation_calculator::print_importance_sampling_weights_flag=0; 
42  41 
int laplace_approximation_calculator::sparse_hessian_flag=0; 
43  42  
44 
int laplace_approximation_calculator::where_are_we_flag=0;


45 
dvar_vector *


43 
int laplace_approximation_calculator::where_are_we_flag=0; 

44 
dvar_vector * 

46  45 
laplace_approximation_calculator::variance_components_vector=0; 
47  46  
48  47 
/** 
...  ...  
69  68 
fmc1.ihang=0; 
70  69 
fmc1.ihflag=0; 
71  70 
fmc1.use_control_c=0; 
72 


71  
73  72 
if (init_switch) 
74  73 
{ 
75  74 
u.initialize(); 
...  ...  
78  77 
{ 
79  78 
u=ubest; 
80  79 
} 
81 


80  
82  81 
fmc1.dfn=1.e2; 
83  82 
dvariable pen=0.0; 
84  83 
//cout << "starting norm(u) = " << norm(u) << endl; 
...  ...  
110  109 
quadratic_prior::get_M_calculations(); 
111  110 
} 
112  111 
vf+=*objective_function_value::pobjfun; 
113 


112  
114  113 
/* this is now done in the operator = function 
115  114 
if (quadratic_prior::get_num_quadratic_prior()>0) 
116  115 
{ 
117  116 
vf+= quadratic_prior::get_quadratic_priors(); 
118  117 
} 
119  118 
*/ 
120 


121  119  
122  120 
objective_function_value::fun_without_pen=value(vf); 
123 


121  
124  122 
//cout << " pen = " << pen << endl; 
125  123 
if (noboundepen_flag==0) 
126  124 
{ 
127  125 
vf+=pen; 
128  126 
} 
129  127 
f=value(vf); 
130 
if (f<fb)


128 
if (f<fb) 

131  129 
{ 
132  130 
fb=f; 
133  131 
ub=u; 
134  132 
} 
135  133 
gradcalc(usize,g); 
136 
//cout << " f = " << setprecision(17) << f << " " << norm(g)


134 
//cout << " f = " << setprecision(17) << f << " " << norm(g) 

137  135 
// << " " << norm(u) << endl; 
138 


139  136 
} 
140  137 
u=ub; 
141  138 
} 
...  ...  
172  169  
173  170 
vf+=pen; 
174  171 
f=value(vf); 
175 
if (f<fb)


172 
if (f<fb) 

176  173 
{ 
177  174 
fb=f; 
178  175 
ub=u; 
...  ...  
228  225 
cout << " Inner f = " << f << endl; 
229  226 
} 
230  227 
//gradient_structure::set_NO_DERIVATIVES(); 
231 
//initial_params::set_inactive_only_random_effects(); 
Also available in: Unified diff