newfmin.cpp (revision 1205)
184 184
 Quasi-Newton function minimizer.

185 185
  \param _f Value of function to be minimized.

186 186
  \param _x Vector of independent variables.

187
  \param _g Vector containing the partial derivatives of _f with respect to

187
  \param _g Vector containin the partial derivatives of _f with respect to

188 188
   each independent variable. The gradient vector returned by \ref gradcalc.

189 189
 */

190 190
void fmm::fmin(const double& _f, const dvector &_x, const dvector& _g)

......
312 312
      ib=iv+n;

313 313
      iexit=0;

314 314
  tracing_message(traceflag,"A12");

315
  // Initialize hessian to diagonal=1 and the rest=0

315 316
      h.elem(1,1) = 1;

316 317
      for (i=2; i<=n; i++)

317 318
      {

......
437 438
      {

438 439
        fmmdisp(x, g, n, this->scroll_flag,noprintx);

439 440
      }

440
label21 :

441
label21 :  // Compute

441 442
      itn=itn+1;

442 443
      for (i=1; i<=n; i++)

443 444
         x.elem(i)=xx.elem(i);

......
632 633
      if(fabs(gys/gso)<=.95 && ic > 4)

633 634
         goto label50;

634 635
      if(gys>0.0)

635
         goto  label40;

636
         goto label40;

636 637
      tot+=alpha;

637 638
      z=10.0;

638 639
      if(gs<gys)

......
723 724
      for (i=1;i<=n;i++)

724 725
         g.elem(i)=w.elem(i);

725 726
      goto  label20;

726
label70:

727
label70:  // Hessian update

727 728
      w.elem(iv+1)=w.elem(iu+1);

728 729
      pfmintime->get_elapsed_time_and_reset();

729 730
      for (i=2;i<=n;i++)


Also available in: Unified diff