@@ -102,9 +102,12 @@ inline double integrate(
102102 return sign * res;
103103}
104104
105-
106105/* ***************************************************************************/
107106
107+ // Internal implementation
108+ namespace detail
109+ {
110+
108111// Integrate R function
109112class RFunc : public Func
110113{
@@ -139,6 +142,10 @@ class RFunc: public Func
139142 }
140143};
141144
145+ } // namespace detail
146+
147+
148+
142149//
143150// [RcppNumerical API] 1-D numerical integration for R function
144151//
@@ -150,7 +157,7 @@ inline double integrate(
150157)
151158{
152159 Integrator<double > intgr (subdiv);
153- RFunc rfun (f, args);
160+ detail:: RFunc rfun (f, args);
154161 double res = intgr.quadratureAdaptive (rfun, lower, upper, eps_abs, eps_rel, rule);
155162 err_est = intgr.estimatedError ();
156163 err_code = intgr.errorCode ();
@@ -159,6 +166,10 @@ inline double integrate(
159166
160167/* ***************************************************************************/
161168
169+ // Internal implementation
170+ namespace detail
171+ {
172+
162173// Function type for Cuhre()
163174typedef void (*CFUN_Cuhre_TYPE)(const int ndim, const int ncomp,
164175 integrand_t integrand, void *userdata, const int nvec,
@@ -206,6 +217,10 @@ class MFuncWithBound: public MFunc
206217
207218};
208219
220+ } // namespace detail
221+
222+
223+
209224//
210225// [RcppNumerical API] Multi-dimensional integration
211226//
@@ -216,15 +231,15 @@ inline double integrate(
216231)
217232{
218233 // Find the Cuhre() function
219- CFUN_Cuhre_TYPE cfun_Cuhre = (CFUN_Cuhre_TYPE) R_GetCCallable (" RcppNumerical" , " Cuhre" );
234+ detail:: CFUN_Cuhre_TYPE cfun_Cuhre = (detail:: CFUN_Cuhre_TYPE) R_GetCCallable (" RcppNumerical" , " Cuhre" );
220235
221- MFuncWithBound fb (f, lower, upper);
236+ detail:: MFuncWithBound fb (f, lower, upper);
222237 int nregions;
223238 int neval;
224239 double integral;
225240 double prob;
226241
227- cfun_Cuhre (lower.size (), 1 , cuhre_integrand, &fb, 1 ,
242+ cfun_Cuhre (lower.size (), 1 , detail:: cuhre_integrand, &fb, 1 ,
228243 eps_rel, eps_abs,
229244 4 , 1 , maxeval,
230245 0 ,
@@ -238,6 +253,7 @@ inline double integrate(
238253}
239254
240255
256+
241257} // namespace Numer
242258
243259
0 commit comments