Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Diff of /trunk/gadget/hooke.cc
[mareframe] / trunk / gadget / hooke.cc Repository:
ViewVC logotype

Diff of /trunk/gadget/hooke.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 24, Wed Apr 26 09:06:03 2017 UTC revision 25, Fri May 5 14:38:16 2017 UTC
# Line 562  Line 562 
562    
563    while (1) {    while (1) {
564      if (isZero(bestf)) {      if (isZero(bestf)) {
565          iters = EcoSystem->getFuncEval() - offset;
566        handle.logMessage(LOGINFO, "Error in Hooke & Jeeves optimisation after", iters, "function evaluations, f(x) = 0");        handle.logMessage(LOGINFO, "Error in Hooke & Jeeves optimisation after", iters, "function evaluations, f(x) = 0");
567        converge = -1;        converge = -1;
568        return;        return;
# Line 587  Line 588 
588      newf = this->bestNearby(delta, trialx, bestf, param);      newf = this->bestNearby(delta, trialx, bestf, param);
589      /* if too many function evaluations occur, terminate the algorithm */      /* if too many function evaluations occur, terminate the algorithm */
590    
591        iters = EcoSystem->getFuncEval() - offset;
592      if (iters > hookeiter) {      if (iters > hookeiter) {
593        handle.logMessage(LOGINFO, "\nStopping Hooke & Jeeves optimisation algorithm\n");        handle.logMessage(LOGINFO, "\nStopping Hooke & Jeeves optimisation algorithm\n");
594        handle.logMessage(LOGINFO, "The optimisation stopped after", iters, "function evaluations");        handle.logMessage(LOGINFO, "The optimisation stopped after", iters, "function evaluations");
# Line 663  Line 665 
665        bestf = newf;        bestf = newf;
666        for (i = 0; i < nvars; i++)        for (i = 0; i < nvars; i++)
667          x[i] = trialx[i];          x[i] = trialx[i];
668          newf = this->bestNearby(delta, trialx, bestf, param);
669        if (isEqual(newf, bestf))        if (isEqual(newf, bestf))
670          break;          break;
671    
672        /* if too many function evaluations occur, terminate the algorithm */        /* if too many function evaluations occur, terminate the algorithm */
673          iters = EcoSystem->getFuncEval() - offset;
674        if (iters > hookeiter) {        if (iters > hookeiter) {
675          handle.logMessage(LOGINFO, "\nStopping Hooke & Jeeves optimisation algorithm\n");          handle.logMessage(LOGINFO, "\nStopping Hooke & Jeeves optimisation algorithm\n");
676          handle.logMessage(LOGINFO, "The optimisation stopped after", iters, "function evaluations");          handle.logMessage(LOGINFO, "The optimisation stopped after", iters, "function evaluations");
# Line 684  Line 687 
687        }        }
688      } // while (newf < bestf)      } // while (newf < bestf)
689    
690        iters = EcoSystem->getFuncEval() - offset;
691      if (newf < bestf) {      if (newf < bestf) {
692        for (i = 0; i < nvars; i++)        for (i = 0; i < nvars; i++)
693          bestx[i] = x[i] * init[i];          bestx[i] = x[i] * init[i];

Legend:
Removed from v.24  
changed lines
  Added in v.25

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge