• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修订版f91b082963ada498a9462715519d3d9843802dd6 (tree)
时间2013-07-24 18:41:34
作者Mikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

const is added to ElectronicStructure::GetForce. #29723

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

更改概述

差异

--- a/src/base/ElectronicStructure.h
+++ b/src/base/ElectronicStructure.h
@@ -33,8 +33,8 @@ public:
3333 virtual void OutputCISResults() const = 0;
3434 virtual double const* const* GetMatrixCIS() const = 0;
3535 virtual double const* GetExcitedEnergies() const = 0;
36- virtual double** GetForce(int elecState) = 0;
37- virtual double*** GetForce(const std::vector<int>& elecStates) = 0;
36+ virtual double const* const* GetForce(int elecState) = 0;
37+ virtual double const* const* const* GetForce(const std::vector<int>& elecStates) = 0;
3838 virtual double GetElectronicEnergy(int elecState) const = 0;
3939 virtual double GetCoreRepulsionEnergy() const = 0;
4040 virtual double GetVdWCorrectionEnergy() const = 0;
--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -709,12 +709,12 @@ double Cndo2::GetVdWCorrectionEnergy() const{
709709 return this->vdWCorrectionEnergy;
710710 }
711711
712-double*** Cndo2::GetForce(const vector<int>& elecStates){
712+double const* const* const* Cndo2::GetForce(const vector<int>& elecStates){
713713 this->CalcForce(elecStates);
714714 return this->matrixForce;
715715 }
716716
717-double** Cndo2::GetForce(int elecState){
717+double const* const* Cndo2::GetForce(int elecState){
718718 vector<int> elecStates;
719719 elecStates.push_back(elecState);
720720 this->CalcForce(elecStates);
--- a/src/cndo/Cndo2.h
+++ b/src/cndo/Cndo2.h
@@ -37,8 +37,8 @@ public:
3737 virtual void OutputCISResults() const;
3838 double const* const* GetMatrixCIS() const{return this->matrixCIS;};
3939 double const* GetExcitedEnergies() const{return this->excitedEnergies;};
40- double** GetForce(int elecState);
41- double*** GetForce(const std::vector<int>& elecStates);
40+ double const* const* GetForce(int elecState);
41+ double const* const* const* GetForce(const std::vector<int>& elecStates);
4242 double GetElectronicEnergy(int elecState) const;
4343 double GetCoreRepulsionEnergy() const;
4444 double GetVdWCorrectionEnergy() const;
--- a/src/md/MD.cpp
+++ b/src/md/MD.cpp
@@ -76,8 +76,8 @@ void MD::DoMD(){
7676 double dt = Parameters::GetInstance()->GetTimeWidthMD();
7777 double time = 0.0;
7878 bool requireGuess = false;
79- double** matrixForce = NULL;
8079 double initialEnergy = 0.0;
80+ double const* const* matrixForce = NULL;
8181
8282 // initial calculation
8383 electronicStructure->DoSCF();
--- a/src/nasco/NASCO.cpp
+++ b/src/nasco/NASCO.cpp
@@ -90,8 +90,8 @@ void NASCO::DoNASCO(Molecule& molecule){
9090 int nonAdiabaticPhaseIndex = 0;
9191 double time = 0.0;
9292 bool requireGuess = false;
93- double** matrixForce = NULL;
9493 double initialEnergy = 0.0;
94+ double const* const* matrixForce = NULL;
9595
9696 // initial calculation
9797 elecState = Parameters::GetInstance()->GetInitialElectronicStateNASCO();
--- a/src/optimization/BFGS.cpp
+++ b/src/optimization/BFGS.cpp
@@ -106,10 +106,10 @@ void BFGS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStruct
106106 int totalSteps = Parameters::GetInstance()->GetTotalStepsOptimization();
107107 double maxGradientThreshold = Parameters::GetInstance()->GetMaxGradientOptimization();
108108 double rmsGradientThreshold = Parameters::GetInstance()->GetRmsGradientOptimization();
109- double lineSearchCurrentEnergy = 0.0;
110- double lineSearchInitialEnergy = 0.0;
111- double** matrixForce = NULL;
112- double* vectorForce = NULL;
109+ double lineSearchCurrentEnergy = 0.0;
110+ double lineSearchInitialEnergy = 0.0;
111+ double const* const* matrixForce = NULL;
112+ double const* vectorForce = NULL;
113113 const int dimension = molecule.GetNumberAtoms()*CartesianType_end;
114114 double** matrixHessian = NULL;
115115 double* vectorOldForce = NULL;
--- a/src/optimization/ConjugateGradient.cpp
+++ b/src/optimization/ConjugateGradient.cpp
@@ -74,7 +74,7 @@ void ConjugateGradient::SearchMinimum(boost::shared_ptr<ElectronicStructure> ele
7474 double rmsGradientThreshold = Parameters::GetInstance()->GetRmsGradientOptimization();
7575 double lineSearchCurrentEnergy = 0.0;
7676 double lineSearchInitialEnergy = 0.0;
77- double** matrixForce = NULL;
77+ double const* const* matrixForce = NULL;
7878 double** oldMatrixForce = NULL;
7979 double** matrixSearchDirection = NULL;
8080
@@ -127,7 +127,7 @@ void ConjugateGradient::SearchMinimum(boost::shared_ptr<ElectronicStructure> ele
127127 *lineSearchedEnergy = lineSearchCurrentEnergy;
128128 }
129129
130-void ConjugateGradient::UpdateSearchDirection(double*** matrixForce,
130+void ConjugateGradient::UpdateSearchDirection(double const* const** matrixForce,
131131 double** oldMatrixForce,
132132 double** matrixSearchDirection,
133133 boost::shared_ptr<ElectronicStructure> electronicStructure,
--- a/src/optimization/ConjugateGradient.h
+++ b/src/optimization/ConjugateGradient.h
@@ -33,7 +33,7 @@ private:
3333 MolDS_base::Molecule& molecule,
3434 double* lineSearchedEnergy,
3535 bool* obainesOptimizedStructure) const;
36- void UpdateSearchDirection(double*** matrixForce,
36+ void UpdateSearchDirection(double const* const** matrixForce,
3737 double** oldMatrixForce,
3838 double** matrixSearchDirection,
3939 boost::shared_ptr<MolDS_base::ElectronicStructure> electronicStructure,
--- a/src/optimization/Optimizer.cpp
+++ b/src/optimization/Optimizer.cpp
@@ -212,7 +212,7 @@ void Optimizer::LineSearch(boost::shared_ptr<ElectronicStructure> electronicStru
212212 lineSearchCurrentEnergy = electronicStructure->GetElectronicEnergy(elecState);
213213 }
214214
215-bool Optimizer::SatisfiesConvergenceCriterion(double** matrixForce,
215+bool Optimizer::SatisfiesConvergenceCriterion(double const* const* matrixForce,
216216 const MolDS_base::Molecule& molecule,
217217 double oldEnergy,
218218 double currentEnergy,
--- a/src/optimization/Optimizer.h
+++ b/src/optimization/Optimizer.h
@@ -37,7 +37,7 @@ protected:
3737 MolDS_base::Molecule& molecule,
3838 bool requireGuess,
3939 bool printsLogs) const;
40- bool SatisfiesConvergenceCriterion(double** matrixForce,
40+ bool SatisfiesConvergenceCriterion(double const* const* matrixForce,
4141 const MolDS_base::Molecule& molecule,
4242 double oldEnergy,
4343 double currentEnergy,
--- a/src/optimization/SteepestDescent.cpp
+++ b/src/optimization/SteepestDescent.cpp
@@ -71,9 +71,9 @@ void SteepestDescent::SearchMinimum(boost::shared_ptr<ElectronicStructure> elect
7171 int totalSteps = Parameters::GetInstance()->GetTotalStepsOptimization();
7272 double maxGradientThreshold = Parameters::GetInstance()->GetMaxGradientOptimization();
7373 double rmsGradientThreshold = Parameters::GetInstance()->GetRmsGradientOptimization();
74- double lineSearchCurrentEnergy = 0.0;
75- double lineSearchInitialEnergy = 0.0;
76- double** matrixForce = NULL;
74+ double lineSearchCurrentEnergy = 0.0;
75+ double lineSearchInitialEnergy = 0.0;
76+ double const* const* matrixForce = NULL;
7777
7878 // initial calculation
7979 bool requireGuess = true;
--- a/src/rpmd/RPMD.cpp
+++ b/src/rpmd/RPMD.cpp
@@ -95,7 +95,8 @@ void RPMD::UpdateMomenta(const vector<boost::shared_ptr<Molecule> >& molecularBe
9595 for(int b=0; b<numBeads; b++){
9696 int preB = b==0 ? numBeads-1 : b-1;
9797 int postB = b==numBeads-1 ? 0 : b+1;
98- double** electronicForceMatrix = electronicStructureBeads[b]->GetForce(elecState);;
98+ double const* const* electronicForceMatrix
99+ = electronicStructureBeads[b]->GetForce(elecState);;
99100 for(int a=0; a<numAtom; a++){
100101 Atom* atom = molecularBeads[b]->GetAtom(a);
101102 Atom* preAtom = molecularBeads[preB]->GetAtom(a);