Revision 1107 trunk/src/df1b2separable/f1b2trst.cpp
f1b2trst.cpp (revision 1107)  

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 
...  ...  
27  27 
fmm fmc(nvar); 
28  28 
if (random_effects_flag) 
29  29 
{ 
30 
initial_params::set_active_only_random_effects();


30 
initial_params::set_active_only_random_effects(); 

31  31 
//cout << nvar << endl; 
32  32 
unvar=initial_params::nvarcalc(); // get the number of active 
33 
initial_params::restore_start_phase();


34 
initial_params::set_inactive_random_effects();


33 
initial_params::restore_start_phase(); 

34 
initial_params::set_inactive_random_effects(); 

35  35 
int nvar1=initial_params::nvarcalc(); // get the number of active 
36  36 
if (nvar1 != nvar) 
37  37 
{ 
...  ...  
70  70 
tester(i,i)+=lambda; 
71  71 
} 
72  72 
dvector step = xsolve(tester,g); 
73 


73  
74  74 
{ 
75  75 
// calculate the number of random effects unvar 
76  76 
// this turns on random effects variables and turns off 
77  77 
// everything else 
78  78 
//cout << nvar << endl; 
79 
initial_params::set_active_only_random_effects();


79 
initial_params::set_active_only_random_effects(); 

80  80 
//cout << nvar << endl; 
81  81 
int unvar=initial_params::nvarcalc(); // get the number of active 
82  82 
//df1b2_gradlist::set_no_derivatives(); 
...  ...  
96  96 
} 
97  97 
} 
98  98 
lapprox=new laplace_approximation_calculator(nvar,unvar,1,nvar+unvar, 
99 
this);


99 
this); 

100  100 
initial_df1b2params::current_phase=initial_params::current_phase; 
101 


101  
102  102 
initial_df1b2params::save_varsptr(); 
103  103 
allocate(); 
104  104 
initial_df1b2params::restore_varsptr(); 
105  105  
106  106 
df1b2_gradlist::set_no_derivatives(); 
107 
int nvar=initial_params::nvarcalc_all();


107 
int nvar=initial_params::nvarcalc_all(); 

108  108 
dvector y(1,nvar); 
109 
initial_params::xinit_all(y);


109 
initial_params::xinit_all(y); 

110  110 
initial_df1b2params::reset_all(y); 
111  111  
112  112 
g=(*lapprox)(step,f,this); 
113 


113  
114  114 
} 
115  115  
116  116 
} // end block for quasi newton minimization 
Also available in: Unified diff