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 1015 by tim, Tue Feb 3 22:54:52 2004 UTC vs.
Revision 1023 by tim, Wed Feb 4 22:26:00 2004 UTC

# Line 1 | Line 1
1   #include "NLModel.hpp"
2 + #include "Utility.hpp"
3 +
4 +
5 +
6   //calculate hessian using finite difference
7   SymMatrix NLModel1::FiniteHessian(vector<double>& x, vector<double>& h){
8  
# Line 63 | Line 67 | double ConcreteNLMode1::calcF(){
67    
68   }
69  
70 < double ConcreteNLMode1::calcF(){
70 > //----------------------------------------------------------------------------//
71 > ConcreteNLModel1::ConcreteNLModel1(int dim, ObjFunctor1* func ,  ConstraintList* cons)
72 >                         : NLModel1(dim, cons){
73 >  objfunc = func;
74 > }
75 > double ConcreteNLModel1::calcF(){
76    
77    currentF = (*objfunc)(currentX, currentGrad);
78    numOfFunEval ++;
# Line 71 | Line 80 | double ConcreteNLMode1::calcF(vector<double>& x){
80    return currentF;
81   }
82  
83 < double ConcreteNLMode1::calcF(vector<double>& x){
83 > double ConcreteNLModel1::calcF(vector<double>& x){
84  
85    vector<double> tempGrad(x.size());
86    
# Line 83 | Line 92 | vector<double> ConcreteNLMode1::calcGrad(){
92    return tempF;  
93   }
94  
95 < vector<double> ConcreteNLMode1::calcGrad(){
95 > vector<double> ConcreteNLModel1::calcGrad(){
96    
97    currentF = (*objfunc)(currentX, currentGrad);
98  
# Line 91 | Line 100 | vector<double> ConcreteNLMode1::calcGrad(vector<double
100  
101   }
102  
103 < vector<double> ConcreteNLMode1::calcGrad(vector<double>& x){
103 > vector<double> ConcreteNLModel1::calcGrad(vector<double>& x){
104    vector<double> tempGrad(x.size());
105  
106    double tempF;
# Line 101 | Line 110 | vector<double> ConcreteNLMode1::calcGrad(vector<double
110    return tempGrad;
111   }
112  
113 < /*
114 < SymMatrix ConcreteNLMode1::calcHessian(){
113 >
114 > SymMatrix ConcreteNLModel1::calcHessian(){
115    calcGrad(currentX);
116 <  return FiniteHessian(currentX);
116 >  
117 >  return FiniteHessian(currentX, currentX);
118   }
119  
120 < SymMatrix ConcreteNLMode1::calcHessian(vector<double>& x){
121 <  return FiniteHessian(x);
120 > SymMatrix ConcreteNLModel1::calcHessian(vector<double>& x){
121 >  return FiniteHessian(x, x);
122   }
123 < */
123 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines