ROOT  6.06/09
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
static ROOT::Math::IOptions * FindDefault(const char *name)
void SetPrintLevel(int level)
non-static methods for setting options
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
static void SetDefaultAlgorithmND(const char *algo)
void SetSampler(const char *type)
set minimizer type
static void SetDefaultSampler(const char *type)
static void SetDefaultPrintLevel(int level)
void SetExtraOptions(const IOptions &opt)
set extra options (in this case pointer is cloned)
void Print(std::ostream &os=std::cout) const
print all the options
static const std::string & DefaultAlgorithmND()
static void PrintDefault(const char *name, std::ostream &os=std::cout)
print all the default options for the name given
DistSampler options class.
static ROOT::Math::IOptions & Default(const char *name)
retrieve extra options - if not existing create a IOptions
IOptions * ExtraOptions() const
return extra options (NULL pointer if they are not present)
DistSamplerOptions & operator=(const DistSamplerOptions &opt)
assignment operators
int type
Definition: TGX11.cxx:120
static const std::string & DefaultSampler()
static void SetDefaultAlgorithm1D(const char *algo)
Namespace for new Math classes and functions.
const std::string & Algorithm() const
type of algorithm
#define name(a, b)
Definition: linkTestLib0.cpp:5
Generic interface for defining configuration options of a numerical algorithm.
Definition: IOptions.h:32
ROOT::Math::IOptions * fExtraOptions
const std::string & Sampler() const
type of minimizer
void SetAlgorithm(const char *type)
set minimizer algorithm
static const std::string & DefaultAlgorithm1D()
int PrintLevel() const
non-static methods for retrivieng options