Revision 1109 trunk/src/df1b2-separable/df1b2lp5.cpp

df1b2lp5.cpp (revision 1109)
2 2
 * $Id$
3 3
 *
4 4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California 
5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7 7
/**
8 8
 * \file
......
19 19
double calculate_laplace_approximation(const dvector& x,const dvector& u0,
20 20
  const dmatrix& Hess,const dvector& _xadjoint,const dvector& _uadjoint,
21 21
  const dmatrix& _Hessadjoint,function_minimizer * pmin);
22
      
22

  
23 23
#if defined(USE_ADPVM)
24 24
/**
25 25
 * Description not yet available.
......
39 39
  int num_der_blocks=lpc->num_der_blocks;
40 40
  int xsize=lpc->xsize;
41 41
  int usize=lpc->usize;
42
  
42

  
43 43
  for (int ip=1;ip<=num_der_blocks;ip++)
44 44
  {
45 45
    df1b2variable::minder=lpc->minder(ip);
......
56 56
      Hess.initialize();
57 57
      Dux.initialize();
58 58
    }
59
    
59

  
60 60
    //cout << "2D" << endl;
61 61
    pfmin->user_function();
62
    
62

  
63 63
    //pfmin->user_function(y,zz);
64 64
    (*re_objective_function_value::pobjfun)+=pen;
65 65
    (*re_objective_function_value::pobjfun)+=zz;
66
  
66

  
67 67
    if (!initial_df1b2params::separable_flag)
68 68
    {
69 69
      set_dependent_variable(*re_objective_function_value::pobjfun);
70 70
      df1b2_gradlist::set_no_derivatives();
71 71
      df1b2variable::passnumber=1;
72 72
      df1b2_gradcalc1();
73
    
73

  
74 74
      int mind=y(1).minder;
75 75
      int jmin=max(mind,xsize+1);
76 76
      int jmax=min(y(1).maxder,xsize+usize);
......
82 82
          tHess(i,j)=y(i+xsize).u_bar[j-mind];
83 83
        }
84 84
      send_dmatrix_to_master(tHess);
85
  
85

  
86 86
      jmin=max(mind,1);
87 87
      jmax=min(y(1).maxder,xsize);
88 88
      if (jmax>=jmin)
......
94 94
            //Dux(i,j)=y(i+xsize).u_bar[j-1];
95 95
            tDux(i,j)=y(i+xsize).u_bar[j-1];
96 96
          }
97
         
97

  
98 98
        send_int_to_master(1);
99 99
        send_dmatrix_to_master(tDux);
100 100
      }
......
125 125
  int i,j;
126 126
  x=get_dvector_from_master();
127 127

  
128
  initial_params::set_inactive_only_random_effects(); 
128
  initial_params::set_inactive_only_random_effects();
129 129
  gradient_structure::set_NO_DERIVATIVES();
130 130
  initial_params::reset(x);    // get current x values into the model
131 131
  gradient_structure::set_YES_DERIVATIVES();
132 132

  
133
  initial_params::set_active_only_random_effects(); 
133
  initial_params::set_active_only_random_effects();
134 134
  int lmn_flag=0;
135 135
  if (!inner_lmnflag)
136 136
  {
......
153 153
    y(i+xsize)=uhat(i);
154 154
  }
155 155
  //cout << y << endl;
156
        
156

  
157 157
  for(int ii=1;ii<=num_nr_iters;ii++)
158
  {  
159
    {   
158
  {
159
    {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff