PyFunctionRep.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef PyFunctionRep_H
15 #define PyFunctionRep_H
16 
17 #include <string>
18 #include <vector>
19 
20 namespace hippodraw {
21 
22 class DataRep;
23 class PyDataRep;
24 class FunctionRep;
25 class FunctionBase;
26 class PlotterBase;
27 class QtDisplay;
28 
42 {
43 
44 private:
45 
48 
51 
52 public:
53 
56  PyFunctionRep ( const std::string & function_name, PyDataRep * rep );
57 
60  PyFunctionRep ( FunctionBase * function, PyDataRep * rep );
61 
64  PyFunctionRep ( FunctionBase * function );
65 
67  void addTo ( QtDisplay * display );
68 
70  hippodraw::DataRep * getRep () const;
71 
73  const std::vector < std::string > & parmNames () const;
74 
80  const std::vector < double > & parameters () const;
81 
83  const std::vector < double > & principleErrors () const;
84 
90  bool fitFunction ();
91 
93  void setParameters( const std::vector<double> & params );
94 
97  double operator () ( double x );
98 
100  double objectiveValue();
101 
104  const std::vector < std::vector < double > > & covarianceMatrix ();
105 
107  int degreesOfFreedom();
108 
110  void setFixedFlags( const std::vector<int> & flags );
111 
114  void setFitter ( const std::string & name );
115 
118  const std::string & getFitterName () const;
119 
124 
127  void setFitRange ( double low, double high );
128 
131  void setFitRangeEnabled ( bool yes = true );
132 
133 };
134 
135 } // namespace hippodraw
136 
137 #endif // PyFunctionRep_H
void addTo(QtDisplay *display)
Adds the function on to the display.
bool fitFunction()
Fits the function to the target DataRep.
void setFitRangeEnabled(bool yes=true)
Sets use of a fitting range on or off.
Qt Displays wraps a derived class of PlotterBase.
Definition: QtDisplay.h:71
void setFitter(const std::string &name)
Sets the Fitter with name in the FitterFactory.
int degreesOfFreedom()
Returns the number of degrees-of-freedom.
PlotterBase * m_target
The PlotterBase on which the FunctionRep is displayed.
Definition: PyFunctionRep.h:50
void setParameters(const std::vector< double > &params)
Set the parameter values.
void setFixedFlags(const std::vector< int > &flags)
Set the fixed flags of the parameters.
const std::string & getFitterName() const
Returns the name of the Fitter.
FunctionRep * m_rep
The wrapped FunctionRep object.
Definition: PyFunctionRep.h:47
Namespace for HippoDraw.
Definition: AxesType.cxx:21
The base class for data representations.
Definition: DataRep.h:68
double objectiveValue()
Returns the value of objective value.
This class is the public interface the what the user sees as the DataRep object from Python...
Definition: PyDataRep.h:37
QtDisplay * createResidualsDisplay() const
Returns an XY Plot of the residuals between the function and the data.
const std::vector< std::string > & parmNames() const
Returns the names of the parameters.
hippodraw::DataRep * getRep() const
Returns the wrapped FunctionRep object.
The base class for the PlotterBase hierarchy.
Definition: PlotterBase.h:55
const std::vector< std::vector< double > > & covarianceMatrix()
Returns the covariance matrix from the last fit.
A function that can be added to a DataRep and used in a fitter.
Definition: FunctionBase.h:90
This class is the public Python interface wrap for the FunctionRep class.
Definition: PyFunctionRep.h:41
double operator()(double x)
Returns the function value at a given x.
const std::vector< double > & parameters() const
Returns the current values of the parameters.
PyFunctionRep(const std::string &function_name, PyDataRep *rep)
Constructor taking function name and target DataRep.
void setFitRange(double low, double high)
Sets the cut to limit range of fitting.
A derived class of DataRep which is a base class for displaying a function.
Definition: FunctionRep.h:34
const std::vector< double > & principleErrors() const
Returns the principle error values associated with the parameters.

Generated for HippoDraw Class Library by doxygen