修订版 | a3881533a68ea34deaca6c3b8a68643c46bb961b (tree) |
---|---|
时间 | 2012-12-05 16:55:11 |
作者 | Katsuhiko Nishimra <ktns.87@gmai...> |
Commiter | Katsuhiko Nishimra |
Initialize Hessian matrix using dcopy. #28764
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1177 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -123,11 +123,8 @@ void BFGS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStruct | ||
123 | 123 | try{ |
124 | 124 | // initialize Hessian with unit matrix |
125 | 125 | MallocerFreer::GetInstance()->Malloc(&matrixHessian, dimension, dimension); |
126 | - for(int i=0; i<dimension; i++){ | |
127 | - for(int j=i; j<dimension; j++){ | |
128 | - matrixHessian[i][j] = matrixHessian[j][i] = i==j ? 1.0 : 0.0; | |
129 | - } | |
130 | - } | |
126 | + const double one = 1; | |
127 | + MolDS_wrappers::Blas::GetInstance()->Dcopy(dimension, &one, 0, &matrixHessian[0][0], dimension+1); | |
131 | 128 | |
132 | 129 | // initial calculation |
133 | 130 | bool requireGuess = true; |