• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修訂6938e0018d1eede2c2fb1a5ea598cdd2f6a8012a (tree)
時間2013-01-24 23:59:18
作者Katsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Log Message

Use dsyrk in CalcOrbitalElectronPopulation. #30560

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

Change Summary

差異

--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -1,6 +1,7 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
3-// Copyright (C) 2012-2013 Michihiro Okuyama
3+// Copyright (C) 2012-2013 Michihiro Okuyama //
4+// Copyright (C) 2013-2013 Katsuhiko Nishimra //
45 // //
56 // This file is part of MolDS. //
67 // //
@@ -1498,52 +1499,21 @@ double Cndo2::GetFockOffDiagElement(const Atom& atomA,
14981499 void Cndo2::CalcOrbitalElectronPopulation(double** orbitalElectronPopulation,
14991500 const Molecule& molecule,
15001501 double const* const* fockMatrix) const{
1501- int totalNumberAOs = molecule.GetTotalNumberAOs();
1502+ const int totalNumberAOs = molecule.GetTotalNumberAOs();
1503+ const int numberTotalValenceElectrons = molecule.GetTotalNumberValenceElectrons();
1504+
15021505 MallocerFreer::GetInstance()->Initialize<double>(orbitalElectronPopulation, totalNumberAOs, totalNumberAOs);
15031506
1504- double** transposedFockMatrix = NULL;
1505- try{
1506- MallocerFreer::GetInstance()->Malloc<double>(&transposedFockMatrix, totalNumberAOs, totalNumberAOs);
1507- for(int mu=0; mu<totalNumberAOs; mu++){
1508- for(int nu=0; nu<totalNumberAOs; nu++){
1509- transposedFockMatrix[mu][nu] = fockMatrix[nu][mu];
1510- }
1511- }
1512-
1513- int numberTotalValenceElectrons = molecule.GetTotalNumberValenceElectrons();
1514- stringstream ompErrors;
1515-#pragma omp parallel for schedule(auto)
1516- for(int mu=0; mu<totalNumberAOs; mu++){
1517- try{
1518- for(int nu=mu; nu<totalNumberAOs; nu++){
1519- double value = 0.0;
1520- for(int mo=0; mo<numberTotalValenceElectrons/2; mo++){
1521- value += transposedFockMatrix[mu][mo]*transposedFockMatrix[nu][mo];
1522- }
1523- orbitalElectronPopulation[mu][nu] = 2.0*value;
1524- }
1525- }
1526- catch(MolDSException ex){
1527-#pragma omp critical
1528- ompErrors << ex.what() << endl ;
1529- }
1530- }
1531- // Exception throwing for omp-region
1532- if(!ompErrors.str().empty()){
1533- throw MolDSException(ompErrors.str());
1534- }
1535- }
1536- catch(MolDSException ex){
1537- MallocerFreer::GetInstance()->Free<double>(&transposedFockMatrix, totalNumberAOs, totalNumberAOs);
1538- throw ex;
1539- }
1540- MallocerFreer::GetInstance()->Free<double>(&transposedFockMatrix, totalNumberAOs, totalNumberAOs);
1541-
1542- for(int mu=0; mu<totalNumberAOs; mu++){
1543- for(int nu=mu+1; nu<totalNumberAOs; nu++){
1544- orbitalElectronPopulation[nu][mu] = orbitalElectronPopulation[mu][nu];
1545- }
1546- }
1507+ bool isMatrixAColumnMajor = false;
1508+ bool isMatrixATransposed = true;
1509+ bool isLowerTriangularPartMatrixCUsed = false;
1510+ double alpha = 2.0, beta = 0.0;
1511+ MolDS_wrappers::Blas::GetInstance()->Dsyrk(totalNumberAOs, numberTotalValenceElectrons/2,
1512+ isMatrixAColumnMajor,
1513+ isMatrixATransposed,
1514+ isLowerTriangularPartMatrixCUsed,
1515+ alpha, fockMatrix,
1516+ beta, orbitalElectronPopulation);
15471517
15481518 /*
15491519 this->OutputLog("orbital population\n");