FunctionBase.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _FunctionBase_H_
15 #define _FunctionBase_H_
16 
17 #include "pattern/libhippo.h"
18 
19 #include <string>
20 #include <vector>
21 
22 namespace hippodraw {
23 
24 class FunctionHelper;
25 
91 {
92 
93 protected:
94 
96  FunctionBase ();
97 
100  FunctionBase ( const FunctionBase & );
101 
103  std::string m_name;
104 
106  std::vector<std::string> m_parm_names;
107 
109  std::vector < double > m_parms;
110 
117  std::vector < int > m_fixed_flags;
118 
119 
122  void setName ( const char * );
123 
128  virtual void resize ();
129 
137  virtual void initialize ();
138 
139  public:
140 
141 
143  virtual ~FunctionBase();
144 
146  const std::string & name () const;
147 
155  virtual FunctionBase * clone () const;
156 
158  virtual int size () const;
159 
161  virtual const std::vector < std::string > & parmNames ( ) const;
162 
165  void setParmNames ( const std::vector < std::string > & names );
166 
170  virtual bool isComposite () const;
171 
175  virtual void addToComposite ( FunctionBase * );
176 
180  virtual void removeFromComposite ( FunctionBase * );
181 
185  virtual int count ();
186 
190  virtual const std::vector< double > & getParameters () const;
191 
194  virtual const std::vector < int > & getFixedFlags () const;
195 
198  virtual void setFixedFlags ( const std::vector < int > & flags );
199 
200 
201  virtual std::vector < int > :: const_iterator
202  setFixedFlags ( std::vector < int > ::const_iterator it );
203 
208  virtual void setParameters ( const std::vector< double > & incr );
209 
213  virtual std::vector< double >::const_iterator
214  setParameters ( std::vector< double >::const_iterator it );
215 
227  virtual double derivByParm ( int i, double x ) const;
228 
233  virtual double operator() ( double x ) const;
234 
240  virtual double operator () ( const std::vector < double > & v ) const;
241 
244  virtual void initialParameters ( const FunctionHelper * helper );
245 
253  virtual bool hasDerivatives () const;
254 
260  virtual double integrate ( double lower_limit, double upper_limit ) const;
261 
267  virtual unsigned int dimensions () const;
268 
269 };
270 
271 } // namespace hippodraw
272 
273 #endif // _FunctionBase_H_
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
unsigned int i
std::vector< int > m_fixed_flags
The flags to indicated which parameters are to be held fixed during minimization of this objective fu...
Definition: FunctionBase.h:117
std::vector< double > m_parms
The parameter values.
Definition: FunctionBase.h:109
numeric::array clone(numeric::array arr)
Definition: num_util.cpp:412
ViewBase * v
Definition: PlotTable.cxx:104
intp size(numeric::array arr)
Definition: num_util.cpp:296
A function that can be added to a DataRep and used in a fitter.
Definition: FunctionBase.h:90
An abstract base class to help FunctionBase objects perform some operations.
std::string m_name
The name of the function.
Definition: FunctionBase.h:103
std::vector< std::string > m_parm_names
The names of the function parameters.
Definition: FunctionBase.h:106
list< QAction * >::iterator it

Generated for HippoDraw Class Library by doxygen