36 #define FUNC x[0]+x[1] 42 #define FUNC1D std::exp(x); 43 #define FUNC std::exp( x[0] + x[1] ); 77 double Derivative(
const double * x,
int )
const {
return FUNC; }
78 double Eval(
const double * x)
const {
return FUNC; }
80 struct MyDerivFunction {
101 double Derivative(
double x)
const {
return FUNC1D; }
111 unsigned int NDim()
const {
return 2; }
113 DerivFunction * Clone()
const {
114 return new DerivFunction();
120 double DoEval(
const double *
x)
const {
131 DerivFunction1D * Clone()
const {
132 return new DerivFunction1D();
138 double DoEval(
double x)
const {
145 double Eval(
double x) {
153 template <
class Func>
163 for (
int ipass = 0; ipass <
NLOOP; ++ipass) {
164 for (
int i = 0; i <
Ntimes-1; ++i) {
165 const double * xx = &x[i];
171 std::cout <<
"Time for " <<
typeid(
f).
name() <<
"\t: " << w.
RealTime() <<
" " << w.
CpuTime() << std::endl;
172 std::cout << s << std::endl;
175 template <
class PFunc>
186 for (
int ipass = 0; ipass <
NLOOP; ++ipass) {
187 for (
int i = 0; i <
Ntimes-1; ++i) {
188 double y =
f(&x[i],p);
193 std::cout <<
"Time for " <<
typeid(
f).
name() <<
"\t: " << w.
RealTime() <<
" " << w.
CpuTime() << std::endl;
194 std::cout << s << std::endl;
211 for (
int ipass = 0; ipass <
NLOOP; ++ipass) {
212 for (
int i = 0; i <
Ntimes-1; ++i) {
218 std::cout <<
"Time for " <<
"TF1\t\t" <<
"\t: " << w.
RealTime() <<
" " << w.
CpuTime() << std::endl;
219 std::cout << s << std::endl;
237 for (
int ipass = 0; ipass <
NLOOP; ++ipass) {
238 for (
int i = 0; i <
Ntimes-1; ++i) {
245 std::cout <<
"Time for " <<
"RooPdf\t\t" <<
"\t: " << w.
RealTime() <<
" " << w.
CpuTime() << std::endl;
246 std::cout << s << std::endl;
255 std::cout <<
"\n**************************************************************\n";
256 std::cout <<
"Test of Multi-dim functors" << std::endl;
257 std::cout <<
"***************************************************************\n\n";
284 MyDerivFunction myderf;
293 std::cout <<
"\n**************************************************************\n";
294 std::cout <<
"Test of 1D functors" << std::endl;
295 std::cout <<
"***************************************************************\n\n";
334 std::cout <<
"\n**************************************************************\n";
335 std::cout <<
"Extra functor tests" << std::endl;
336 std::cout <<
"***************************************************************\n\n";
389 FunctorNV<GradFunc, MyFunction> f5(myf);
393 Functor<GenFunc> f6(f3);
448 TestTimeRooPdf(rooExp,&x);
double freeRootFunc2D(const double *x, const double *)
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
GradFunctor class for Multidimensional gradient functions.
GradFunctor1D class for one-dimensional gradient functions.
Documentation for class Functor class.
Random number generator class based on the maximally quidistributed combined Tausworthe generator by ...
Double_t getVal(const RooArgSet *set=0) const
Class to Wrap a ROOT Function class (like TF1) in a IParamFunction interface of one dimensions to be ...
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
TRObject operator()(const T1 &t1) const
double freeFunction1D(double x)
Template class to wrap any C++ callable object which takes one argument i.e.
void Stop()
Stop the stopwatch.
double freeRootFunc1D(const double *xx, const double *)
Class to Wrap a ROOT Function class (like TF1) in a IParamMultiFunction interface of multi-dimensions...
double freeFunction(const double *x)
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
Documentation for the abstract class IBaseFunctionMultiDim.
void TestTimePF(PFunc &f)
virtual void RndmArray(Int_t n, Float_t *array)
Return an array of n random numbers uniformly distributed in ]0,1].
IParamFunction interface (abstract class) describing multi-dimensional parameteric functions It is a ...
void TestTime(const Func &f)
double freeParamFunc1D(double x, double *)
Template class to wrap any C++ callable object implementing operator() (const double * x) in a multi-...
unsigned int NDim() const
Retrieve the dimension of the function.
void TestTimeGF(const ROOT::Math::IGenFunction &f)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
double f2(const double *x)
Param Functor class for Multidimensional functions.
Functor1D class for one-dimensional functions.
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Evaluate function with given coordinates and parameters.
Template class to wrap any member function of a class taking a double and returning a double in a 1D ...
WrappedParamFunction class to wrap any multi-dimensional function pbject implementing the operator()(...