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 1000 by tim, Fri Jan 30 21:47:22 2004 UTC vs.
Revision 1010 by tim, Tue Feb 3 20:43:08 2004 UTC

# 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 66 | Line 66 | double ConcreteNLMode1::calcF(){
66   double ConcreteNLMode1::calcF(){
67    
68    currentF = (*objfunc)(currentX, currentGrad);
69 <  numOfProc++;
69 >  numOfFunEval ++;
70  
71 <  return curretF;
71 >  return currentF;
72   }
73  
74   double ConcreteNLMode1::calcF(const vector<double>& x){
# Line 77 | Line 77 | double ConcreteNLMode1::calcF(const vector<double>& x)
77    
78    double tempF;
79  
80 <  tempF = (*objfunc)(x, tempGrad);
80 >  //tempF = (*objfunc)(x, tempGrad);
81    numOfFunEval ++;
82    
83    return tempF;  
84   }
85  
86   vector<double> ConcreteNLMode1::calcGrad(){
87 <
87 >  
88    currentF = (*objfunc)(currentX, currentGrad);
89  
90    return currentGrad;
91  
92   }
93  
94 < vector<double> ConcreteNLMode1::calcGrad(vector<double>& x){
94 > vector<double> ConcreteNLMode1::calcGrad(const vector<double>& x){
95 >  vector<double> tempGrad;
96 >  //vector<double> tempGrad(x.szie());
97  
96  vector<double> tempGrad(x.szie());
97
98    double tempF;
99    
100 <  tempF = (*objfunc)(x, tempGrad);
100 >  //tempF = (*objfunc)(x, tempGrad);
101  
102    return tempGrad;
103   }
104  
105 + /*
106   SymMatrix ConcreteNLMode1::calcHessian(){
107    calcGrad(currentX);
108    return FiniteHessian(currentX);
# Line 110 | Line 111 | SymMatrix ConcreteNLMode1::calcHessian(vector<double>&
111   SymMatrix ConcreteNLMode1::calcHessian(vector<double>& x){
112    return FiniteHessian(x);
113   }
114 + */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines