FunctionWrap.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 
14 #ifndef FunctionWrap_H
15 #define FunctionWrap_H
16 
17 #include "functions/FunctionBase.h"
18 
19 namespace hippodraw {
20 
30 class FunctionWrap : public FunctionBase,
31  public boost::python::wrapper < FunctionBase >
32 {
33 private:
34 
37  boost::python::object invert_ownership;
38 
41  template < class T >
42  boost::python::object get_owner ( T * me ) const;
43 
44 public:
45 
48  FunctionWrap ( const FunctionBase & base );
49 
52  FunctionWrap ( const FunctionWrap & );
53 
56  FunctionWrap ();
57 
60  virtual ~FunctionWrap ();
61 
62 
65  void setName ( const std::string & name );
66 
70  void setParmNames ( const std::vector < std::string > & names );
71  double derivByParm ( int, double ) const;
72  void initialize ();
73 
88  FunctionBase * clone () const;
89 
90  double operator () ( double ) const;
91  double operator () ( const std::vector < double > & ) const;
92  void initialParameters ( const FunctionHelper * );
93 
94  unsigned int dimensions () const;
95 
99  virtual bool hasDerivatives () const;
100 
101 };
102 
103 } // namespace hippodraw
104 
105 
106 #endif // FunctionWrap_H
An abstract base class to help FunctionBase objects perform some operations.
hippodraw::FunctionBase class interface
void setParmNames(const std::vector< std::string > &names)
Sets the names of the parameters and re-sizes the number of parameters available. ...
const std::string & name() const
Returns the name of the function.
FunctionBase * clone() const
Make copy of object, including copy of Python object.
unsigned int dimensions() const
Returns the number of dimensions of the data coordinate.
virtual bool hasDerivatives() const
Returns true if the Python function has implemented returning partial derivatives.
boost::python::object invert_ownership
The new ownership.
Definition: FunctionWrap.h:37
double operator()(double) const
void initialParameters(const FunctionHelper *)
Sets the FunctionHelper so that the function can calculate a reasonable set of initial parameter valu...
void setName(const std::string &name)
Sets the name of the function.
FunctionWrap()
The default constructor.
A wrapper class for FunctionBase.
Definition: FunctionWrap.h:30
virtual ~FunctionWrap()
The destructor.
A function that can be added to a DataRep and used in a fitter.
Definition: FunctionBase.h:90
boost::python::object get_owner(T *me) const
Find the Python object that owns this object.
double derivByParm(int, double) const

Generated for HippoDraw Class Library by doxygen