![]() |
Diana Software
|
generic C++ interface on static functions More...
Public Types | |
| typedef double(* | QRoutinePointer) (double, double *params) |
| pointer to function More... | |
Public Member Functions | |
| QMathFunction (QRoutinePointer funcpointer, unsigned int NParameters, double LowBound, double UpBound) | |
| constructor More... | |
| QMathFunction (const QMathFunction &func) | |
| copy constructor More... | |
| virtual | ~QMathFunction () |
| destructor More... | |
| const QMathFunction & | operator= (const QMathFunction &func) |
| operator= More... | |
| void | SetParameter (unsigned int p, double val) |
| set parameter value More... | |
| void | SetParameter (unsigned int p, const char *name, double val) |
| set parameter value and name More... | |
| void | SetParameters (const double *param) |
| set all parameters from an array that has to be well sized More... | |
| double | GetParameter (unsigned int p) const |
| get parameter More... | |
| const double * | GetParameters () const |
| pointer to array of parameters More... | |
| size_t | GetNParameters () const |
| get number of parameters More... | |
| double | Eval (double x) const |
| evaluate function More... | |
| double | Eval (double x, double *params) const |
| evaluate function with external parameters More... | |
| virtual void | Print () |
| print parameters and names if set More... | |
| void | SetVerbose (bool verbose=true) |
| set verbose More... | |
| virtual void | SetTF1 (TF1 &tf1) |
| set parameters from ROOT TF1 More... | |
| QError | GetMinimum (double &min, double &minpos, double epsabs=0.001, double epsrel=0.0) |
| get function minimum More... | |
| QError | GetMaximum (double &max, double &maxpos, double epsabs=0.001, double epsrel=0.0) |
| get function maximum More... | |
Protected Member Functions | |
| gsl_function | GetGSLFunction () |
| return a gsl function More... | |
| void | SetParName (unsigned int p, const char *name) |
| set parameter name More... | |
Protected Attributes | |
| QRoutinePointer | fRoutine |
| pointer to the underlying static function More... | |
| size_t | fNParameters |
| number of parameters More... | |
| double * | fParameters |
| array of parameters More... | |
| std::vector< const char * > | fParNames |
| parameters names More... | |
| double | fLowBound |
| low function bound More... | |
| double | fUpBound |
| high function bound More... | |
| bool | fVerbose |
| verbose More... | |
Friends | |
| class | QMinimizer |
generic C++ interface on static functions
Definition at line 18 of file QMathFunction.hh.
| typedef double(* QMathFunction::QRoutinePointer) (double, double *params) |
pointer to function
Definition at line 23 of file QMathFunction.hh.
| QMathFunction::QMathFunction | ( | QRoutinePointer | funcpointer, |
| unsigned int | NParameters, | ||
| double | LowBound, | ||
| double | UpBound | ||
| ) |
constructor
Definition at line 16 of file QMathFunction.cc.
References fLowBound, fNParameters, fParameters, fParNames, fRoutine, fUpBound, and fVerbose.
| QMathFunction::QMathFunction | ( | const QMathFunction & | func | ) |
copy constructor
Definition at line 31 of file QMathFunction.cc.
References fNParameters, and fParameters.
|
virtual |
|
inline |
evaluate function
Definition at line 57 of file QMathFunction.hh.
References fParameters, and fRoutine.
Referenced by QFitter::Fit(), and QFitter::RootRoutine().
|
inline |
evaluate function with external parameters
Definition at line 60 of file QMathFunction.hh.
References fRoutine.
|
protected |
return a gsl function
Definition at line 8 of file QMathFunction.cc.
References fParameters, and fRoutine.
Referenced by QMinimizer::GetMinimum().
| QError QMathFunction::GetMaximum | ( | double & | max, |
| double & | maxpos, | ||
| double | epsabs = 0.001, |
||
| double | epsrel = 0.0 |
||
| ) |
get function maximum
| max | f(x_max) |
| maxpos | x_max |
| epsabs | absolute precision |
| epsrel | relative precision |
Definition at line 106 of file QMathFunction.cc.
References err, fLowBound, fParameters, fUpBound, fVerbose, QMinimizer::GetMaximum(), max, maxpos, Q_DOUBLE_DEFAULT, QERR_SUCCESS, QERR_UNKNOWN_ERR, QMinimizer, and QMinimizer::SetVerbose().
| QError QMathFunction::GetMinimum | ( | double & | min, |
| double & | minpos, | ||
| double | epsabs = 0.001, |
||
| double | epsrel = 0.0 |
||
| ) |
get function minimum
| min | f(x_min) |
| minpos | x_min |
| epsabs | absolute precision |
| epsrel | relative precision |
Definition at line 89 of file QMathFunction.cc.
References err, fLowBound, fParameters, fUpBound, fVerbose, QMinimizer::GetMinimum(), min(), Q_DOUBLE_DEFAULT, QERR_SUCCESS, QERR_UNKNOWN_ERR, QMinimizer, and QMinimizer::SetVerbose().
|
inline |
|
inline |
|
inline |
pointer to array of parameters
Definition at line 51 of file QMathFunction.hh.
References fParameters.
| const QMathFunction & QMathFunction::operator= | ( | const QMathFunction & | func | ) |
operator=
Definition at line 43 of file QMathFunction.cc.
References fLowBound, fNParameters, fParameters, fParNames, fRoutine, fUpBound, and fVerbose.
|
virtual |
print parameters and names if set
Reimplemented in QFitter.
Definition at line 63 of file QMathFunction.cc.
References fNParameters, fParameters, and fParNames.
| void QMathFunction::SetParameter | ( | unsigned int | p, |
| const char * | name, | ||
| double | val | ||
| ) |
set parameter value and name
Definition at line 82 of file QMathFunction.cc.
References SetParameter(), and SetParName().
| void QMathFunction::SetParameter | ( | unsigned int | p, |
| double | val | ||
| ) |
set parameter value
Definition at line 75 of file QMathFunction.cc.
References fNParameters, and fParameters.
Referenced by SetParameter().
|
inline |
set all parameters from an array that has to be well sized
Definition at line 45 of file QMathFunction.hh.
References fNParameters, and fParameters.
|
inlineprotected |
set parameter name
Definition at line 94 of file QMathFunction.hh.
References fNParameters, and fParNames.
Referenced by QFitter::FixParameter(), SetParameter(), and QFitter::SetParameter().
|
virtual |
set parameters from ROOT TF1
Reimplemented in QFitter.
Definition at line 123 of file QMathFunction.cc.
References fNParameters, fParameters, and fParNames.
Referenced by QFitter::SetTF1().
|
inline |
|
friend |
Definition at line 117 of file QMathFunction.hh.
Referenced by GetMaximum(), and GetMinimum().
|
protected |
low function bound
Definition at line 110 of file QMathFunction.hh.
Referenced by QFitter::Fit(), GetMaximum(), GetMinimum(), operator=(), and QMathFunction().
|
protected |
number of parameters
Definition at line 101 of file QMathFunction.hh.
Referenced by QFitter::Fit(), QFitter::FixParameter(), GetNParameters(), operator=(), QFitter::Print(), Print(), QFitter::PrintResult(), QFitter::QFitter(), QMathFunction(), SetParameter(), QFitter::SetParameter(), SetParameters(), SetParName(), QFitter::SetTF1(), and SetTF1().
|
protected |
array of parameters
Definition at line 104 of file QMathFunction.hh.
Referenced by Eval(), QFitter::Fit(), QFitter::FixParameter(), GetGSLFunction(), GetMaximum(), GetMinimum(), GetParameter(), GetParameters(), operator=(), QFitter::Print(), Print(), QFitter::PrintResult(), QMathFunction(), SetParameter(), QFitter::SetParameter(), SetParameters(), QFitter::SetTF1(), SetTF1(), and ~QMathFunction().
|
protected |
parameters names
Definition at line 107 of file QMathFunction.hh.
Referenced by operator=(), QFitter::Print(), Print(), QFitter::PrintResult(), QMathFunction(), SetParName(), and SetTF1().
|
protected |
pointer to the underlying static function
Definition at line 97 of file QMathFunction.hh.
Referenced by Eval(), GetGSLFunction(), QMinimizer::GetMaximum(), operator=(), and QMathFunction().
|
protected |
high function bound
Definition at line 112 of file QMathFunction.hh.
Referenced by QFitter::Fit(), GetMaximum(), GetMinimum(), operator=(), and QMathFunction().
|
protected |
verbose
Definition at line 115 of file QMathFunction.hh.
Referenced by QFitter::Fit(), GetMaximum(), GetMinimum(), operator=(), QFitter::QFitter(), QMathFunction(), and SetVerbose().