16#include "RConfigure.h"
67 template<
class OptionType>
69 static int N() {
return 0; }
70 static int N(
const OptionType & ) {
return 0; }
90 template <
class OptionType>
91 void Print(std::ostream & os,
const OptionType & opt) {
93 os << std::setw(25) <<
"Integrator Type" <<
" : " << std::setw(15) << opt.Integrator() << std::endl;
94 os << std::setw(25) <<
"Absolute tolerance" <<
" : " << std::setw(15) << opt.AbsTolerance() << std::endl;
95 os << std::setw(25) <<
"Relative tolerance" <<
" : " << std::setw(15) << opt.RelTolerance() << std::endl;
96 os << std::setw(25) <<
"Workspace size" <<
" : " << std::setw(15) << opt.WKSize() << std::endl;
98 os << std::setw(25) << OPT::DescriptionOfN() <<
" : " << std::setw(15) << OPT::N(opt) << std::endl;
99 if (opt.ExtraOptions()) {
100 os << opt.Integrator() <<
" specific options :" << std::endl;
101 opt.ExtraOptions()->Print(os);
107 template <
class OptionType>
110 std::string integName = (
name !=
nullptr) ?
name : OptionType::DefaultIntegrator();
111 os <<
"Default options for numerical integrator " << integName <<
" : " << std::endl;
112 os << std::setw(25) <<
"Absolute tolerance" <<
" : " << std::setw(15) << OptionType::DefaultAbsTolerance() << std::endl;
113 os << std::setw(25) <<
"Relative tolerance" <<
" : " <<std::setw(15) << OptionType::DefaultRelTolerance() << std::endl;
114 os << std::setw(25) <<
"Workspace size" <<
" : " << std::setw(15) << OptionType::DefaultWKSize() << std::endl;
116 os << std::setw(25) << OPT::DescriptionOfN() <<
" : " << std::setw(15) << OPT::N() << std::endl;
118 if (opts) opts->
Print(os);
139 if (
this == &opt)
return *
this;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int fIntegType
Integrator type (value converted from enum).
BaseIntegratorOptions()
protected constructor to avoid user creating this class
ROOT::Math::IOptions * fExtraOptions
void SetExtraOptions(const IOptions &opt)
set extra options (in this case pointer is cloned)
double fAbsTolerance
absolute tolerance
double fRelTolerance
relative tolerance
BaseIntegratorOptions & operator=(const BaseIntegratorOptions &opt)
assignment operators
unsigned int fNCalls
(max) function calls
unsigned int fWKSize
workspace size
static IOptions & Default(const char *algoname)
static IOptions * FindDefault(const char *algoname)
Generic interface for defining configuration options of a numerical algorithm.
virtual IOptions * Clone() const =0
virtual void Print(std::ostream &=std::cout) const
print options
Numerical multi dimensional integration options.
static void SetDefaultAbsTolerance(double tol)
static std::string DefaultIntegrator()
static void SetDefaultWKSize(unsigned int size)
static void SetDefaultIntegrator(const char *name)
void Print(std::ostream &os=std::cout) const
print all the options
static void SetDefaultNCalls(unsigned int ncall)
IntegratorMultiDimOptions(IOptions *extraOpts=nullptr)
constructor using the default options can pass a pointer to extra options (N.B.
static unsigned int DefaultWKSize()
static ROOT::Math::IOptions * FindDefault(const char *name)
find specific options - return 0 if not existing
void SetIntegrator(const char *name)
set multi-dim integrator name
static IntegrationMultiDim::Type DefaultIntegratorType()
static ROOT::Math::IOptions & Default(const char *name)
retrieve specific options
static unsigned int DefaultNCalls()
static void SetDefaultRelTolerance(double tol)
std::string Integrator() const override
name of multi-dim integrator
unsigned int NCalls() const
maximum number of function calls
static double DefaultRelTolerance()
static double DefaultAbsTolerance()
static void PrintDefault(const char *name=nullptr, std::ostream &os=std::cout)
print only the specified default options
static std::string GetName(IntegrationMultiDim::Type)
static function to get a string from the enumeration
IntegrationMultiDim::Type Type
static IntegrationMultiDim::Type GetType(const char *name)
static function to get the enumeration from a string
Numerical one dimensional integration options.
static void SetDefaultNPoints(unsigned int n)
static std::string DefaultIntegrator()
static double DefaultAbsTolerance()
static void SetDefaultAbsTolerance(double tol)
static double DefaultRelTolerance()
IntegratorOneDimOptions(IOptions *extraOpts=nullptr)
constructor using the default options can pass a pointer to extra options (N.B.
void Print(std::ostream &os=std::cout) const
print all the options
void SetIntegrator(const char *name)
set 1D integrator name
static void SetDefaultRelTolerance(double tol)
static void SetDefaultIntegrator(const char *name)
static ROOT::Math::IOptions & Default(const char *name)
retrieve specific options - if not existing create a IOptions
static void SetDefaultWKSize(unsigned int size)
std::string Integrator() const override
name of 1D integrator
static unsigned int DefaultNPoints()
static void PrintDefault(const char *name=nullptr, std::ostream &os=std::cout)
print only the specified default options
static unsigned int DefaultWKSize()
static IntegrationOneDim::Type DefaultIntegratorType()
static ROOT::Math::IOptions * FindDefault(const char *name)
find specific options - return 0 if not existing
unsigned int NPoints() const
Number of points used by current integration rule.
static std::string GetName(IntegrationOneDim::Type)
static function to get a string from the enumeration
IntegrationOneDim::Type Type
static IntegrationOneDim::Type GetType(const char *name)
static function to get the enumeration from a string
Type
enumeration specifying the integration types.
@ kADAPTIVESINGULAR
default adaptive integration type which can be used in the case of the presence of singularities.
@ kLEGENDRE
Gauss-Legendre integration.
@ kADAPTIVE
to be used for general functions without singularities
@ kGAUSS
simple Gauss integration method with fixed rule
@ kDEFAULT
default type specified in the static options
Type
enumeration specifying the integration types.
@ kADAPTIVE
adaptive multi-dimensional integration
@ kDEFAULT
default type specified in the static option
static double gDefaultRelTolerance
static double gDefaultAbsTolerance
static unsigned int gDefaultNCalls
static int gDefaultIntegrator
static unsigned int gDefaultWKSize
static int gDefaultIntegrator
static double gDefaultAbsTolerance
static unsigned int gDefaultWKSize
static unsigned int gDefaultNPoints
static unsigned int gDefaultNPointsGSLAdaptive
static double gDefaultRelTolerance
static unsigned int gDefaultNPointsLegendre
void PrintDefault(const char *name, std::ostream &os)
print default options
void Print(std::ostream &os, const OptionType &opt)
IntegratorMultiDimOptions OptType
static const char * DescriptionOfN()
static int N(const OptType &opt)
static const char * DescriptionOfN()
static int N(const OptType &opt)
IntegratorOneDimOptions OptType
static int N(const OptionType &)
static const char * DescriptionOfN()