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

df1b2lp10.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
......
103 103
void laplace_approximation_calculator::
104 104
  check_hessian_type2(function_minimizer * pfmin)
105 105
{
106
  //int i,j,ip; 
107
  int i,ip; 
106
  //int i,j,ip;
107
  int i,ip;
108 108
  if (quadratic_prior::get_num_quadratic_prior()>0)
109 109
  {
110 110
    hesstype=4;
......
136 136
  }
137 137
  else
138 138
  {
139
    
140 139
    int nv=initial_df1b2params::set_index();
141 140
    if (allocated(used_flags))
142 141
    {
......
149 148
    {
150 149
      used_flags.safe_allocate(1,nv);
151 150
    }
152
    
151

  
153 152
    //for (ip=1;ip<=num_der_blocks;ip++)
154 153
    {
155 154
      used_flags.initialize();
......
161 160
      (*re_objective_function_value::pobjfun)=0;
162 161
      df1b2variable pen=0.0;
163 162
      df1b2variable zz=0.0;
164
  
163

  
165 164
      initial_df1b2params::reset(y,pen);
166 165
      // call function to do block diagonal newton-raphson
167 166
      // the step vector from the newton-raphson is in the vector step
168 167
      df1b2_gradlist::set_no_derivatives();
169
      
168

  
170 169
      funnel_init_var::lapprox=this;
171 170
      block_diagonal_flag=5;
172
  
173
      quadratic_prior::in_qp_calculations=1; 
171

  
172
      quadratic_prior::in_qp_calculations=1;
174 173
      pfmin->pre_user_function();
175
      quadratic_prior::in_qp_calculations=0; 
176
  
174
      quadratic_prior::in_qp_calculations=0;
175

  
177 176
      int non_block_diagonal=0;
178 177
      for (i=xsize+1;i<=xsize+usize;i++)
179 178
      {
......
181 180
        {
182 181
          non_block_diagonal=1;
183 182
          break;
184
        } 
183
        }
185 184
      }
186 185
      if (non_block_diagonal)
187 186
      {
......
260 259
          else
261 260
          {
262 261
            Hess.allocate(1,usize,1,usize);
263
          } 
262
          }
264 263
          if (allocated(Hessadjoint))
265 264
          {
266 265
            if (Hessadjoint.indexmax() != usize)
......
272 271
          else
273 272
          {
274 273
            Hessadjoint.allocate(1,usize,1,usize);
275
          } 
274
          }
276 275
        }
277 276
      }
278 277
      else
......
307 306
        (*calling_set)(0,0)=1;
308 307
      }
309 308
      used_flags.initialize();
310
      quadratic_prior::in_qp_calculations=1; 
309
      quadratic_prior::in_qp_calculations=1;
311 310
      pfmin->pre_user_function();
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff