I can’t run this code on ROOT ! I know, first function is not consistent with derivativeFunc.C.
if I make it as “g++ derivaticeFunc.cpp -o derivativeFunc” , then it is not suitable for C++ due to “Math libraries”
Is there another way to run this script on ROOT ?
Thanks,
Cheers,
Ersel
[code]#include
#include “Math/Functor.h”
#include "Math/RichardsonDerivator.h"
using namespace std;
double myfunc(double x) {
return 2+3x+4sqrt(x,2);
}
int derivativeFunc () {
double x0 = 2;
ROOT::Math::Functor1D f1D(&myfunc);
ROOT::Math::RichardsonDerivator rd;
rd.SetFunction(f1D);
cout<<"Derivative of fucntion inheriting from "<<“IGenFunction f(x)=2+3x+4x^2 =2”<<endl;
cout<<"First Derivative : "<<rd.Derivative1(x0)<<endl;
cout<<"Second Derivative : "<<rd.Derivative2(x0)<<endl;
cout<<"Third Derivative : "<<rd.Derivative3(x0)<<endl;
return 0;
}
[/code]