• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision2f58139b365dae239ce06a812e1954e99ed04cc4 (tree)
l'heure2013-08-23 16:06:32
AuteurKatsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Message de Log

Limit the number of GEDIIS history entries. #31854

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1492 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

Modification

--- a/src/optimization/GEDIIS.cpp
+++ b/src/optimization/GEDIIS.cpp
@@ -251,7 +251,7 @@ void GEDIIS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStru
251251 MallocerFreer::GetInstance()->Free(&matrixGEDIISForce , molecule.GetNumberAtoms(), CartesianType_end);
252252 }
253253
254-GEDIIS::GEDIISHistory::GEDIISHistory(){
254+GEDIIS::GEDIISHistory::GEDIISHistory():maxEntryCount(5){
255255 this->SetMessages();
256256 }
257257
@@ -272,6 +272,10 @@ void GEDIIS::GEDIISHistory::AddEntry(double energy,
272272 const MolDS_base::Molecule& molecule,
273273 double const* const* matrixForce){
274274 this->entryList.push_back(new Entry(energy, molecule, matrixForce));
275+ if(this->entryList.size() > this->maxEntryCount){
276+ delete this->entryList.front();
277+ this->entryList.pop_front();
278+ }
275279 }
276280
277281 void GEDIIS::GEDIISHistory::DiscardEntries(){
--- a/src/optimization/GEDIIS.h
+++ b/src/optimization/GEDIIS.h
@@ -62,6 +62,7 @@ protected:
6262 double** matrixCoordinate;
6363 double** matrixForce;
6464 };
65+ const int maxEntryCount;
6566 typedef std::list< const Entry* > entryList_t;
6667 entryList_t entryList;
6768 void SetMessages();