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

Comparing trunk/OOPSE/libmdtools/Functor.hpp (file contents):
Revision 1007 by tim, Tue Feb 3 17:10:44 2004 UTC vs.
Revision 1023 by tim, Wed Feb 4 22:26:00 2004 UTC

# Line 7 | Line 7 | class ObjFunctor0{
7  
8   class ObjFunctor0{
9    public:
10 +
11 +    virtual ~ObjFunctor0() {}
12      virtual double operator()(vector<double>&)=0;  
13 +    
14   };
15  
16 < class PtrFunctor0 : ObjFunctor0{
16 > class PtrFunctor0 : public ObjFunctor0{
17  
18    public:
19  
# Line 54 | Line 57 | class ObjFunctor1{
57   class ObjFunctor1{
58  
59    public:
60 +    virtual ~ObjFunctor1() {}
61      virtual double operator()(vector<double>&, vector<double>&)=0;  
62      
63   };
# Line 61 | Line 65 | class PtrFunctor1 : ObjFunctor1{
65   //PtrFunctor class wraps a pointer which points to an objct function.
66   // PtrFunctor can be invoked by
67   // functor(vector<double>&, vector<double>&)
68 < class PtrFunctor1 : ObjFunctor1{
68 > class PtrFunctor1 : public ObjFunctor1{
69  
70    public:
71  
72      PtrFunctor1(double (*thePtrFunc)(vector<double>&, vector<double>&)){
73        ptrFunc = thePtrFunc;
74      }
75 <    
75 >
76      virtual double operator()(vector<double>& arg, vector<double>& grad){
77         return (*ptrFunc)(arg, grad);
78      };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines