26 #include "RConfigure.h" 35 #ifndef MATH_NO_PLUGIN_MANAGER 38 #include "TPluginManager.h" 40 #else // case no plugin manager is available 41 #ifdef R__HAS_MATHMORE 55 std::string typeName(name);
56 std::transform(typeName.begin(), typeName.end(), typeName.begin(), (int(*)(int)) toupper );
62 if (!typeName.empty())
MATH_WARN_MSG(
"IntegratorOneDim::GetType",
"Invalid type name specified - use default integrator" );
73 MATH_WARN_MSG(
"IntegratorOneDim::GetType",
"Invalid type specified " );
74 return std::string(
"undefined");
80 std::string typeName(name);
81 std::transform(typeName.begin(), typeName.end(), typeName.begin(), (int(*)(int)) toupper );
86 if (!typeName.empty())
MATH_WARN_MSG(
"IntegratorMultiDim::GetType",
"Invalid type name specified - use default integrator " );
96 MATH_WARN_MSG(
"IntegratorMultiDim::GetType",
"Invalid type specified " );
97 return std::string(
"Undefined");
103 unsigned int ndim = f.
NDim();
104 assert (icoord < ndim);
107 if (x != 0) adapter.
SetX(x, x+ ndim);
127 #ifndef R__HAS_MATHMORE 143 #ifdef MATH_NO_PLUGIN_MANAGER // no PM available 144 #ifdef R__HAS_MATHMORE 147 MATH_ERROR_MSG(
"IntegratorOneDim::CreateIntegrator",
"Integrator type is not available in MathCore");
150 #else // case of using Plugin Manager 154 R__LOCKGUARD(gROOTMutex);
157 if ((h = gROOT->GetPluginManager()->FindHandler(
"ROOT::Math::VirtualIntegrator",
"GSLIntegrator"))) {
158 if (h->LoadPlugin() == -1) {
159 MATH_WARN_MSG(
"IntegratorOneDim::CreateIntegrator",
"Error loading one dimensional GSL integrator - use Gauss integrator");
164 std::string typeName =
GetName(type);
170 std::cout <<
"Loaded Integrator " <<
typeid(*ig).name() << std::endl;
181 #ifndef R__HAS_MATHMORE 201 #ifdef MATH_NO_PLUGIN_MANAGER // no PM available 202 #ifdef R__HAS_MATHMORE 205 MATH_ERROR_MSG(
"IntegratorMultiDim::CreateIntegrator",
"Integrator type is not available in MathCore");
208 #else // use ROOT Plugin-Manager to instantiate GSLMCIntegrator 211 R__LOCKGUARD(gROOTMutex);
212 const char * pluginName =
"GSLMCIntegrator";
213 TPluginHandler *h =
nullptr;
215 if ((h = gROOT->GetPluginManager()->FindHandler(
"ROOT::Math::VirtualIntegrator", pluginName))) {
216 if (h->LoadPlugin() == -1) {
217 MATH_WARN_MSG(
"IntegratorMultiDim::CreateIntegrator",
"Error loading GSL MC multidim integrator - use adaptive method");
221 std::string typeName =
GetName(type);
227 std::cout <<
"Loaded Integrator " <<
typeid(*ig).name() << std::endl;
static double DefaultAbsTolerance()
static IntegrationMultiDim::Type GetType(const char *name)
static function to get the enumeration from a string
Interface (abstract) class for 1D numerical integration It must be implemented by the concrate Integr...
Namespace for new ROOT classes and functions.
Type
enumeration specifying the integration types.
static unsigned int DefaultNPoints()
#define MATH_WARN_MSG(loc, str)
User class for performing function integration.
static std::string DefaultIntegrator()
OneDimMultiFunctionAdapter class to wrap a multidimensional function in one dimensional one...
static unsigned int DefaultWKSize()
static double DefaultRelTolerance()
Class for performing numerical integration of a function in one dimension.
static IntegrationOneDim::Type DefaultIntegratorType()
#define MATH_ERROR_MSG(loc, str)
Documentation for the abstract class IBaseFunctionMultiDim.
Interface (abstract) class for multi numerical integration It must be implemented by the concrete Int...
static std::string DefaultIntegrator()
static IntegrationOneDim::Type GetType(const char *name)
static function to get the enumeration from a string
static std::string GetName(IntegrationMultiDim::Type)
static function to get a string from the enumeration
User class for performing function integration.
* x
Deprecated and error prone model selection interface.
Type
enumeration specifying the integration types.
static double DefaultAbsTolerance()
void SetX(Iterator begin, Iterator end)
Set X values in case vector is own, iterator size must match previous set dimension.
static std::string GetName(IntegrationOneDim::Type)
static function to get a string from the enumeration
Namespace for new Math classes and functions.
VirtualIntegratorMultiDim * CreateIntegrator(IntegrationMultiDim::Type type, double absTol, double relTol, unsigned int ncall)
void SetFunction(Function &f)
method to set the a generic integration function
static unsigned int DefaultWKSize()
static double DefaultRelTolerance()
VirtualIntegratorOneDim * CreateIntegrator(IntegrationOneDim::Type type, double absTol, double relTol, unsigned int size, int rule)
Class for adaptive quadrature integration in multi-dimensions using rectangular regions.
virtual unsigned int NDim() const =0
Retrieve the dimension of the function.
static unsigned int DefaultNCalls()