00001 /* -*- mode: c++ -*- */ 00002 00014 #ifndef PyFunctionRep_H 00015 #define PyFunctionRep_H 00016 00017 #include <string> 00018 #include <vector> 00019 00020 class PyDataRep; 00021 class DataRep; 00022 class FunctionRep; 00023 class FunctionBase; 00024 class PlotterBase; 00025 class QApplication; 00026 class QtDisplay; 00027 00040 class PyFunctionRep 00041 { 00042 00043 private: 00044 00046 QApplication * m_app; 00047 00049 FunctionRep * m_rep; 00050 00052 PlotterBase * m_target; 00053 00054 public: 00055 00057 PyFunctionRep ( const std::string & function_name, PyDataRep * rep ); 00058 00059 PyFunctionRep ( FunctionBase * function, PyDataRep * rep ); 00060 00062 void addTo ( QtDisplay * display ); 00063 00065 DataRep * getRep () const; 00066 00068 const std::vector < std::string > & parmNames () const; 00069 00075 const std::vector < double > & parameters () const; 00076 00078 const std::vector < double > & principleErrors () const; 00079 00085 bool fitFunction (); 00086 00088 void setParameters( const std::vector<double> & params ); 00089 00092 double operator () ( double x ); 00093 00095 double objectiveValue(); 00096 00099 const std::vector < std::vector < double > > & covarianceMatrix (); 00100 00102 int degreesOfFreedom(); 00103 00105 void setFixedFlags( const std::vector<int> & flags ); 00106 00109 void setFitter ( const std::string & name ); 00110 00113 const std::string & getFitterName () const; 00114 00118 QtDisplay * createResidualsDisplay () const; 00119 00122 void setFitRange ( double low, double high ); 00123 00126 void setFitRangeEnabled ( bool yes = true ); 00127 00128 }; 00129 00130 #endif // PyFunctionRep_H