ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/NLModel1.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/NLModel1.cpp (file contents):
Revision 996 by tim, Wed Jan 28 22:44:44 2004 UTC vs.
Revision 1015 by tim, Tue Feb 3 22:54:52 2004 UTC

# Line 9 | Line 9 | SymMatrix NLModel1::FiniteHessian(vector<double>& x, v
9    
10   #ifdef IS_MPI
11    vector<double> gplusAll;
12 <  vector<double> currentGradAll;
12 >  vector<double> tempGradAll;
13  
14 <  currentGradAll = getAllGrad();
14 >  tempGradAll = getAllGrad();
15   #endif
16  
17    tempX = x;
# Line 25 | Line 25 | SymMatrix NLModel1::FiniteHessian(vector<double>& x, v
25  
26      gplus = calcGrad(tempX);
27  
28 <    hessian.Cloume(i) = (gplus - currentGrad) / hi;  
28 >    //hessian.Colume(i) = (gplus - currentGrad) / hi;  
29  
30      //restore tempX to its original value
31      tempX[i] -= hi;
# Line 54 | Line 54 | SymMatrix NLModel1::FiniteHessian(vector<double>& x, v
54  
55      }
56  
57 <    hessian.Cloume(i) = (gplusAll - currentGradAll) / hi;  
57 >    hessian.Cloume(i) = (gplusAll - tempGradAll) / hi;  
58   #endif
59  
60    }
# Line 64 | Line 64 | double ConcreteNLMode1::calcF(){
64   }
65  
66   double ConcreteNLMode1::calcF(){
67 +  
68 +  currentF = (*objfunc)(currentX, currentGrad);
69 +  numOfFunEval ++;
70  
71 +  return currentF;
72   }
73  
74 < double ConcreteNLMode1::calcF(const vector<double>& x){
74 > double ConcreteNLMode1::calcF(vector<double>& x){
75  
76 +  vector<double> tempGrad(x.size());
77 +  
78 +  double tempF;
79 +
80 +  tempF = (*objfunc)(x, tempGrad);
81 +  numOfFunEval ++;
82 +  
83 +  return tempF;  
84   }
85  
86   vector<double> ConcreteNLMode1::calcGrad(){
87 +  
88 +  currentF = (*objfunc)(currentX, currentGrad);
89  
90 +  return currentGrad;
91 +
92   }
93  
94   vector<double> ConcreteNLMode1::calcGrad(vector<double>& x){
95 +  vector<double> tempGrad(x.size());
96  
97 +  double tempF;
98 +  
99 +  tempF = (*objfunc)(x, tempGrad);
100 +
101 +  return tempGrad;
102   }
103  
104 + /*
105   SymMatrix ConcreteNLMode1::calcHessian(){
106 <
106 >  calcGrad(currentX);
107 >  return FiniteHessian(currentX);
108   }
109  
110   SymMatrix ConcreteNLMode1::calcHessian(vector<double>& x){
111 <
111 >  return FiniteHessian(x);
112   }
113 + */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines