16 std::vector<Double_t>
x(10),
y(10);
28 if (!
gROOT->IsBatch() ) {
32 r<<
"par(mfrow = c(2,1))";
35 r<<
"plot(x, y, main = 'approx(.) and approxfun(.)')";
39 r<<
"points(approx(x, y), col = 2, pch = '*')";
40 r<<
"points(approx(x, y, method = 'constant'), col = 4, pch = '*')";
43 r <<
"print('Interpolated points')";
44 r <<
"print(approx(x,y,n=20))";
50 r<<
"f <- approxfun(x, y)";
52 r<<
"fc <- approxfun(x, y, method = 'const')";
54 if (!
gROOT->IsBatch() ) {
55 r<<
"curve(f(x), 0, 11, col = 'green2')";
58 r<<
"curve(fc(x), 0, 10, col = 'darkblue', add = TRUE)";
60 r<<
"plot(approxfun(x, y, rule = 2:1), 0, 11,col = 'tomato', add = TRUE, lty = 3, lwd = 2)";
65 r <<
"print('Result of approxfun with default method')";
66 r <<
"print(paste('x = ',x,' f(x) = ',f(x2)))";
67 r <<
"print('Result of approxfun with const method')";
68 r <<
"print(paste('x = ',x,' f(x) = ',fc(x2)))";
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
This is the base class for the ROOT Random number generators.
static TRInterface & Instance()
static method to get an TRInterface instance reference