#ifndef ROOT_Math_WrappedMultiTF1
#define ROOT_Math_WrappedMultiTF1
#ifndef ROOT_Math_IParamFunction
#include "Math/IParamFunction.h"
#endif
#ifndef ROOT_TF1
#include "TF1.h"
#endif
namespace ROOT {
namespace Math {
class WrappedMultiTF1 : public ROOT::Math::IParamMultiFunction {
public:
typedef ROOT::Math::IParamMultiFunction BaseParamFunc;
typedef ROOT::Math::IParamMultiFunction::BaseFunc BaseFunc;
WrappedMultiTF1 (TF1 & f ) :
fFunc(&f),
fParams(f.GetParameters(),f.GetParameters()+f.GetNpar())
{ }
virtual ~WrappedMultiTF1 () {}
WrappedMultiTF1(const WrappedMultiTF1 & rhs) :
BaseFunc(),
BaseParamFunc(),
fFunc(rhs.fFunc),
fParams(rhs.fParams)
{}
WrappedMultiTF1 & operator = (const WrappedMultiTF1 & rhs) {
if (this == &rhs) return *this;
fFunc = rhs.fFunc;
fParams = rhs.fParams;
return *this;
}
IMultiGenFunction * Clone() const {
return new WrappedMultiTF1(*this);
}
unsigned int NDim() const {
return fFunc->GetNdim();
}
const double * Parameters() const {
return &fParams.front();
}
void SetParameters(const double * p) {
std::copy(p,p+fParams.size(),fParams.begin());
}
unsigned int NPar() const {
return fParams.size();
}
std::string ParameterName(unsigned int i) const {
return std::string(fFunc->GetParName(i));
}
private:
double DoEvalPar (const double * x, const double * p ) const {
if (fFunc->GetMethodCall() ) fFunc->InitArgs(x,p);
return fFunc->EvalPar(x,p);
}
TF1 * fFunc;
std::vector<double> fParams;
};
}
}
#endif /* ROOT_Fit_WrappedMultiTF1 */
Last change: Wed Jun 25 08:30:33 2008
Last generated: 2008-06-25 08:30
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.