Logo ROOT  
Reference Guide
DistSamplerOptions.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: L. Moneta Fri Aug 15 2008
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2008 LCG ROOT Math Team, CERN/PH-SFT *
7  * *
8  * *
9  **********************************************************************/
10 
11 #ifndef ROOT_Math_DistSamplerOptions
12 #define ROOT_Math_DistSamplerOptions
13 
14 #include <string>
15 
16 #include <iostream>
17 
18 namespace ROOT {
19 
20 
21 namespace Math {
22 
23 
24 class IOptions;
25 
26 //_______________________________________________________________________________
27 /**
28  DistSampler options class
29 
30  @ingroup NumAlgo
31 */
33 
34 public:
35 
36  // static methods for setting and retrieving the default options
37 
38  static void SetDefaultSampler(const char * type);
39  static void SetDefaultAlgorithm1D(const char * algo );
40  static void SetDefaultAlgorithmND(const char * algo );
41  static void SetDefaultPrintLevel(int level);
42 
43  static const std::string & DefaultSampler();
44  static const std::string & DefaultAlgorithm1D();
45  static const std::string & DefaultAlgorithmND();
46  static int DefaultPrintLevel();
47 
48  /// retrieve extra options - if not existing create a IOptions
49  static ROOT::Math::IOptions & Default(const char * name);
50 
51  // find extra options - return 0 if not existing
52  static ROOT::Math::IOptions * FindDefault(const char * name);
53 
54  /// print all the default options for the name given
55  static void PrintDefault(const char * name, std::ostream & os = std::cout);
56 
57 public:
58 
59  // constructor using the default options
60  // pass optionally a pointer to the additional options
61  // otherwise look if they exist for this default minimizer
62  // and in that case they are copied in the constructed instance
63  // constructor takes dimension since a different default algorithm
64  // is used if the dimension is 1 or greater than 1
65  DistSamplerOptions(int dim = 0);
66 
67  // destructor
69 
70  // copy constructor
72 
73  /// assignment operators
75 
76  /** non-static methods for retrivieng options */
77 
78  /// set print level
79  int PrintLevel() const { return fLevel; }
80 
81  /// return extra options (NULL pointer if they are not present)
82  IOptions * ExtraOptions() const { return fExtraOptions; }
83 
84  /// type of minimizer
85  const std::string & Sampler() const { return fSamplerType; }
86 
87  /// type of algorithm
88  const std::string & Algorithm() const { return fAlgoType; }
89 
90  /// print all the options
91  void Print(std::ostream & os = std::cout) const;
92 
93  /** non-static methods for setting options */
94 
95  /// set print level
96  void SetPrintLevel(int level) { fLevel = level; }
97 
98  /// set minimizer type
99  void SetSampler(const char * type) { fSamplerType = type; }
100 
101  /// set minimizer algorithm
102  void SetAlgorithm(const char *type) { fAlgoType = type; }
103 
104  /// set extra options (in this case pointer is cloned)
105  void SetExtraOptions(const IOptions & opt);
106 
107 
108 private:
109 
110  int fLevel; // debug print level
111  std::string fSamplerType; // DistSampler type (Unuran, Foam, etc...)xs
112  std::string fAlgoType; // DistSampler algorithmic specification (for Unuran only)
113 
114  // extra options
116 
117 };
118 
119  } // end namespace Math
120 
121 } // end namespace ROOT
122 
123 #endif
ROOT::Math::DistSamplerOptions::SetDefaultAlgorithmND
static void SetDefaultAlgorithmND(const char *algo)
Definition: DistSamplerOptions.cxx:39
ROOT::Math::DistSamplerOptions::SetSampler
void SetSampler(const char *type)
set minimizer type
Definition: DistSamplerOptions.h:99
ROOT::Math::DistSamplerOptions::SetDefaultSampler
static void SetDefaultSampler(const char *type)
Definition: DistSamplerOptions.cxx:31
ROOT::Math::DistSamplerOptions::fLevel
int fLevel
Definition: DistSamplerOptions.h:110
ROOT::Math::DistSamplerOptions::FindDefault
static ROOT::Math::IOptions * FindDefault(const char *name)
Definition: DistSamplerOptions.cxx:131
ROOT::Math::DistSamplerOptions::Algorithm
const std::string & Algorithm() const
type of algorithm
Definition: DistSamplerOptions.h:88
ROOT::Math::DistSamplerOptions::fAlgoType
std::string fAlgoType
Definition: DistSamplerOptions.h:112
ROOT::Math::DistSamplerOptions::Sampler
const std::string & Sampler() const
type of minimizer
Definition: DistSamplerOptions.h:85
ROOT::Math::DistSamplerOptions::SetDefaultPrintLevel
static void SetDefaultPrintLevel(int level)
Definition: DistSamplerOptions.cxx:43
ROOT::Math::DistSamplerOptions::DefaultPrintLevel
static int DefaultPrintLevel()
Definition: DistSamplerOptions.cxx:50
ROOT::Math::DistSamplerOptions::SetExtraOptions
void SetExtraOptions(const IOptions &opt)
set extra options (in this case pointer is cloned)
Definition: DistSamplerOptions.cxx:108
ROOT::Math::DistSamplerOptions::PrintLevel
int PrintLevel() const
non-static methods for retrivieng options
Definition: DistSamplerOptions.h:79
ROOT::Math::DistSamplerOptions::DefaultSampler
static const std::string & DefaultSampler()
Definition: DistSamplerOptions.cxx:52
ROOT::Math::DistSamplerOptions::PrintDefault
static void PrintDefault(const char *name, std::ostream &os=std::cout)
print all the default options for the name given
Definition: DistSamplerOptions.cxx:136
ROOT::Math::IOptions
Generic interface for defining configuration options of a numerical algorithm.
Definition: IOptions.h:31
ROOT::Math::DistSamplerOptions::DistSamplerOptions
DistSamplerOptions(int dim=0)
Definition: DistSamplerOptions.cxx:62
ROOT::Math::DistSamplerOptions::DefaultAlgorithmND
static const std::string & DefaultAlgorithmND()
Definition: DistSamplerOptions.cxx:49
ROOT::Math::DistSamplerOptions::fExtraOptions
ROOT::Math::IOptions * fExtraOptions
Definition: DistSamplerOptions.h:115
ROOT::Math::DistSamplerOptions::SetDefaultAlgorithm1D
static void SetDefaultAlgorithm1D(const char *algo)
Definition: DistSamplerOptions.cxx:35
ROOT::Math::DistSamplerOptions::~DistSamplerOptions
~DistSamplerOptions()
Definition: DistSamplerOptions.cxx:104
ROOT::Math::DistSamplerOptions::ExtraOptions
IOptions * ExtraOptions() const
return extra options (NULL pointer if they are not present)
Definition: DistSamplerOptions.h:82
ROOT::Math::DistSamplerOptions::DefaultAlgorithm1D
static const std::string & DefaultAlgorithm1D()
Definition: DistSamplerOptions.cxx:48
ROOT::Math::DistSamplerOptions::fSamplerType
std::string fSamplerType
Definition: DistSamplerOptions.h:111
ROOT::Math::DistSamplerOptions::operator=
DistSamplerOptions & operator=(const DistSamplerOptions &opt)
assignment operators
Definition: DistSamplerOptions.cxx:91
ROOT::Math::DistSamplerOptions::Default
static ROOT::Math::IOptions & Default(const char *name)
retrieve extra options - if not existing create a IOptions
Definition: DistSamplerOptions.cxx:126
name
char name[80]
Definition: TGX11.cxx:110
type
int type
Definition: TGX11.cxx:121
ROOT::Math::DistSamplerOptions::Print
void Print(std::ostream &os=std::cout) const
print all the options
Definition: DistSamplerOptions.cxx:114
ROOT::Math::DistSamplerOptions::SetPrintLevel
void SetPrintLevel(int level)
non-static methods for setting options
Definition: DistSamplerOptions.h:96
ROOT::Math::DistSamplerOptions
DistSampler options class.
Definition: DistSamplerOptions.h:32
ROOT
VSD Structures.
Definition: StringConv.hxx:21
Math
Namespace for new Math classes and functions.
ROOT::Math::DistSamplerOptions::SetAlgorithm
void SetAlgorithm(const char *type)
set minimizer algorithm
Definition: DistSamplerOptions.h:102