29 grad[0]=-400 *
x * (
y -
x *
x) - 2 * (1 -
x);
30 grad[1]=200 * (
y -
x *
x);
48 r.Execute(
"result <- optim( c(0.01,0.01), RosenBrock,method='BFGS',control = list(maxit = 1000000) )");
54 std::cout.precision(8);
56 std::cout<<
"-----------------------------------------"<<std::endl;
57 std::cout<<
"Minimum x="<<min[0]<<
" y="<<min[1]<<std::endl;
58 std::cout<<
"Value at minimum ="<<
RosenBrock(min)<<std::endl;
61 r.Execute(
"optimHess(result$par, RosenBrock, RosenBrockGrad)");
62 r.Execute(
"hresult <- optim(c(-1.2,1), RosenBrock, NULL, method = 'BFGS', hessian = TRUE)");
67 std::cout<<
"-----------------------------------------"<<std::endl;
68 std::cout<<
"Minimization with the Gradient"<<std::endl;
69 std::cout<<
"Minimum x="<<
hmin[0]<<
" y="<<
hmin[1]<<std::endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
This is a class to pass functions from ROOT to R.
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