File indexing completed on 2025-01-18 10:10:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_Math_DistSamplerOptions
0012 #define ROOT_Math_DistSamplerOptions
0013
0014 #include <string>
0015
0016 #include <iostream>
0017 #include "Math/IOptions.h"
0018
0019 namespace ROOT {
0020
0021
0022 namespace Math {
0023
0024
0025
0026
0027
0028
0029
0030
0031 class DistSamplerOptions {
0032
0033 public:
0034
0035
0036
0037 static void SetDefaultSampler(const char * type);
0038 static void SetDefaultAlgorithm1D(const char * algo );
0039 static void SetDefaultAlgorithmND(const char * algo );
0040 static void SetDefaultPrintLevel(int level);
0041
0042 static const std::string & DefaultSampler();
0043 static const std::string & DefaultAlgorithm1D();
0044 static const std::string & DefaultAlgorithmND();
0045 static int DefaultPrintLevel();
0046
0047
0048 static ROOT::Math::IOptions & Default(const char * name);
0049
0050
0051 static ROOT::Math::IOptions * FindDefault(const char * name);
0052
0053
0054 static void PrintDefault(const char * name, std::ostream & os = std::cout);
0055
0056 public:
0057
0058
0059
0060
0061
0062
0063
0064 DistSamplerOptions(int dim = 0);
0065
0066
0067 ~DistSamplerOptions();
0068
0069
0070 DistSamplerOptions(const DistSamplerOptions & opt);
0071
0072
0073 DistSamplerOptions & operator=(const DistSamplerOptions & opt);
0074
0075
0076
0077
0078 int PrintLevel() const { return fLevel; }
0079
0080
0081 IOptions * ExtraOptions() const { return fExtraOptions; }
0082
0083
0084 const std::string & Sampler() const { return fSamplerType; }
0085
0086
0087 const std::string & Algorithm() const { return fAlgoType; }
0088
0089
0090 void Print(std::ostream & os = std::cout) const;
0091
0092
0093
0094
0095 void SetPrintLevel(int level) { fLevel = level; }
0096
0097
0098 void SetSampler(const char * type) { fSamplerType = type; }
0099
0100
0101 void SetAlgorithm(const char *type) { fAlgoType = type; }
0102
0103
0104 void SetExtraOptions(const IOptions & opt);
0105
0106
0107 template <class T>
0108 void SetAlgoOption(const char * name, T value) {
0109 if (!fExtraOptions) CreateExtraOptions();
0110 fExtraOptions->SetValue(name, value);
0111 }
0112
0113 protected:
0114
0115 void CreateExtraOptions();
0116
0117 private:
0118
0119 int fLevel;
0120 std::string fSamplerType;
0121 std::string fAlgoType;
0122
0123 ROOT::Math::IOptions * fExtraOptions;
0124
0125 };
0126
0127 }
0128
0129 }
0130
0131 #endif