11 #ifndef ROOT_Math_IntegratorOptions
12 #define ROOT_Math_IntegratorOptions
35 class BaseIntegratorOptions {
40 BaseIntegratorOptions();
45 BaseIntegratorOptions(
const BaseIntegratorOptions & opt);
48 BaseIntegratorOptions & operator=(
const BaseIntegratorOptions & opt);
52 virtual ~BaseIntegratorOptions() { ClearExtra(); }
56 virtual std::string Integrator()
const = 0;
61 double AbsTolerance()
const {
return fAbsTolerance; }
64 double RelTolerance()
const {
return fRelTolerance; }
67 unsigned int WKSize()
const {
return fWKSize; }
71 IOptions * ExtraOptions()
const {
return fExtraOptions; }
77 void SetAbsTolerance(
double tol) { fAbsTolerance = tol; }
80 void SetRelTolerance(
double tol) { fRelTolerance = tol; }
83 void SetWKSize(
unsigned int size) { fWKSize = size; }
86 void SetExtraOptions(
const IOptions & opt);
102 ROOT::Math::IOptions * fExtraOptions;
113 class IntegratorOneDimOptions :
public BaseIntegratorOptions {
120 IntegratorOneDimOptions(IOptions * extraOpts = 0);
122 virtual ~IntegratorOneDimOptions() {}
125 IntegratorOneDimOptions(
const IntegratorOneDimOptions & rhs) :
126 BaseIntegratorOptions(rhs)
130 IntegratorOneDimOptions & operator=(
const IntegratorOneDimOptions & rhs) {
131 if (
this == &rhs)
return *
this;
132 static_cast<BaseIntegratorOptions &
>(*this) = rhs;
140 void SetNPoints(
unsigned int n) { fNCalls = n; }
143 unsigned int NPoints()
const {
return fNCalls; }
146 std::string Integrator()
const;
149 IntegrationOneDim::Type IntegratorType()
const {
return (IntegrationOneDim::Type) fIntegType; }
152 void SetIntegrator(
const char * name);
155 void Print(std::ostream & os = std::cout)
const;
159 static void SetDefaultIntegrator(
const char * name);
160 static void SetDefaultAbsTolerance(
double tol);
161 static void SetDefaultRelTolerance(
double tol);
162 static void SetDefaultWKSize(
unsigned int size);
163 static void SetDefaultNPoints(
unsigned int n);
165 static std::string DefaultIntegrator();
166 static IntegrationOneDim::Type DefaultIntegratorType();
167 static double DefaultAbsTolerance();
168 static double DefaultRelTolerance();
169 static unsigned int DefaultWKSize();
170 static unsigned int DefaultNPoints();
173 static ROOT::Math::IOptions & Default(
const char * name);
176 static ROOT::Math::IOptions * FindDefault(
const char * name);
179 static void PrintDefault(
const char * name = 0, std::ostream & os = std::cout);
194 class IntegratorMultiDimOptions :
public BaseIntegratorOptions {
201 IntegratorMultiDimOptions(IOptions * extraOpts = 0);
203 virtual ~IntegratorMultiDimOptions() {}
206 IntegratorMultiDimOptions(
const IntegratorMultiDimOptions & rhs) :
207 BaseIntegratorOptions(rhs)
211 IntegratorMultiDimOptions & operator=(
const IntegratorMultiDimOptions & rhs) {
212 if (
this == &rhs)
return *
this;
213 static_cast<BaseIntegratorOptions &
>(*this) = rhs;
219 void SetNCalls(
unsigned int calls) { fNCalls = calls; }
222 unsigned int NCalls()
const {
return fNCalls; }
225 std::string Integrator()
const;
228 IntegrationMultiDim::Type IntegratorType()
const {
return (IntegrationMultiDim::Type) fIntegType; }
231 void SetIntegrator(
const char * name);
234 void Print(std::ostream & os = std::cout)
const;
238 static void SetDefaultIntegrator(
const char * name);
239 static void SetDefaultAbsTolerance(
double tol);
240 static void SetDefaultRelTolerance(
double tol);
241 static void SetDefaultWKSize(
unsigned int size);
242 static void SetDefaultNCalls(
unsigned int ncall);
244 static std::string DefaultIntegrator();
245 static IntegrationMultiDim::Type DefaultIntegratorType();
246 static double DefaultAbsTolerance();
247 static double DefaultRelTolerance();
248 static unsigned int DefaultWKSize();
249 static unsigned int DefaultNCalls();
252 static ROOT::Math::IOptions & Default(
const char * name);
255 static ROOT::Math::IOptions * FindDefault(
const char * name);
258 static void PrintDefault(
const char * name = 0, std::ostream & os = std::cout);