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 1000 by tim, Fri Jan 30 21:47:22 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 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 +  numOfProc++;
70  
71 +  return curretF;
72   }
73  
74   double ConcreteNLMode1::calcF(const 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  
96 +  vector<double> tempGrad(x.szie());
97 +
98 +  double tempF;
99 +  
100 +  tempF = (*objfunc)(x, tempGrad);
101 +
102 +  return tempGrad;
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines