Example to create class Functor
class MyFunctor{
public:
MyFunctor() {
status=false;
}
status=true;
}
Bool_t getStatus(){
return status;}
}
private:
};
.constructor()
.method( "doEval", &MyFunctor::doEval )
.method( "getStatus", &MyFunctor::getStatus)
;
}
{
r<<
"MyFunctor <- MyFunctorModule$MyFunctor";
r<<
"u <- new(MyFunctor)";
r<<
"print(u$getStatus())";
r<<
"print(sprintf('value in R = %f',u$doEval( 1 )))";
MyFunctor functor;
r<<
"print(functor$getStatus())";
r<<
"print(sprintf('value in R = %f',functor$doEval( 1 )))";
std::cout<<
"value in ROOT = "<<
TMath::Erf(1)<<std::endl;
}
#define ROOTR_EXPOSED_CLASS
#define LOAD_ROOTR_MODULE(NAME)
Double_t(* Function)(Double_t)
ROOT R was implemented using the R Project library and the modules Rcpp and RInside
static TRInterface & Instance()
static method to get an TRInterface instance reference
Double_t Erf(Double_t x)
Computation of the error function erf(x).
Double_t BesselY1(Double_t x)
Bessel function Y0(x) for positive x.
- Author
- Omar Zapata
Definition in file Functor.C.