ROOT
6.06/09
Reference Guide
|
WrappedParamGenFunction class to wrap any multi-dimensional function implementing the operator()(const double * ) in an interface-like IParamFunction, by fixing some of the variables and define them as parameters.
i.e. transform any multi-dim function in a parametric function
Definition at line 142 of file WrappedParamFunction.h.
Public Member Functions | |
WrappedParamFunctionGen (const FuncPtr &func, unsigned int dim, unsigned int npar, const double *par, const unsigned int *idx) | |
Constructor a wrapped function from a pointer to a generic callable object implemention operator()(const double *), the new function dimension, the number of parameters (number of fixed variables) and an array specifying the index of the fixed variables which becames parameters in the new API. More... | |
WrappedParamFunctionGen (FuncPtr &func, unsigned int dim, unsigned int npar, const double *par, const unsigned int *idx) | |
Constructor as before but taking now a non - const pointer to a callable object. More... | |
IMultiGenFunction * | Clone () const |
clone the function More... | |
const double * | Parameters () const |
Access the parameter values. More... | |
void | SetParameters (const double *p) |
Set the parameter values. More... | |
unsigned int | NPar () const |
Return the number of Parameters. More... | |
unsigned int | NDim () const |
Retrieve the dimension of the function. More... | |
Public Member Functions inherited from ROOT::Math::IParametricFunctionMultiDim | |
double | operator() (const double *x, const double *p) const |
Evaluate function at a point x and for given parameters p. More... | |
Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDim | |
IBaseFunctionMultiDim () | |
virtual | ~IBaseFunctionMultiDim () |
virtual destructor More... | |
double | operator() (const double *x) const |
Evaluate the function at a point x[]. More... | |
Public Member Functions inherited from ROOT::Math::IBaseParam | |
virtual | ~IBaseParam () |
Virtual Destructor (no operations) More... | |
virtual std::string | ParameterName (unsigned int i) const |
Return the name of the i-th parameter (starting from zero) Overwrite if want to avoid the default name ("Par_0, Par_1, ...") More... | |
Private Member Functions | |
WrappedParamFunctionGen (const WrappedParamFunctionGen &) | |
WrappedParamFunctionGen & | operator= (const WrappedParamFunctionGen &) |
double | DoEval (const double *x) const |
evaluate the function (re-implement for being more efficient) More... | |
double | DoEvalPar (const double *x, const double *p) const |
implement the required IParamFunction interface More... | |
void | DoInit () |
void | SetParValues (unsigned int npar, const double *p) const |
Private Attributes | |
FuncPtr | fFunc |
unsigned int | fDim |
std::vector< double > | fParams |
std::vector< unsigned int > | fVarIndices |
std::vector< unsigned int > | fParIndices |
std::vector< double > | fX |
Additional Inherited Members | |
Public Types inherited from ROOT::Math::IParametricFunctionMultiDim | |
typedef IBaseFunctionMultiDim | BaseFunc |
Public Types inherited from ROOT::Math::IBaseFunctionMultiDim | |
typedef IBaseFunctionMultiDim | BaseFunc |
#include <Math/WrappedParamFunction.h>
|
inline |
Constructor a wrapped function from a pointer to a generic callable object implemention operator()(const double *), the new function dimension, the number of parameters (number of fixed variables) and an array specifying the index of the fixed variables which becames parameters in the new API.
Definition at line 151 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::Clone().
|
inline |
Constructor as before but taking now a non - const pointer to a callable object.
This constructor is needed in the case FuncPtr is a std::auto_ptr which has a copy ctor taking non const objects
Definition at line 165 of file WrappedParamFunction.h.
|
private |
|
inlinevirtual |
clone the function
Implements ROOT::Math::IBaseFunctionMultiDim.
Definition at line 176 of file WrappedParamFunction.h.
|
inlineprivatevirtual |
evaluate the function (re-implement for being more efficient)
Reimplemented from ROOT::Math::IParametricFunctionMultiDim.
Definition at line 212 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEvalPar().
|
inlineprivatevirtual |
implement the required IParamFunction interface
Implements ROOT::Math::IParametricFunctionMultiDim.
Definition at line 239 of file WrappedParamFunction.h.
|
inlineprivate |
Definition at line 245 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::WrappedParamFunctionGen().
|
inlinevirtual |
Retrieve the dimension of the function.
Implements ROOT::Math::IBaseFunctionMultiDim.
Definition at line 199 of file WrappedParamFunction.h.
|
inlinevirtual |
Return the number of Parameters.
Implements ROOT::Math::IBaseParam.
Definition at line 197 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEval(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEvalPar(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoInit(), and ROOT::Math::WrappedParamFunctionGen< FuncPtr >::SetParameters().
|
private |
|
inlinevirtual |
Access the parameter values.
Implements ROOT::Math::IBaseParam.
Definition at line 187 of file WrappedParamFunction.h.
|
inlinevirtual |
Set the parameter values.
p | vector of doubles containing the parameter values. |
to be defined: can user change number of params ? At the moment no.
Implements ROOT::Math::IBaseParam.
Definition at line 191 of file WrappedParamFunction.h.
|
inlineprivate |
Definition at line 280 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEvalPar(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoInit(), and ROOT::Math::WrappedParamFunctionGen< FuncPtr >::SetParameters().
|
private |
Definition at line 290 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::Clone(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEval(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoInit(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::NDim(), and ROOT::Math::WrappedParamFunctionGen< FuncPtr >::SetParValues().
|
mutableprivate |
Definition at line 289 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::Clone(), and ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEval().
|
private |
Definition at line 291 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::Clone(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoInit(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::NPar(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::Parameters(), and ROOT::Math::WrappedParamFunctionGen< FuncPtr >::SetParameters().
|
private |
Definition at line 293 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::Clone(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoInit(), and ROOT::Math::WrappedParamFunctionGen< FuncPtr >::SetParValues().
|
private |
Definition at line 292 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEval(), and ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoInit().
|
mutableprivate |
Definition at line 294 of file WrappedParamFunction.h.
Referenced by ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoEval(), ROOT::Math::WrappedParamFunctionGen< FuncPtr >::DoInit(), and ROOT::Math::WrappedParamFunctionGen< FuncPtr >::SetParValues().