[root] / trunk / math / mathcore / inc / Math / FitMethodFunction.h Repository:
ViewVC logotype

Diff of /trunk/math/mathcore/inc/Math/FitMethodFunction.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 25485, Mon Sep 22 07:52:52 2008 UTC revision 25486, Mon Sep 22 12:43:03 2008 UTC
# Line 35  Line 35 
35    
36  public:  public:
37    
38    
39     typedef  typename FunctionType::BaseFunc BaseFunction;     typedef  typename FunctionType::BaseFunc BaseFunction;
40    
41     /// enumeration specyfing the possible fit method types     /// enumeration specyfing the possible fit method types
42     enum Type { kUndefined , kLeastSquare, kLogLikelihood };     enum Type { kUndefined , kLeastSquare, kLogLikelihood };
43    
44    
45       BasicFitMethodFunction(int dim, int npoint) :
46          fNDim(dim),
47          fNPoints(npoint),
48          fNCalls(0)
49       {}
50    
51     /**     /**
52        Virtual Destructor (no operations)        Virtual Destructor (no operations)
# Line 48  Line 54 
54     virtual ~BasicFitMethodFunction ()  {}     virtual ~BasicFitMethodFunction ()  {}
55    
56     /**     /**
57          Number of dimension (parameters) . From IGenMultiFunction interface
58        */
59       virtual unsigned int NDim() const { return fNDim; }
60    
61       /**
62        method returning the data i-th contribution to the fit objective function        method returning the data i-th contribution to the fit objective function
63        For example the residual for the least square functions or the pdf element for the        For example the residual for the least square functions or the pdf element for the
64        likelihood functions.        likelihood functions.
# Line 59  Line 70 
70     /**     /**
71        return the number of data points used in evaluating the function        return the number of data points used in evaluating the function
72      */      */
73     virtual unsigned int NPoints() const = 0;     virtual unsigned int NPoints() const { return fNPoints; }
74    
75     /**     /**
76        return the type of method, override if needed        return the type of method, override if needed
# Line 69  Line 80 
80     /**     /**
81        return the total number of function calls (overrided if needed)        return the total number of function calls (overrided if needed)
82      */      */
83     virtual unsigned int NCalls() const { return 0; }     virtual unsigned int NCalls() const { return fNCalls; }
84    
85       /**
86          update number of calls
87        */
88       virtual void UpdateNCalls() const { fNCalls++; }
89    
90       /**
91          reset number of function calls
92        */
93       virtual void ResetNCalls() { fNCalls = 0; }
94    
95    
96    
97  public:  public:
98    
# Line 79  Line 102 
102    
103  private:  private:
104    
105       unsigned int fNDim;
106       unsigned int fNPoints;   // size of the data
107       mutable unsigned int fNCalls;
108    
109    
110  };  };
111    

Legend:
Removed from v.25485  
changed lines
  Added in v.25486

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9