Revision 1343 trunk/src/nh99/mod_hess.cpp

mod_hess.cpp (revision 1343)
111 111
	   << " for hessian" << endl;
112 112
#endif
113 113

  
114
      double f=0.0;
115 114
      double xsave=x(i);
116 115
      sdelta1=x(i)+delta;
117 116
      useless(sdelta1);
......
122 121
      *objective_function_value::pobjfun=0.0;
123 122
      pre_userfunction();
124 123
      vf+=*objective_function_value::pobjfun;
125
      f=value(vf);
124
      double f = value(vf);
126 125
      gradcalc(nvar,g1);
127 126

  
128 127
      sdelta2=x(i)-delta;
......
157 156
      sdelta2-=x(i);
158 157
      x(i)=xsave+sdelta2;
159 158
      vf=0.0;
160
      vf=0.0;
161 159
      vf=initial_params::reset(dvar_vector(x));
162 160
      *objective_function_value::pobjfun=0.0;
163 161
      pre_userfunction();
......
326 324
      f=value(vf);
327 325
      gradcalc(nvar,g1);
328 326
    }
329
    double sdelta1;
330
    double sdelta2;
331

  
332 327
    for (int i=1;i<=nvar;i++)
333 328
    {
334 329
      cout << "Estimating row " << i << " out of " << nvar
......
336 331

  
337 332
      double f=0.0;
338 333
      double xsave=x(i);
339
      sdelta1=x(i)+delta;
334
      double sdelta1=x(i)+delta;
340 335
      useless(sdelta1);
341 336
      sdelta1-=x(i);
342 337
      x(i)=xsave+sdelta1;
......
348 343
      f=value(vf);
349 344
      gradcalc(nvar,g1);
350 345

  
351
      sdelta2=x(i)-delta;
346
      double sdelta2=x(i)-delta;
352 347
      useless(sdelta2);
353 348
      sdelta2-=x(i);
354 349
      x(i)=xsave+sdelta2;

Also available in: Unified diff