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/ecosystem.cc
[mareframe] / trunk / gadget / ecosystem.cc Repository:
ViewVC logotype

Diff of /trunk/gadget/ecosystem.cc

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

revision 11, Thu Jul 23 19:00:38 2015 UTC revision 12, Fri Jul 24 18:36:24 2015 UTC
# Line 117  Line 117 
117            for (j = 0; j < numThr; j++)            for (j = 0; j < numThr; j++)
118                    EcoSystems[j]->Update(v);                    EcoSystems[j]->Update(v);
119  #endif  #endif
     optvec[i]->OptimiseLikelihood();  
     this->writeOptValues();  
   }  
 }  
   
120  #ifdef GADGET_OPENMP  #ifdef GADGET_OPENMP
 void Ecosystem::OptimiseOMP() {  
   int i;  
   for (i = 0; i < optvec.Size(); ++i) {  
121      optvec[i]->OptimiseLikelihoodOMP();      optvec[i]->OptimiseLikelihoodOMP();
122      int j, numThr = omp_get_max_threads ( );  #else
123      DoubleVector v = this->getValues();            optvec[i]->OptimiseLikelihood();
124      for (j = 0; j < numThr; j++)  #endif
     EcoSystems[j]->Update(v);  
125      this->writeOptValues();      this->writeOptValues();
126    }    }
127  }  }
 #endif  
128    
129  double Ecosystem::SimulateAndUpdate(const DoubleVector& x) {  double Ecosystem::SimulateAndUpdate(const DoubleVector& x) {
130    int i, j;    int i, j;
# Line 194  Line 184 
184      handle.logMessage(LOGINFO, "\nThe overall likelihood score is", this->getLikelihood());      handle.logMessage(LOGINFO, "\nThe overall likelihood score is", this->getLikelihood());
185  }  }
186    
 //#ifdef GADGET_OPENMP  
 //void Ecosystem::writeOptValuesOMP() {  
 //  int i;  
 //  DoubleVector tmpvec(likevec.Size(), 0.0);  
 //  for (i = 0; i < likevec.Size(); ++i)  
 //    tmpvec[i] = likevec[i]->getUnweightedLikelihood();  
 //  
 //  int iters = 0, numThr = omp_get_max_threads ( );  
 //  for (i = 0; i < numThr; i++)  
 //        iters += EcoSystems[i]->getFuncEval();  
 //  handle.logMessage(LOGINFO, "\nAfter a total of", funceval+iters, "function evaluations the best point found is");  
 //  keeper->writeBestValues();  
 //  handle.logMessage(LOGINFO, "\nThe scores from each likelihood component are");  
 //  handle.logMessage(LOGINFO, tmpvec);  
 //  if (!isZero(keeper->getBestLikelihoodScore())) // no better point has been found  
 //    handle.logMessage(LOGINFO, "\nThe overall likelihood score is", keeper->getBestLikelihoodScore());  
 //  else  
 //    handle.logMessage(LOGINFO, "\nThe overall likelihood score is", this->getLikelihood());  
 //}  
 //#endif  
   
187  void Ecosystem::writeInitialInformation(const char* const filename) {  void Ecosystem::writeInitialInformation(const char* const filename) {
188    keeper->openPrintFile(filename);    keeper->openPrintFile(filename);
189    keeper->writeInitialInformation(likevec);    keeper->writeInitialInformation(likevec);

Legend:
Removed from v.11  
changed lines
  Added in v.12

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

Powered By FusionForge